一键导入
chroma
Open-source embedding database for RAG — store embeddings, vector search, metadata filtering. Simple API, scales from notebook to production.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Open-source embedding database for RAG — store embeddings, vector search, metadata filtering. Simple API, scales from notebook to production.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Compress conversation context — summarize the current session, extract key decisions and facts, then compact history to free up context window.
Generate insights about your Claude Code usage — what topics you work on most, common patterns, productivity trends.
Route Claude Code work by complexity, risk, and tool needs. Use when deciding how much reasoning depth a task needs, whether to read project memory first, whether the task should be decomposed, and whether the work is lightweight, standard, or investigation-heavy.
Query Polymarket prediction markets for probability data and research insights on real-world events.
Search and retrieve academic papers from arXiv using their free REST API. No API key needed.
Query Base (Ethereum L2) blockchain data — wallet balances, token info, transactions, gas analysis, contract inspection. No API key required.
| name | chroma |
| description | Open-source embedding database for RAG — store embeddings, vector search, metadata filtering. Simple API, scales from notebook to production. |
| version | 1.0.0 |
| author | hermes-CCC (ported from Hermes Agent by NousResearch) |
| license | MIT |
| metadata | {"hermes":{"tags":["RAG","Chroma","Vector-Database","Embeddings","Semantic-Search","Open-Source"],"related_skills":[]}} |
pip install chromadb sentence-transformers
import chromadb
client = chromadb.PersistentClient(path="./chroma_db")
PersistentClient stores data on disk.collection = client.create_collection(name="docs")
docs, papers, tickets, or kb_chunks.collection.add(
documents=["Chroma is useful for local RAG.", "Vector search retrieves semantically similar text."],
metadatas=[{"source": "note1"}, {"source": "note2"}],
ids=["doc-1", "doc-2"],
)
ids stable if you plan to update or delete records later.results = collection.query(
query_texts=["How do I store embeddings for RAG?"],
n_results=5,
)
print(results["documents"])
print(results["metadatas"])
query_texts=['...'] is the most common path when Chroma is managing embeddings for you.n_results=5 or 10 for most retrieval experiments.get_or_create_collection:collection = client.get_or_create_collection(name="docs")
DefaultEmbeddingFunctionSentenceTransformerEmbeddingFunctionOpenAIEmbeddingFunctionfrom chromadb.utils.embedding_functions import DefaultEmbeddingFunction
embedding_fn = DefaultEmbeddingFunction()
collection = client.get_or_create_collection(
name="default-embeddings",
embedding_function=embedding_fn,
)
from chromadb.utils.embedding_functions import SentenceTransformerEmbeddingFunction
embedding_fn = SentenceTransformerEmbeddingFunction(
model_name="sentence-transformers/all-MiniLM-L6-v2",
)
collection = client.get_or_create_collection(
name="st-docs",
embedding_function=embedding_fn,
)
from chromadb.utils.embedding_functions import OpenAIEmbeddingFunction
embedding_fn = OpenAIEmbeddingFunction(
api_key="YOUR_API_KEY",
model_name="text-embedding-3-small",
)
collection = client.get_or_create_collection(
name="openai-docs",
embedding_function=embedding_fn,
)
collection.add(
documents=[
"Retrieval augmented generation combines retrieval with generation.",
"Chroma collections can store metadata for filtering.",
],
metadatas=[
{"source": "paper1", "section": "intro", "year": 2024},
{"source": "paper1", "section": "methods", "year": 2024},
],
ids=["paper1-intro", "paper1-methods"],
)
where:results = collection.query(
query_texts=["What does the paper say about filtering?"],
n_results=5,
where={"source": "paper1"},
)
Example requested pattern:
where={'source': 'paper1'}
Metadata filters are critical for multi-tenant or source-restricted RAG.
where_document.results = collection.query(
query_texts=["database"],
n_results=5,
where_document={"$contains": "keyword"},
)
where_document={'...': 'keyword'}.collection.update(
ids=["doc-1"],
documents=["Chroma stores embeddings persistently for local RAG systems."],
metadatas=[{"source": "note1", "updated": True}],
)
collection.delete(ids=["doc-2"])
collection.delete(where={"source": "note1"})
items = collection.get(ids=["doc-1"])
print(items)
import chromadb
client = chromadb.HttpClient(host="localhost", port=8000)
collection = client.get_or_create_collection(name="docs")
docker run -p 8000:8000 chromadb/chroma
chromadb.HttpClient(host='localhost', port=8000) from Python.Empty search results:
confirm documents were added
confirm the embedding function is configured as expected
lower filtering constraints
Embedding mismatch:
avoid changing embedding models inside the same collection without re-indexing
document the embedding function used for each collection
Duplicate records:
choose deterministic IDs from source path plus chunk index
upsert or update intentionally instead of re-adding blind
Server connectivity issues:
verify the Docker container is running
confirm localhost:8000 is reachable
switch from PersistentClient to HttpClient only when appropriate
PersistentClient.pip install chromadb sentence-transformerschromadb.PersistentClient(path="./chroma_db")collection.add(documents=[...], metadatas=[...], ids=[...])collection.query(query_texts=["..."], n_results=5)where={"source": "paper1"}where_document={"$contains": "keyword"}chromadb.HttpClient(host="localhost", port=8000)docker run -p 8000:8000 chromadb/chroma