Chroma is an open-source, AI-native vector database designed for storing, searching, and managing embeddings alongside metadata, documents, and rich filtering. It sits at the heart of retrieval-augmented generation (RAG) pipelines, giving LLMs long-term memory and semantic search over private data. Chroma runs in-memory for rapid prototyping, on disk for local persistence, or as a remote HTTP server and fully managed Chroma Cloud for production scale β all under the same Python and JavaScript API. The key mental model is that a collection acts like a smart table: every record holds an ID, an embedding vector, optional metadata key-value pairs, and an optional document string, and everything from insert to nearest-neighbor search runs through that single consistent shape.
What This Cheat Sheet Covers
This topic spans 17 focused tables and 126 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Client Types and Initialization
Choosing the right Chroma client is the first decision in every project β it determines where data lives, whether it persists, and how many processes can share it. Each client type presents the identical collection API, so switching from development to production requires only changing the client constructor.
| Type | Example | Description |
|---|---|---|
import chromadbclient = chromadb.EphemeralClient() | In-memory only client; data is lost when the process exits. β’ Ideal for tests and rapid prototyping β’ No disk I/O overhead | |
client = chromadb.PersistentClient( path="./chroma_db") | Writes to disk at the given path; data survives restarts. Default choice for local development. | |
client = chromadb.HttpClient( host="localhost", port=8000) | Connects to a separately running Chroma server (HTTP); enables multi-process and multi-client access. Recommended for production self-hosting. |