DEV Community

Alex Spinov
Alex Spinov

Posted on

ChromaDB Has a Free API — The Simplest Vector Database

ChromaDB is the easiest vector database to get started with. Install, embed, search — three lines of code. Perfect for RAG and AI prototypes.

What Is ChromaDB?

ChromaDB is an open-source embedding database designed for AI applications. It handles embedding, storing, and searching vectors with minimal code.

Quick Start

pip install chromadb
Enter fullscreen mode Exit fullscreen mode

Python API (3 lines to search)

import chromadb

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

# Add documents (ChromaDB auto-embeds!)
collection.add(
    documents=["AI is transforming healthcare", "Python is great for data science", "Docker simplifies deployment"],
    ids=["doc1", "doc2", "doc3"]
)

# Search by meaning
results = collection.query(query_texts=["machine learning in medicine"], n_results=2)
print(results["documents"])
# Returns: [["AI is transforming healthcare", ...]]
Enter fullscreen mode Exit fullscreen mode

REST API (Server Mode)

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

# Add documents
curl -X POST http://localhost:8000/api/v1/collections/COLLECTION_ID/add \
  -d '{"documents":["Hello world"],"ids":["id1"]}'

# Query
curl -X POST http://localhost:8000/api/v1/collections/COLLECTION_ID/query \
  -d '{"query_texts":["greeting"],"n_results":5}'
Enter fullscreen mode Exit fullscreen mode

Use Cases

  1. RAG chatbots — ground LLMs with your data
  2. Document search — find relevant docs
  3. Q and A systems — answer from knowledge base
  4. Prototyping — fastest path to vector search
  5. Local AI apps — runs entirely on your machine

ChromaDB vs Alternatives

Feature ChromaDB Qdrant Pinecone
Setup 1 line Docker Cloud
Auto-embed Yes No No
In-memory Yes No No
Persistent Yes Yes Yes
Price Free Free/Cloud Paid

Need web data at scale? Check out my scraping tools on Apify or email spinov001@gmail.com for custom solutions.

Top comments (0)