DEV Community

Alex Spinov
Alex Spinov

Posted on

ChromaDB Has a Free API You Should Know About

ChromaDB is an open-source embedding database that makes it easy to build AI applications with memory. Store, search, and retrieve embeddings with just a few lines of Python.

Why ChromaDB is the Easiest Way to Add AI Memory

A developer building a chatbot needed semantic search over 50,000 documents. Setting up Elasticsearch with embeddings took a week. ChromaDB did it in 10 lines of Python.

Key Features:

  • Simple API — 4 functions: add, query, update, delete
  • Automatic Embeddings — Built-in embedding functions
  • Metadata Filtering — Filter results by any metadata field
  • Persistent Storage — SQLite-backed for easy deployment
  • Multi-Modal — Text, images, and custom embeddings

Quick Start

pip install chromadb
Enter fullscreen mode Exit fullscreen mode
import chromadb

client = chromadb.Client()
collection = client.create_collection("docs")

collection.add(
    documents=["Python is great", "JavaScript is versatile", "Rust is fast"],
    ids=["1", "2", "3"]
)

results = collection.query(query_texts=["fast programming language"], n_results=2)
print(results["documents"]) # [["Rust is fast", "Python is great"]]
Enter fullscreen mode Exit fullscreen mode

With Metadata

collection.add(
    documents=["Deploy with Docker"],
    metadatas=[{"category": "devops", "difficulty": "beginner"}],
    ids=["4"]
)

results = collection.query(
    query_texts=["deployment"],
    where={"category": "devops"}
)
Enter fullscreen mode Exit fullscreen mode

Why Choose ChromaDB

  1. Simplest API — 4 functions to learn
  2. Auto embeddings — no embedding pipeline needed
  3. Zero infrastructure — runs in-process or as server

Check out ChromaDB docs to get started.


Building AI apps? Check out my Apify actors or email spinov001@gmail.com for data extraction.

Top comments (0)