Chroma

Trace Chroma vector database operations with Respan.
  1. Sign up — Create an account at platform.respan.ai
  2. Create an API key — Generate one on the API keys page
  3. Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page

Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.

1{
2 "mcpServers": {
3 "respan-docs": {
4 "url": "https://docs.respan.ai/mcp"
5 }
6 }
7}

What is Chroma?

Chroma is an open-source embedding database designed for AI applications. It provides a simple API for storing, searching, and retrieving embeddings, making it easy to add long-term memory and semantic search to LLM applications.

Setup

1

Install packages

$pip install respan-ai opentelemetry-instrumentation-chromadb chromadb
2

Set environment variables

$export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
$export OTEL_EXPORTER_OTLP_ENDPOINT="https://api.respan.ai/api"
$export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer $RESPAN_API_KEY"
3

Run a traced example

1from respan import Respan
2
3# Auto-discover and activate all installed instrumentors
4respan = Respan(is_auto_instrument=True)
5
6import chromadb
7
8# Create a client and collection
9client = chromadb.Client()
10collection = client.create_collection("documents")
11
12# Add documents with embeddings
13collection.add(
14 documents=[
15 "Respan provides AI observability and tracing.",
16 "Vector databases enable semantic search.",
17 "Embeddings capture meaning in numeric form.",
18 ],
19 ids=["doc1", "doc2", "doc3"],
20)
21
22# Query for similar documents
23results = collection.query(
24 query_texts=["How does AI observability work?"],
25 n_results=2,
26)
27print(results["documents"])
28
29respan.flush()
4

View your trace

Open the Traces page to see your Chroma operation spans.

Always call respan.flush() before your process exits. Without it, pending spans may be lost.

What gets traced

  • Collection creation and management
  • Document add, upsert, and delete operations
  • Similarity search queries and result counts
  • Embedding generation
  • Query parameters and filters
  • Operation latency

Learn more