Graphrt

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
Use in Graphrt Desktop

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_URL Optional
    Server URL, default http://localhost:8000, Chroma Cloud: https://api.trychroma.com. Must be https unless the host is localhost.
  • CHROMA_API_KEY For Cloud / secured servers
    Token, sent as x-chroma-token, leave unset for a local server without auth
  • CHROMA_AUTH_HEADER Optional
    authorization to send the token as Authorization: Bearer (servers configured for bearer tokens)
  • CHROMA_TENANT Optional
    Tenant, default default_tenant (Chroma Cloud: your tenant id)
  • CHROMA_DATABASE Optional
    Database, default default_database
  • CHROMA_TOOL_ALLOW_WRITES Optional
    1 lets agent tools create collections and add, upsert and update records
  • CHROMA_TOOL_API_EXTRA_PATHS Optional
    More GET paths (relative to the database) for agent api_request, comma-separated, * = one segment

How to use it

In Graphrt Desktop

  1. Open Plugins and search for Chroma.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

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 }
Plugins in the docs