Skip to main content

Vector Store Module

The Vector Store module provides concrete implementations of vector storage backends for semantic search and document retrieval.

Import

Quick Example

ChromaVectorStore semantics changed in v4.6.162:
  • Every namespace (default and ad-hoc) uses {"hnsw:space": "cosine"}; a legacy L2 collection logs a one-time warning instead of auto-migrating.
  • query() returns each record’s stored embedding, not the query vector.
  • delete_all=True deletes and recreates the caller’s namespace, not default.
See the Vector Store feature page for the long-form explanation.

Features

  • Multiple backend support (ChromaDB, Pinecone)
  • Namespace-based document organization
  • Persistent local storage with ChromaDB
  • Cloud vector database integration with Pinecone
  • Lazy loading of optional dependencies
  • Per-instance telemetry disabled via Settings(anonymized_telemetry=False)
ChromaDB telemetry: PraisonAI’s ChromaDB client disables anonymous telemetry via per-instance Settings(anonymized_telemetry=False). It no longer sets the ANONYMIZED_TELEMETRY=False environment variable globally (changed in PR #2070). If your application uses additional ChromaDB clients that should also opt out, set os.environ['ANONYMIZED_TELEMETRY'] = 'False' yourself before constructing them.

Classes

ChromaVectorStore

ChromaDB vector store adapter with local persistence.
Parameters:
Requires chromadb package: pip install chromadb

PineconeVectorStore

Pinecone cloud vector store adapter.
Parameters:
Requires pinecone package: pip install pinecone

Methods

add(texts, embeddings, metadatas=None, ids=None, namespace=None)

Add vectors to the store. Parameters:
  • texts (List[str]): Document texts
  • embeddings (List[List[float]]): Vector embeddings
  • metadatas (List[dict], optional): Metadata for each document
  • ids (List[str], optional): Custom IDs (auto-generated if not provided)
  • namespace (str, optional): Override default namespace
Returns: List[str] - IDs of added documents

query(embedding, top_k=10, namespace=None, filter=None)

Query vectors by similarity. Parameters:
  • embedding (List[float]): Query vector
  • top_k (int): Number of results to return
  • namespace (str, optional): Override default namespace
  • filter (dict, optional): Metadata filter
Returns: List[VectorRecord] - Matching records with scores. For ChromaVectorStore (v4.6.162+), VectorRecord.embedding holds each record’s stored embedding, not the query vector.

delete(ids=None, namespace=None, filter=None, delete_all=False)

Delete vectors from the store. Parameters:
  • ids (List[str], optional): Specific IDs to delete
  • namespace (str, optional): Override default namespace
  • filter (dict, optional): Delete by metadata filter
  • delete_all (bool): Delete all vectors in the namespace. For ChromaVectorStore (v4.6.162+) this is scoped to the caller’s namespace — pass an explicit namespace= to avoid touching default.
Returns: int - Number of deleted vectors

count(namespace=None)

Get count of vectors in the store. Returns: int - Vector count

get(ids, namespace=None)

Get vectors by ID. Parameters:
  • ids (List[str]): IDs to retrieve
Returns: List[VectorRecord] - Retrieved records

Example: Full Workflow

Environment Variables

CLI Usage