Chroma
Store rows with their vectors in Chroma and search them by similarity with metadata filters. Typical uses: give an LLM the closest documents (RAG), find similar records.
chroma pingchroma collection_createchroma collection_createchroma collectionschroma collection_dropchroma insertchroma insertchroma collection_infochroma searchchroma searchchroma findchroma findchroma getchroma getchroma countchroma countchroma deletechroma delete_wherechroma requestchroma request

chroma ping <config>


Description

    Test the connection: {engine, version} (the version of the API)

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
admin
chroma ping "{\"url\": \"http://localhost:8000\"}"
mentdb
{"engine": "chroma", "version": "1.0.0"}

chroma collection_create <config> <collection>


Description

    Create a collection with the cosine distance. Returns {created}; an error if it exists

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
admin
chroma collection_create "{\"url\": \"http://localhost:8000\"}" "faq"
mentdb
{"created": "faq"}

chroma collection_create <config> <collection> <json_options>


Description

    Create with options: space (cosine, l2 or ip), metadata (an object), get_or_create (false; true: no error if it exists)

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    json_options:   The options: see the description - String - required
admin
chroma collection_create "{\"url\": \"http://localhost:8000\"}" "faq_l2" "{\"space\": \"l2\", \"metadata\": {\"owner\": \"support\"}}"
mentdb
{"created": "faq_l2"}
no error if it exists (fixed result: real Chroma 1.5.9)
admin
chroma collection_create "{\"url\": \"http://localhost:8000\"}" "faq" "{\"get_or_create\": true}"
mentdb
{"created": "faq"}

chroma collections <config>


Description

    The names of the collections of the database, as a JSON array

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
admin
chroma collections "{\"url\": \"http://localhost:8000\"}"
mentdb
["faq_l2", "faq"]

chroma collection_drop <config> <collection>


Description

    Delete a collection. Returns {dropped: name}, or {dropped: null} if it did not exist

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
admin
chroma collection_drop "{\"url\": \"http://localhost:8000\"}" "faq_l2"
mentdb
{"dropped": "faq_l2"}
no such collection (fixed result: real Chroma 1.5.9)
admin
chroma collection_drop "{\"url\": \"http://localhost:8000\"}" "nothing"
mentdb
{"dropped": null}

chroma insert <config> <collection> <rows_json>


Description

    Insert or replace records from rows (see the description: a replaced id keeps its document when the row has none, its metadata are merged). Returns {inserted, errors}

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    rows_json:   The rows: a JSON array of objects with an id, a vector field and other fields; or a JSON array of texts (the output of llm chunk) with the parameter vectors - String - required
admin
chroma insert "{\"url\": \"http://localhost:8000\"}" "faq" "[{\"id\": \"a1\", \"document\": \"Refunds are paid within 14 days.\", \"lang\": \"en\", \"embedding\": [0.9, 0.1, 0]}, {\"id\": \"a2\", \"document\": \"Deliveries take 3 days.\", \"lang\": \"en\", \"embedding\": [0.1, 0.9, 0]}, {\"id\": \"a3\", \"document\": \"Les retours sont gratuits.\", \"lang\": \"fr\", \"embedding\": [0.8, 0.2, 0.1]}]"
mentdb
{"inserted": 3, "errors": []}

chroma insert <config> <collection> <rows_json> <json_options>


Description

    Insert with options: id_field (id), vector_field (embedding), document_field (document), vectors, fields, batch_size (256)

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    rows_json:   The rows: a JSON array of objects with an id, a vector field and other fields; or a JSON array of texts (the output of llm chunk) with the parameter vectors - String - required
    json_options:   The options: see the description - String - required
admin
chroma insert "{\"url\": \"http://localhost:8000\"}" "faq" "[\"Refunds are paid within 14 days.\", \"Our shops open at 8 am.\"]" "{\"vectors\": [[0.85, 0.15, 0.05], [0, 0.2, 0.95]]}"
mentdb
{"inserted": 2, "errors": []}
other field names (fixed result: real Chroma 1.5.9)
admin
chroma insert "{\"url\": \"http://localhost:8000\"}" "faq" "[{\"ref\": \"a4\", \"text\": \"Gift cards never expire.\", \"v\": [0.3, 0.3, 0.3], \"lang\": \"en\"}]" "{\"id_field\": \"ref\", \"document_field\": \"text\", \"vector_field\": \"v\"}"
mentdb
{"inserted": 1, "errors": []}

chroma collection_info <config> <collection>


Description

    A collection: {id, name, dimension, space, metadata, count}

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
admin
chroma collection_info "{\"url\": \"http://localhost:8000\"}" "faq"
mentdb
{"id": "6b382eab-df91-483f-966f-34a8b38eb96b", "name": "faq", "dimension": 3, "space": "cosine", "metadata": {"hnsw:space": "cosine"}, "count": 6}

chroma find <config> <collection> <filter_json>


