Chroma API. All API functions return a derefable promise. If the value of the promise is an exception, it will be thrown upon deref.
Supports both v1 and v2 APIs. Set api-version to "v1" or "v2" (default).
Chroma API. All API functions return a derefable promise. If the value of the promise is an exception, it will be thrown upon deref. Supports both v1 and v2 APIs. Set *api-version* to "v1" or "v2" (default).
(add collection embeddings & {:keys [upsert?] :or {upsert? false} :as options})Add the given embedding records to a collection.
Add the given embedding records to a collection.
(add-batches collection
embeddings
&
{:keys [upsert? batch-size parallel]
:or {upsert? false parallel 1 batch-size 32}
:as options})Add the given embedding records to a collection in batches, using the specified level of parallelism.
Add the given embedding records to a collection in batches, using the specified level of parallelism.
(collections & {:keys [offset limit] :or {offset 0 limit 100} :as options})List collections.
Returns only limit results: use offset to page through results.
Alternatively, if more pages are available, the returned data will
have a ::next-page metadata entry, the value of which which is a
zero-arg function to call collections again for the next page of
data.
List collections. Returns only `limit` results: use `offset` to page through results. Alternatively, if more pages are available, the returned data will have a ::next-page metadata entry, the value of which which is a zero-arg function to call `collections` again for the next page of data.
(count collection)Return the number of embeddings in a collection
Return the number of embeddings in a collection
(count-collections)Total number of collections
Total number of collections
(create-collection
name
&
{:keys [metadata configuration] :or {configuration {}} :as options})Idempotently create a new collection. Note: In v2, metadata cannot be empty - defaults are always applied.
Idempotently create a new collection. Note: In v2, metadata cannot be empty - defaults are always applied.
(delete collection & {:keys [where ids where-document] :as options})Delete embeddings. Options are:
ids: Only return the specified IDs.where: Only return records with matching metadata fields, using
Chroma's filtering syntax.where-document: Only return records with a fulltext document
match, using Chroma's filtering syntax.At least one of these options is required (this function should not be used to delete all records in a collection.)
Delete embeddings. Options are: - `ids`: Only return the specified IDs. - `where`: Only return records with matching metadata fields, using Chroma's filtering syntax. - `where-document`: Only return records with a fulltext document match, using Chroma's filtering syntax. At least one of these options is required (this function should not be used to delete all records in a collection.)
(delete-collection collection)Delete a collection
Delete a collection
(fork-collection collection new-name)Fork (copy) a collection to a new collection with the given name (v2 API only).
NOTE: Chroma Cloud only - not available in self-hosted/local deployments. Local executor returns 'Collection forking is unsupported for local chroma'.
Returns the newly created collection.
Example: (fork-collection my-collection "my-collection-backup")
Fork (copy) a collection to a new collection with the given name (v2 API only). NOTE: Chroma Cloud only - not available in self-hosted/local deployments. Local executor returns 'Collection forking is unsupported for local chroma'. Returns the newly created collection. Example: (fork-collection my-collection "my-collection-backup")
(get collection
&
{:keys [where ids where-document include offset limit]
:or {include #{:documents :metadatas} offset 0 limit 100}
:as options})Get embeddings from a collection.
Options are:
ids: Only return the specified IDs.
where: Only return records with matching metadata fields, using
Chroma's filtering syntax.
where-document: Only return records with a fulltext document
match, using Chroma's filtering syntax.
include is an optional set indicating which parts of an
embedding to return. Default is #{:metadatas :documents}
limit and offset: returns only limit results: use offset
to page through results.
Alternatively, if more pages are available, the returned data will
have a ::next-page metadata entry, the value of which which is a
zero-arg function to call get again for the next page of data.
Get embeddings from a collection.
Options are:
- `ids`: Only return the specified IDs.
- `where`: Only return records with matching metadata fields, using
Chroma's filtering syntax.
- `where-document`: Only return records with a fulltext document
match, using Chroma's filtering syntax.
- `include` is an optional set indicating which parts of an
embedding to return. Default is #{:metadatas :documents}
- `limit` and `offset`: returns only `limit` results: use `offset`
to page through results.
Alternatively, if more pages are available, the returned data will
have a ::next-page metadata entry, the value of which which is a
zero-arg function to call `get` again for the next page of data.(get-collection name)Find and return collection
Find and return collection
(heartbeat)Check that the Chroma server is active and responding.
Check that the Chroma server is active and responding.
(page-seq promise)Return a lazy sequence formed by fetching additional pages of results, when ::next-page metadata is present on the results data structure.
Return a lazy sequence formed by fetching additional pages of results, when ::next-page metadata is present on the results data structure.
(query collection
query-embedding
&
{:keys [where include num-results]
:or {num-results 10 include #{:documents :distances :metadatas}}
:as options})Perform a KNN search based on a query vector, returning results ordered by increasing distance.
filter and include options are the same as in get.
num-results controls the number of matches returned.
Perform a KNN search based on a query vector, returning results ordered by increasing distance. `filter` and `include` options are the same as in `get`. `num-results` controls the number of matches returned.
(query-batch collection
query-embeddings
&
{:keys [where where-document include num-results]
:or {num-results 10 include #{:documents :distances :metadatas}}
:as options})Similar to query, but takes a seq of query embeddings
Similar to `query`, but takes a seq of query embeddings
(reset)Reset the entire database. Forbidden unless clojure-chroma-client/allow-reset is set. Does not work on Chroma Cloud.
Reset the entire database. Forbidden unless clojure-chroma-client/*allow-reset* is set. Does not work on Chroma Cloud.
(search collection searches)Perform hybrid search combining vector similarity, metadata filtering, and full-text search (v2 API only).
NOTE: Chroma Cloud only - not available in self-hosted/local deployments. Local executor returns 'Not implemented for local executor'.
searches is a vector of search specifications, each containing:
Example: (search collection [{:filter {:where {:type "note"}} :limit {:limit 10} :select {:keys ["documents" "metadatas"]}}])
Perform hybrid search combining vector similarity, metadata filtering,
and full-text search (v2 API only).
NOTE: Chroma Cloud only - not available in self-hosted/local deployments.
Local executor returns 'Not implemented for local executor'.
`searches` is a vector of search specifications, each containing:
- :filter {:query-ids [...] :where {...}} - Filter criteria
- :rank {...} - Ranking configuration
- :select {:keys [...]} - Fields to return
- :limit {:limit n :offset m} - Pagination
- :group-by {:keys [...] :aggregate {...}} - Grouping
Example:
(search collection
[{:filter {:where {:type "note"}}
:limit {:limit 10}
:select {:keys ["documents" "metadatas"]}}])(update collection embeddings)Update one or more embedding records
Update one or more embedding records
(update-collection collection & {:keys [name metadata] :as options})Update a collection's name and/or metadata.
Update a collection's name and/or metadata.
(version)The version of Chroma as reported by the server.
The version of Chroma as reported by the server.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |