KosmoKrator

data

Chroma CLI for AI Agents

Use the Chroma CLI from KosmoKrator to call Chroma tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 5 read 2 write API key auth

Chroma CLI Setup

Chroma can be configured headlessly with `kosmokrator integrations:configure chroma`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure chroma --set api_key="$CHROMA_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor chroma --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
api_key CHROMA_API_KEY Secret secret yes API Key
url CHROMA_URL URL url no Chroma Server URL

Call Chroma Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call chroma.chroma_list_collections '{
  "limit": 1,
  "after": "example_after"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:chroma chroma_list_collections '{
  "limit": 1,
  "after": "example_after"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs chroma --json
kosmo integrations:docs chroma.chroma_list_collections --json
kosmo integrations:schema chroma.chroma_list_collections --json
kosmo integrations:search "Chroma" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Chroma.

chroma.chroma_list_collections

Read read

List all vector collections in Chroma. Returns collection names and IDs that can be used for further operations.

Parameters
limit, after

Generic CLI call

kosmo integrations:call chroma.chroma_list_collections '{"limit":1,"after":"example_after"}' --json

Provider shortcut

kosmo integrations:chroma chroma_list_collections '{"limit":1,"after":"example_after"}' --json

chroma.chroma_get_collection

Read read

Get details of a specific Chroma collection by its name or UUID, including metadata and document count.

Parameters
collection_id

Generic CLI call

kosmo integrations:call chroma.chroma_get_collection '{"collection_id":"example_collection_id"}' --json

Provider shortcut

kosmo integrations:chroma chroma_get_collection '{"collection_id":"example_collection_id"}' --json

chroma.chroma_create_collection

Write write

Create a new vector collection in Chroma. Collections are used to store and query document embeddings.

Parameters
name, description, metadata

Generic CLI call

kosmo integrations:call chroma.chroma_create_collection '{"name":"example_name","description":"example_description","metadata":"example_metadata"}' --json

Provider shortcut

kosmo integrations:chroma chroma_create_collection '{"name":"example_name","description":"example_description","metadata":"example_metadata"}' --json

chroma.chroma_add_documents

Write write

Add documents with embeddings to a Chroma collection. Each document requires an ID and either embeddings or text content.

Parameters
collection_id, ids, embeddings, documents, metadatas

Generic CLI call

kosmo integrations:call chroma.chroma_add_documents '{"collection_id":"example_collection_id","ids":"example_ids","embeddings":"example_embeddings","documents":"example_documents","metadatas":"example_metadatas"}' --json

Provider shortcut

kosmo integrations:chroma chroma_add_documents '{"collection_id":"example_collection_id","ids":"example_ids","embeddings":"example_embeddings","documents":"example_documents","metadatas":"example_metadatas"}' --json

chroma.chroma_query_documents

Read read

Search for similar documents in a Chroma collection using query embeddings or text. Returns the most similar documents ranked by distance.

Parameters
collection_id, query_embeddings, query_texts, n_results, where, where_document, include

Generic CLI call

kosmo integrations:call chroma.chroma_query_documents '{"collection_id":"example_collection_id","query_embeddings":"example_query_embeddings","query_texts":"example_query_texts","n_results":1,"where":"example_where","where_document":"example_where_document","include":"example_include"}' --json

Provider shortcut

kosmo integrations:chroma chroma_query_documents '{"collection_id":"example_collection_id","query_embeddings":"example_query_embeddings","query_texts":"example_query_texts","n_results":1,"where":"example_where","where_document":"example_where_document","include":"example_include"}' --json

chroma.chroma_get_document

Read read

Retrieve specific documents from a Chroma collection by their IDs. Returns the full documents including text, embeddings, and metadata.

Parameters
collection_id, ids, where, where_document, include, limit, offset

Generic CLI call

