Simple vector DB for prototypes.
Installation¶
pip install chromadb
Usage¶
import chromadb
client = chromadb.Client()
col = client.create_collection('docs')
col.add(documents=['PG is DB','Redis is cache'], ids=['d1','d2'])
results = col.query(query_texts=['relational database'], n_results=5)
Persistent¶
client = chromadb.PersistentClient(path='/data/chroma')
When to Use ChromaDB¶
ChromaDB is ideal for rapid prototyping of AI applications, especially RAG (Retrieval-Augmented Generation) pipelines. With its simple Python API, you can create a functional semantic search within minutes. ChromaDB automatically generates embeddings using a default model, so you do not need to manage an embedding pipeline separately.
For production deployments with millions of documents, consider switching to Qdrant or Pinecone, which offer better scalability and distributed processing. However, ChromaDB remains the best choice for local development, experiments, and smaller projects with up to approximately 100,000 documents. It also supports metadata filtering, allowing you to combine vector search with traditional filters.
ChromaDB for Getting Started¶
Simplest vector search. For production use Pinecone/Qdrant.