ChromaDB

1.5.5 · active · verified Thu Mar 19

Open-source embedded vector database for AI applications. Runs in-process (EphemeralClient, PersistentClient) or client-server mode (HttpClient). Handles embedding storage, metadata filtering, and similarity search. Supports pluggable embedding functions. Core backend rewritten in Rust in 1.x; also ships a lightweight HTTP-only client as the separate chromadb-client package.

Warnings

Install

Imports

Quickstart

get_or_create_collection() is idempotent and preferred over create_collection() for most use cases. Python 3.9+ required — chromadb's telemetry dependency (posthog) fails silently on 3.8 with a misleading TypeError.

import sys
if sys.version_info < (3, 9):
    raise RuntimeError("chromadb requires Python 3.9+. Current: " +
  sys.version)

import chromadb

# In-memory (prototyping)
client = chromadb.EphemeralClient()

# Persistent (local dev)
# client =
  chromadb.PersistentClient(path="/path/to/db")

collection = client.get_or_create_collection("my_docs")

collection.add(

  documents=["This is doc one", "This is doc two"],
    ids=["id1", "id2"],
)

results = collection.query(
    query_texts=["find
  something"],
    n_results=2,
)
print(results)

view raw JSON →