Adapters
All adapters implement the VectorStoreAdapter protocol:
adapter.add(ids, texts, embeddings) # index documents
adapter.query(embedding, k) # retrieve top-k texts
adapter.delete(ids) # remove documents
adapter.count() # collection size
ChromaDBAdapter
Wraps a ChromaDB collection. Accepts an existing client for testing or a path for persistent storage.
# Ephemeral (default — in-memory)
adapter = ChromaDBAdapter("my-collection")
# Persistent
adapter = ChromaDBAdapter("my-collection", path="./chroma_db")
# Inject client (e.g. for tests)
import chromadb
adapter = ChromaDBAdapter("my-collection", client=chromadb.EphemeralClient())
Methods
add
query
Returns the texts of the k nearest neighbors. If k exceeds the collection size, returns all available documents.
delete
count
Stubs
PineconeAdapter and QdrantAdapter are available but raise NotImplementedError — full implementations are planned for a future release.