Chroma
Chroma HTTP API v2 (local or Chroma Cloud, one database per config), collections, get/query/search records, agent adds and upserts need an opt-in, deletes are node only
Beta v0.1.0 Node.js 16 actions
About
A Graphrt plugin for Chroma over its HTTP API v2 (OpenAPI: api.trychroma.com/openapi.json), for a local or self-hosted server or Chroma Cloud. It lists and creates collections, gets, queries and searches records, and adds, upserts and updates them. It is built with the declarative REST layer (definition.mjs).
What it can do
- Server: heartbeat, get_identity (tenant and databases of the token)
- Collections: list_collections, count_collections, get_collection (by name, returns the id), create_collection (get-or-create by default), delete_collection (node only)
- Records (by collection id): count_records, get_records (ids, where, where_document), query_records (nearest neighbours of query embeddings), search_records (Search API with rank expressions such as $knn), add_records, upsert_records, update_records, delete_records (node only)
- api_request: other GET endpoints of the database, e.g. /collections/<collection_id>/indexing_status (agents: GET only, on an allowlist)
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Heartbeat
chroma.heartbeat - Get identity
chroma.get_identity - List collections
chroma.list_collections - Count collections
chroma.count_collections - Get collection
chroma.get_collection - Create collection
chroma.create_collection - Delete collection
chroma.delete_collection - Count records
chroma.count_records - Get records
chroma.get_records - Query records
chroma.query_records
Show all 16 actions
- Search records
chroma.search_records - Add records
chroma.add_records - Upsert records
chroma.upsert_records - Update records
chroma.update_records - Delete records
chroma.delete_records - Chroma API (database-scoped) request
chroma.api_request
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
CHROMA_URLOptionalServer URL, default http://localhost:8000, Chroma Cloud: https://api.trychroma.com. Must be https unless the host is localhost. -
CHROMA_API_KEYFor Cloud / secured serversToken, sent as x-chroma-token, leave unset for a local server without auth -
CHROMA_AUTH_HEADEROptionalauthorization to send the token as Authorization: Bearer (servers configured for bearer tokens) -
CHROMA_TENANTOptionalTenant, default default_tenant (Chroma Cloud: your tenant id) -
CHROMA_DATABASEOptionalDatabase, default default_database -
CHROMA_TOOL_ALLOW_WRITESOptional1 lets agent tools create collections and add, upsert and update records -
CHROMA_TOOL_API_EXTRA_PATHSOptionalMore GET paths (relative to the database) for agent api_request, comma-separated, * = one segment
How to use it
In Graphrt Desktop
- Open Plugins and search for Chroma.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install chroma workflow.yaml
- id: collection
type: chroma.get_collection
collection_name: articles
- id: hits
type: chroma.query_records
collection_id: "{{#collection.data.id#}}"
query_embeddings: ["{{#embed.data.embedding#}}"]
n_results: 5
where: { lang: id }