Skip to main content

ChromaDB Cheatsheet

ChromaDB is an open-source embedded vector database designed for LLM applications. Supports semantic search, metadata filtering, document management, and persistent storage. Runs as a standalone server or embedded in Python — the top choice for RAG applications.

Updated: 2026-07-20·17 commands

Quick Start

``bash # Install pip install chromadb

# Start server chroma run --path ./chroma_data --port 8000

# Python client (from another terminal) python -c " import chromadb client = chromadb.HttpClient(host='localhost', port=8000) print(client.heartbeat()) # should print a timestamp " `

Collections

Collections are like tables in a traditional database. Each collection has a name and optional embedding function. Default is sentence-transformers all-MiniLM-L6-v2. Create, list, get, and delete collections via the client.

CRUD Operations

Add documents with collection.add(documents, metadatas, ids). Query with collection.query(query_texts, n_results, where). Update with collection.update(ids, documents). Delete with collection.delete(ids). Get by ID with collection.get(ids).

Metadata Filtering

Filter search results using the where parameter. Supports comparison operators ($gt, $lt, $gte, $lte, $ne, $eq) and logical operators ($and, $or). Metadata can be any JSON-serializable dict.

API Access

ChromaDB serves a REST API at /api/v1/. You can use curl or HTTP clients directly without the Python library: curl http://localhost:8000/api/v1/collections`.

Startup & Modes(12)

CommandLevel
chroma --help
Show Chroma CLI help
Basic
pip install chromadb
Install ChromaDB
Basic
python import chromadb
Create Chroma client in Python
Intermediate
create collection
Create a collection
Intermediate
collection add
Add documents to a collection
Intermediate
collection query
Query a collection (semantic search)
Intermediate
collection add with metadata
Add documents with metadata
Intermediate
collection delete
Delete documents from collection
Intermediate
collection get
Get documents by IDs
Intermediate
collection update
Update documents in collection
Intermediate
list collections
List all collections
Basic
delete collection
Delete a collection
Intermediate

ai-server(5)

CommandLevel
chroma run
Start Chroma server
Basic
chroma run --path
Specify data persistence path
Basic
chroma run --host
Specify bind host address
Basic
chroma run --port
Specify server port (default 8000)
Basic
curl collections API
Get collection list via API
Basic

FAQ

This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-20.