chromadb

Par mkurman · zorai

Chroma — base de données d'embeddings native IA. Stockage vectoriel in-process et léger avec embedding automatique, filtrage par métadonnées et recherche plein texte. La voie la plus simple du prototype à la production pour le RAG.

npx skills add https://github.com/mkurman/zorai --skill chromadb

Aperçu

Chroma est une base de données d'embedding native IA optimisée pour les workflows RAG. Légère, en processus, avec embedding automatique via sentence-transformers, filtrage des métadonnées et recherche sémantique — aucun serveur séparé requis. Le chemin le plus rapide du prototype à la production.

Installation

uv pip install chromadb

Utilisation basique

import chromadb

client = chromadb.PersistentClient(path="./chroma_data")
collection = client.create_collection(name="documents")

# Add documents with metadata
collection.add(
    documents=["Paris is the capital of France.", "Berlin is the capital of Germany."],
    metadatas=[{"country": "France"}, {"country": "Germany"}],
    ids=["doc1", "doc2"],
)

# Query with filter
results = collection.query(
    query_texts=["What is the capital of France?"],
    n_results=3,
    where={"country": "France"},
)
print(results["documents"][0])

Références

Skills similaires