Description

    The records matching a where filter ({}: all), without vectors, 100 at most

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    filter_json:   The filter as a JSON object ({} or an empty text: no filter) - String - required
admin
chroma find "{\"url\": \"http://localhost:8000\"}" "faq" "{}"
mentdb
[{"id": "a1", "document": "Refunds are paid within 14 days.", "lang": "en"}, {"id": "a2", "document": "Deliveries take 3 days.", "lang": "en"}, {"id": "a3", "document": "Les retours sont gratuits.", "lang": "fr"}, {"id": "fd8dfec6-c962-374d-ad18-d1e621f60a6b", "document": "Refunds are paid within 14 days."}, {"id": "ba60c502-ea42-34a6-88aa-96329f33b3d5", "document": "Our shops open at 8 am."}, {"id": "a4", "document": "Gift cards never expire.", "lang": "en"}]

chroma find <config> <collection> <filter_json> <json_options>


Description

    Find with options: limit (100, 100000 at most), skip, where_document, fields, with_vector, vector_field

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    filter_json:   The filter as a JSON object ({} or an empty text: no filter) - String - required
    json_options:   The options: see the description - String - required
admin
chroma find "{\"url\": \"http://localhost:8000\"}" "faq" "{\"lang\": {\"$in\": [\"en\", \"fr\"]}}" "{\"limit\": 2, \"skip\": 1}"
mentdb
[{"id": "a2", "document": "Deliveries take 3 days.", "lang": "en"}, {"id": "a3", "document": "Les retours sont gratuits.", "lang": "fr"}]

chroma get <config> <collection> <id>


Description

    A record by its id, as an object; null if absent

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    id:   The id - String - required
admin
chroma get "{\"url\": \"http://localhost:8000\"}" "faq" "a3"
mentdb
{"id": "a3", "document": "Les retours sont gratuits.", "lang": "fr"}
absent (fixed result: real Chroma 1.5.9)
admin
chroma get "{\"url\": \"http://localhost:8000\"}" "faq" "nothing"
mentdb
null

chroma get <config> <collection> <id> <json_options>


Description

    Get with options: with_vector, vector_field

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    id:   The id - String - required
    json_options:   The options: see the description - String - required
admin
chroma get "{\"url\": \"http://localhost:8000\"}" "faq" "a1" "{\"with_vector\": true}"
mentdb
{"id": "a1", "document": "Refunds are paid within 14 days.", "embedding": [0.9, 0.1, 0], "lang": "en"}

chroma count <config> <collection>


Description

    The number of records of a collection

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
admin
chroma count "{\"url\": \"http://localhost:8000\"}" "faq"
mentdb
6

chroma count <config> <collection> <filter_json>


Description

    The number of records matching a where filter

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    filter_json:   The filter as a JSON object ({} or an empty text: no filter) - String - required
admin
chroma count "{\"url\": \"http://localhost:8000\"}" "faq" "{\"lang\": \"en\"}"
mentdb
3

chroma delete <config> <collection> <id>


Description

    Delete a record by its id. Returns {deleted: 1}, or 0 if absent

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    id:   The id - String - required
admin
chroma delete "{\"url\": \"http://localhost:8000\"}" "faq" "a4"
mentdb
{"deleted": 1}

chroma delete_where <config> <collection> <filter_json>


Description

    Delete the records matching a where filter (an empty filter is refused). Returns {deleted}

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    collection:   The collection: 3 to 512 letters, digits, _ . - (first and last: a letter or a digit) - String - required
    filter_json:   The filter as a JSON object ({} or an empty text: no filter) - String - required
admin
chroma delete_where "{\"url\": \"http://localhost:8000\"}" "faq" "{\"lang\": \"fr\"}"
mentdb
{"deleted": 1}

chroma request <config> <method> <path>


Description

    Any GET or DELETE of the API: the raw JSON answer

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    method:   GET, POST, PUT, PATCH, DELETE or HEAD - String - required
    path:   The path relative to the url, like /collections - String - required
admin
chroma request "{\"url\": \"http://localhost:8000\"}" "GET" "/api/v2/tenants/default_tenant/databases/default_database/collections_count"
mentdb
1

chroma request <config> <method> <path> <body_json>


Description

    Any call of the API with a JSON body: the raw JSON answer

Parameters

    config:   The Chroma configuration as JSON: url (http://127.0.0.1:8000), api_key (the name of a secret: secret set), allow_plain (false: an API key over http is refused unless the host is localhost, 127.0.0.1 or ::1; true: accept to send it in clear), timeout_ms (30000), max_bytes (64 MB, the limit of a response, 256 MB at most), tenant (default_tenant), database (default_database), auth_header (authorization: Bearer token; x-chroma-token: Chroma Cloud) - String - required
    method:   GET, POST, PUT, PATCH, DELETE or HEAD - String - required
    path:   The path relative to the url, like /collections - String - required
    body_json:   The JSON body - String - required
admin
chroma request "{\"url\": \"http://localhost:8000\"}" "POST" "/api/v2/tenants/default_tenant/databases" "{\"name\": \"archive\"}"
mentdb
{}