Skip to content
Back to skills

Chromadb

ASecurity

> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18 > **Official Docs:** https://docs.trychroma.com/docs/overview/introduction

  • 13 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsbashapidatabasesecuritydocumentation

Works with

  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add ashish7802/awesome-api-skills --skill chromadb --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Chromadb?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Chromadb
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ashish7802-chromadb/badge)](https://www.skillsdirectory.com/skills/ashish7802-chromadb)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# 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

Files in this skill

  • SKILL.md2.7 KB
  • examples/quickstart.ts752 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.