[ENH] add a Ruby client for Chroma - #6120
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
|
It layers on top of the generated OpenAPI models with higher-level abstractions for collections, search, schemas, and embedding functions, while extending configuration for tenants, databases, and authentication. The PR also expands CI to build and test the gem and adds integration suites and scripts that validate both single-node and cloud workflows. Affected Areas• clients/ruby/lib/chromadb This summary was automatically generated by @propel-code-bot |
| ```ruby | ||
| search = Chroma::Search::Search.new | ||
| .where(Chroma::Search::K["type"].eq("doc")) | ||
| .rank(Chroma::Search.Knn(query: "ruby", key: "#embedding", limit: 10)) |
There was a problem hiding this comment.
[Documentation] Fix namespace access: change Chroma::Search.Knn to Chroma::Search::Knn so the example references the Knn class correctly.
Context for Agents
[**Documentation**]
Fix namespace access: change `Chroma::Search.Knn` to `Chroma::Search::Knn` so the example references the `Knn` class correctly.
File: clients/ruby/README.md
Line: 129|
The # Single Insert
collection.add(
id: "a",
embedding: [0.1, 0.2, 0.3],
document: "Once upon a time...",
metadata: {
topic: 'story'
}
)
# Multi Insert
collection.add([
{
id: "a",
embedding: [0.1, 0.2, 0.3],
document: "Once upon a time...",
metadata: {
topic: 'story'
}
},
{
id: "b",
embedding: [0.3, 0.2, 0.1],
document: "A long time ago...",
metadata: {
topic: 'movie'
}
}
]) |

This PR introduces an official Ruby client to Chroma, compatible with both local
Chroma and the latest Chroma Cloud APIs.
It’s currently published under the
chromadb-experimentalgem on RubyGems - please tryit and provide feedback (the package name may change, which would be a breaking
update). https://rubygems.org/gems/chromadb-experimental
Long‑term, the gem will move to
chromadborchromadb-official. We’re awaiting RubyGemssupport on using the chromadb name (it’s currently available but rejected due to
similarity with the
chroma-dbgem).Notes:
functions or embed outside the library.
clients/ruby/spec/integration/single_node_spec.rbclients/ruby/spec/integration/cloud_spec.rbclients/ruby/README.md(docs.trychroma.com will need a separate update)Here is a basic example with local Chroma:
Here is a more advanced example with Cloud Chroma: