What is Chroma DB? How it works, install, run locally, and is it open source

Chroma DB is an open-source vector database for AI apps. Why use it, how it works and what it is built on, running it locally or as a server, and who makes it.

In a packed college auditorium
In a packed college auditorium

Key takeaways

  • Chroma DB is an open-source vector database that stores embeddings, documents and metadata for semantic search and RAG.
  • It is quick to start: pip install chromadb and use it inside Python, or run it as a server for several apps.
  • It indexes vectors with HNSW for fast approximate search and stores data and metadata on disk in local mode.
  • Chroma is open source under the Apache 2.0 licence and developed by the company Chroma, which also runs a hosted service.
  • Delete data with delete_collection, or remove the persistence folder when you want a clean start.

Chroma DB is an open-source vector database built for AI applications. It stores text chunks, their embeddings and metadata, and finds the most similar items to a query, which makes it a popular retrieval layer for RAG chatbots and semantic search. It runs inside a Python process, as a standalone server, or as a hosted service. This page covers why to use it, how it works and what it is built on, whether it is local and open source, who makes it, and how to install, run and delete it.

What is Chroma DB?

Chroma DB is a vector database, sometimes called an embedding database, that lets applications store embeddings and search them by similarity. It is designed to be simple for developers: a few lines of Python give you a working semantic search.

Also asked as: how to run chroma db · how to delete chroma db

Data lives in collections, each holding documents, their embeddings, metadata and IDs. Chroma can compute embeddings with a built-in or configured embedding function, or accept embeddings you compute yourself. Queries return the nearest items with their distances, optionally filtered by metadata, such as subject or date. Chroma integrates with LangChain, LlamaIndex and other frameworks, which is why it appears in many RAG tutorials.

Why use Chroma DB?

Use Chroma when you want a fast, free, easy way to add semantic search or RAG to a project, especially in Python. It needs no separate infrastructure to start, and the same code can later point to a Chroma server or hosted service.

It suits prototypes, student projects, internal tools and small to medium production apps. Reasons to choose something else: you already run PostgreSQL and prefer one database, so pgvector is simpler; you need a managed service at very large scale; or you need strong keyword search alongside vectors, where engines with built-in BM25 help. Whichever store you choose, retrieval quality depends more on chunking, hybrid search and reranking than on the database.

How does Chroma DB work?

When you add documents, Chroma stores each document's text, metadata and embedding, and adds the embedding to an approximate nearest-neighbour index. When you query, it embeds the query with the same function and returns the closest items.

The search index uses HNSW, a graph-based method that finds near neighbours quickly without comparing every vector. Metadata filters narrow results before or during search. Distances are computed with a configurable metric such as cosine or L2; use the one recommended for your embedding model. Because results are approximate, very large collections may need tuning of index parameters, and measuring recall on real queries tells you whether results are good enough.

What is Chroma DB built on?

Chroma's core has been rewritten in Rust in recent versions, with Python and JavaScript clients. In local mode it stores data on disk, using SQLite for metadata and records, and an HNSW index for vector search.

The architecture supports three ways of running: embedded in your process for simplicity, a client-server mode where a Chroma server holds the data and many clients connect, and a distributed cloud service run by the company. For most users, the details matter only for performance tuning and deployment; the API stays the same. Check the documentation for the current architecture, as the project has evolved quickly.

Is Chroma DB local?

It can be. Chroma can run entirely on your machine, either in memory or persisted to a local folder, with no data leaving your computer. It can also run as a server on your own infrastructure, or be used as a hosted cloud service.

Local mode is ideal for development, privacy-sensitive data and offline work: use chromadb.PersistentClient(path="./store") to save data between runs. Note that embedding functions may still call external APIs if you configure a hosted embedding model; for a fully local setup, use a local embedding model, for example through sentence-transformers or Ollama. For apps with several processes or servers, run Chroma as a server so all instances share one database.

Is Chroma DB open source?

Yes. Chroma is open source under the Apache 2.0 licence, with its code on GitHub. You can use it in personal and commercial projects, self-host it and modify it.

The company behind it also offers a hosted cloud product with its own terms and pricing, while the open-source database remains free to self-host. Because it is open, you can inspect how indexing and querying work, which helps when debugging retrieval quality or performance. Check the repository's releases and changelog before upgrading, since fast-moving projects sometimes change storage formats or APIs between versions.

Who owns Chroma DB?

Chroma DB is developed by Chroma, a company founded in 2022 that builds the open-source database and a hosted cloud service. The open-source code is licensed under Apache 2.0, so the community can use and contribute to it.

For users, ownership matters mainly for support and longevity: the open-source licence means your ability to use the database does not depend on buying anything, while the company funds ongoing development. If you use the hosted service, its terms, data location and pricing apply. For critical systems, keep your source documents and a way to rebuild the index, so you are never locked into one vector store.

How do I install Chroma DB?

Install the Python package with pip, then import it. For a JavaScript project, install the JavaScript client and run a Chroma server.

Also asked as: how to install chroma db

pip install chromadb
import chromadb
client = chromadb.PersistentClient(path="./chroma_store")
col = client.get_or_create_collection("docs")
col.upsert(ids=["a1"], documents=["Chroma stores embeddings for semantic search."])
print(col.query(query_texts=["what does chroma store?"], n_results=1)["documents"])

Use a virtual environment, and pin the version in requirements.txt. If installation fails on an older system or unusual CPU, check the troubleshooting section of the documentation for build requirements.

How do I run Chroma DB as a server?

Use the Chroma command-line tool to start a server with a data folder, or run the official Docker image, then connect from your app with an HTTP client.

chroma run --path ./chroma_data      # starts a local server
import chromadb
client = chromadb.HttpClient(host="localhost", port=8000)

Server mode lets several app instances, or apps in different languages, share one database. In Docker, mount a volume for the data directory so it persists across restarts. Do not expose the server to the internet without authentication; put it on a private network or behind an authenticated proxy, and back up the data directory.

How do I delete a Chroma DB collection or database?

Delete a collection with client.delete_collection("name"), delete specific items with collection.delete(ids=[...]) or a metadata filter, and remove the whole local database by deleting its persistence folder while no process is using it.

client.delete_collection("docs")                         # whole collection
col.delete(where={"source": "old_policy.pdf"})            # items by metadata

Before deleting, make sure you can rebuild from source documents. In tests, use a temporary folder or an in-memory client so each test starts clean. If you change the embedding model, deleting and rebuilding the collection is required, since old and new vectors are not comparable.

Sources

  1. Chroma, documentationdocs.trychroma.com
  2. Chroma, repositorygithub.com
  3. Malkov & Yashunin, Efficient and robust approximate nearest neighbor search using HNSW graphs (2016)arxiv.org
  4. Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (2020)arxiv.org
Pranjul Rathour
Pranjul Rathour
GenAI Engineer · India

GenAI engineer and AI product builder with 2+ years shipping production-grade AI systems: RAG pipelines, fine-tuned LLMs, hybrid retrieval and multi-modal apps across vision, speech and OCR, architected end to end from ingestion to deployment. Leads engineering for SCULT INDIA's 14-member team, founded the 500+ member TechVerse Enclave community and has mentored 200+ students. Three hackathon first prizes: Changethon 2025 (IIT Roorkee), Product Genesis at Vividhotsava 2025 (CSJMU) and BYTEBATTLE (MeetKats).

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way. Email pranjulrathour41@gmail.com.

Keep reading

More on RAG & retrieval

All RAG & retrieval guides →
Campus talks · hackathon judging · mentoring

Want this as a live session at your college?

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way.

Pranjul Rathour, GenAI engineer in India