---
name: "chromadb-persistent-embeddings"
description: "Embed and query documents locally or in client-server mode using ChromaDB."
metadata:
  author: "Chroma"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "init chromadb persistent client"
  - "query chromadb collection"
  - "chromadb where metadata filter"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# ChromaDB Embedded Vector Store & Persistent Collections

Manages local vector collections in ChromaDB: configuring persistent DuckDB/SQLite storage, embedding functions (OpenAI, HuggingFace, ONNX), metadata filtering, and semantic document querying.

## When to Invoke
Invoke this skill whenever you need to:
- init chromadb persistent client
- query chromadb collection
- chromadb where metadata filter

## Execution SOP & Rules
1. Create persistent client: client = chromadb.PersistentClient(path='./chroma_data').
2. Get or create collection: collection = client.get_or_create_collection('knowledge_base').
3. Add records: collection.add(documents=['...'], metadatas=[{'topic': 'ai'}], ids=['id1']).
4. Query documents: results = collection.query(query_texts=['What is RAG?'], n_results=3).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
