Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Chromadb?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ashish7802-chromadb)
# ChromaDB API & SDK Skill
> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18
> **Official Docs:** https://docs.trychroma.com/docs/overview/introduction
## Overview
Chroma is an open-source vector database designed for storing embeddings, documents, and structured metadata for Retrieval-Augmented Generation (RAG) workflows. It runs in local persistent mode, client-server HTTP mode (`ChromaClient`), or managed Chroma Cloud (`CloudClient`).
## Installation
```bash
npm install chromadb
pip install chromadb
```
## Authentication
In Chroma Cloud or authenticated server deployments, pass API tokens via environment variables (`CHROMA_API_KEY`, `CHROMA_TENANT`, `CHROMA_DATABASE`) or Bearer headers—never expose unauthenticated Chroma HTTP ports to the public internet.
## Core Concepts
- **Collections**: Logical containers created idempotently with `client.getOrCreateCollection({ name, metadata })`.
- **Upsert vs Add**: Prefer `collection.upsert()` over `collection.add()` in ingestion pipelines so retries are idempotent without duplicate-ID failures.
- **Metadata & Document Filtering**: Combine vector similarity (`queryEmbeddings` / `queryTexts`) with structured `where` and `whereDocument` filters for tenant isolation.
## Error Handling & Rate Limits
- Always guarantee identical embedding model & vector dimensionality between ingestion and querying (mismatched dimensions throw `InvalidDimensionException`).
- Chunk large ingestion batches (e.g., 100–500 documents per `upsert` call) and retry transient `5xx`/network errors with exponential backoff.
## Security Best Practices
- Enforce multi-tenant isolation using dedicated tenants/databases or mandatory server-enforced `where: { tenantId }` metadata filters on every query.
- Never allow unvalidated user-supplied JSON directly into `where` filter operators.
## AI Pitfalls
- Calling `collection.add()` repeatedly with existing IDs instead of `collection.upsert()`.
- Mixing embedding models (e.g., 1536-dim and 3072-dim) in the same collection.
- Running an unauthenticated Chroma server bound to `0.0.0.0:8000` in production.
## Production Checklist
- [ ] `getOrCreateCollection` and `upsert` used for idempotent ingestion
- [ ] Embedding model version and dimensions pinned in collection metadata
- [ ] Tenant isolation enforced via database scoping or mandatory `where` filters
- [ ] Server authentication enabled for non-local deployments
## References
- [Chroma Documentation](https://docs.trychroma.com/docs/overview/introduction)
- [Chroma JS/TS Client](https://docs.trychroma.com/reference/js-client)
## Related skills
- [`qdrant`](../qdrant/SKILL.md) — alternative to
- [`pinecone`](../pinecone/SKILL.md) — alternative to
- [`langchain`](../langchain/SKILL.md) — integrates with