kosmo integrations:call chroma.chroma_get_document '{"collection_id":"example_collection_id","ids":"example_ids","where":"example_where","where_document":"example_where_document","include":"example_include","limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:chroma chroma_get_document '{"collection_id":"example_collection_id","ids":"example_ids","where":"example_where","where_document":"example_where_document","include":"example_include","limit":1,"offset":1}' --json

chroma.chroma_get_health

Read read

Check the health status of the Chroma vector database server. Returns heartbeat and version information.

Parameters
none

Generic CLI call

kosmo integrations:call chroma.chroma_get_health '{}' --json

Provider shortcut

kosmo integrations:chroma chroma_get_health '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

chroma.chroma_list_collections

List all vector collections in Chroma. Returns collection names and IDs that can be used for further operations.

Operation
Read read
Schema command
kosmo integrations:schema chroma.chroma_list_collections --json
ParameterTypeRequiredDescription
limit integer no Maximum number of collections to return (default: 100).
after string no Cursor for pagination — pass the value from a previous response to get the next page.

chroma.chroma_get_collection

Get details of a specific Chroma collection by its name or UUID, including metadata and document count.

Operation
Read read
Schema command
kosmo integrations:schema chroma.chroma_get_collection --json
ParameterTypeRequiredDescription
collection_id string yes The collection name or UUID.

chroma.chroma_create_collection

Create a new vector collection in Chroma. Collections are used to store and query document embeddings.

Operation
Write write
Schema command
kosmo integrations:schema chroma.chroma_create_collection --json
ParameterTypeRequiredDescription
name string yes The name of the collection to create.
description string no An optional description of the collection.
metadata object no Optional metadata to attach to the collection (JSON object with string values).

chroma.chroma_add_documents

Add documents with embeddings to a Chroma collection. Each document requires an ID and either embeddings or text content.

Operation
Write write
Schema command
kosmo integrations:schema chroma.chroma_add_documents --json
ParameterTypeRequiredDescription
collection_id string yes The collection name or UUID to add documents to.
ids array yes Array of unique document IDs (strings).
embeddings array no Array of embedding vectors. Each embedding is an array of floats. Required if no documents text provided.
documents array no Array of text documents. Chroma will generate embeddings if no embeddings are provided.
metadatas array no Array of metadata objects (one per document) with string values.

chroma.chroma_query_documents

Search for similar documents in a Chroma collection using query embeddings or text. Returns the most similar documents ranked by distance.

Operation
Read read
Schema command
kosmo integrations:schema chroma.chroma_query_documents --json
ParameterTypeRequiredDescription
collection_id string yes The collection name or UUID to query.
query_embeddings array no Array of query embedding vectors. Each embedding is an array of floats.
query_texts array no Array of query text strings. Chroma will generate embeddings automatically.
n_results integer no Number of results to return per query (default: 10).
where string no JSON-encoded filter expression for metadata filtering, e.g. {"category": "tech"}.
where_document string no JSON-encoded filter on document content, e.g. {"$contains": "search term"}.
include array no Fields to include in response: documents, embeddings, metadatas, distances. Default: ["documents", "metadatas", "distances"].

chroma.chroma_get_document

Retrieve specific documents from a Chroma collection by their IDs. Returns the full documents including text, embeddings, and metadata.

Operation
Read read
Schema command
kosmo integrations:schema chroma.chroma_get_document --json
ParameterTypeRequiredDescription
collection_id string yes The collection name or UUID.
ids array no Array of document IDs to retrieve.
where string no JSON-encoded metadata filter, e.g. {"category": "tech"}.
where_document string no JSON-encoded document content filter, e.g. {"$contains": "search term"}.
include array no Fields to include: documents, embeddings, metadatas. Default: ["documents", "metadatas"].
limit integer no Maximum number of documents to return (default: 100).
offset integer no Number of documents to skip for pagination.

chroma.chroma_get_health

Check the health status of the Chroma vector database server. Returns heartbeat and version information.

Operation
Read read
Schema command
kosmo integrations:schema chroma.chroma_get_health --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.