ChromaDB

Open-source, embedded vector database. Easy to get started locally. Supports persistent storage and can run as a server. Great for development and small-scale production.

Syntax

vector-databases
client = chromadb.Client()
collection = client.create_collection("name")

Example

vector-databases
import chromadb

# Persistent local storage:
client = chromadb.PersistentClient(path="./chroma_db")
collection = client.get_or_create_collection(
    name="documents",
    metadata={"hnsw:space": "cosine"}
)

collection.add(
    documents=["doc text..."],
    embeddings=[[0.1, 0.2, ...]],
    metadatas=[{"source": "file.pdf"}],
    ids=["doc1"]
)