Vector Chroma

Chroma is an open-source vector database designed for simplicity. Developers often choose it for first projects, prototypes, and small AI applications because it needs very little setup. A few lines of Python give you a working search system.

Why Chroma Feels Easy

Many vector tools ask you to create embeddings yourself, define schemas, and configure indexes. Chroma removes most of that work. You hand it text, and it can create the embeddings through a default embedding function.

CHROMA WORKFLOW

  Your text documents
          |
          v
  +------------------------+
  | Chroma                 |
  |  - creates embeddings  |
  |  - stores vectors      |
  |  - stores documents    |
  |  - stores metadata     |
  +------------------------+
          |
          v
  Search by plain-language question

Core Concepts

  • Client: The connection to Chroma. It can run in memory, save to disk, or connect to a server.
  • Collection: A named group of documents, similar to a folder.
  • Document: The original text you want to search.
  • Metadata: A dictionary of facts about a document, such as author or year.
  • ID: A unique string that identifies each document.

A Complete First Example

import chromadb

client = chromadb.Client()

collection = client.create_collection(name="notes")

collection.add(
    ids=["n1", "n2", "n3"],
    documents=[
        "Pack light clothes for a beach holiday",
        "Whisk eggs and sugar until fluffy",
        "Book flights early to save money on travel",
    ],
    metadatas=[
        {"topic": "travel"},
        {"topic": "cooking"},
        {"topic": "travel"},
    ],
)

results = collection.query(
    query_texts=["How do I prepare for a trip?"],
    n_results=2,
)

The query never mentions "beach" or "flights". Chroma still returns the two travel notes because their meaning sits close to the question.

Reading the Results

results = {
  "ids":       [["n1", "n3"]],
  "documents": [["Pack light clothes...", "Book flights early..."]],
  "distances": [[0.52, 0.61]],
  "metadatas": [[{"topic": "travel"}, {"topic": "travel"}]]
}

Lower distance = closer match

The results use nested lists because Chroma accepts several queries in one call. Each inner list belongs to one query.

Filtering by Metadata

collection.query(
    query_texts=["saving money"],
    n_results=2,
    where={"topic": "travel"},
)

The where option limits the search to documents whose metadata matches. Use it to separate categories, languages, or authors.

Storage Modes

ModeHow It WorksBest For
In-memoryData disappears when the program endsExperiments and tests
PersistentData saves to a folder on diskPersonal and small projects
Client and serverA separate Chroma server handles requestsShared team use

Using Your Own Embeddings

You can skip the default embedding function and supply vectors directly. This option helps when you want a specific embedding model.

collection.add(
    ids=["a1"],
    embeddings=[[0.1, 0.9, 0.3]],
    documents=["Original text here"],
)

Remember the golden rule: use the same embedding method for stored documents and for queries.

Strengths and Limits

StrengthsLimits
Very fast to learnFewer advanced tuning controls than larger platforms
Works well with popular AI frameworksLarge production workloads need careful testing
Stores text, vectors, and metadata togetherFewer deployment options than enterprise-focused tools
Free and open sourceYou manage hosting and backups yourself

Good Use Cases

  1. Learning vector search for the first time.
  2. Building a question-answering demo over a few hundred documents.
  3. Testing a retrieval idea before choosing a production database.
  4. Adding private document search to a personal project.

Chroma lowers the barrier to entry. Start here to understand how collections, embeddings, and queries fit together, then evaluate larger platforms once your data and traffic grow.