Skip to main content
Guava provides four ready-made VectorStore implementations that can be passed directly to DocumentQA as the store argument. Each wraps a popular vector database and handles embedding, indexing, and similarity search.
Python only: Vector store backends are currently available in Python only. TypeScript equivalents are not yet available.

Installation

Install only the backend(s) you need:
  • pip install 'guava-sdk[chromadb]'
  • pip install 'guava-sdk[lancedb]'
  • pip install 'guava-sdk[pgvector]'
  • pip install 'guava-sdk[pinecone]'
Embedding and generation provider extras:
  • pip install 'guava-sdk[genai]' — Google Gemini (backs GenAIEmbedding / GenAIGeneration)
  • pip install 'guava-sdk[openai]' — OpenAI (backs OpenAIEmbedding / OpenAIGeneration)
Importing a backend class without the corresponding extra installed raises ImportError with an install hint.

ChromaVectorStore

from guava.helpers.chromadb import ChromaVectorStore

LanceDBStore

from guava.helpers.lancedb import LanceDBStore
LanceDB silently drops tables that predate the current schema version. This triggers a full re-index the next time DocumentQA ingests documents.

PgVectorStore

from guava.helpers.pgvector import PgVectorStore PgVectorStore creates the vector extension, chunks table, and HNSW cosine index automatically on first connect. If the connecting user lacks CREATE EXTENSION privileges, initialization will fail.
Managed Postgres: Managed services (Cloud SQL, AlloyDB, RDS) are untested but expected to work since the implementation uses standard psycopg.

PineconeVectorStore

from guava.helpers.pinecone import PineconeVectorStore
Cold start: Pinecone index creation can take 30–60 seconds on first use. Subsequent instantiations with the same index_name skip creation and connect immediately.

PineconeInferenceEmbedding

from guava.helpers.pinecone import PineconeInferenceEmbedding

GenAIEmbedding / GenAIGeneration

from guava.helpers.genai import GenAIEmbedding, GenAIGeneration Install: pip install 'guava-sdk[genai]' GenAIEmbedding — EmbeddingModel backed by Google Gemini. Works with either a Vertex AI client (genai.Client(vertexai=True, project=..., location=...)) or an AI Studio client (genai.Client(api_key=...)). Uses different task types under the hood: RETRIEVAL_DOCUMENT for embed_documents and QUESTION_ANSWERING for embed_query, which improves retrieval quality versus a single generic embedding. GenAIGeneration — GenerationModel backed by Google Gemini.
thinking_budget compatibility: The default thinking_budget=0 works with gemini-2.5-flash. If you switch to a non-thinking model like gemini-1.5-flash, pass thinking_budget=None — that model raises an error when it receives a thinking_config.

OpenAIEmbedding / OpenAIGeneration

from guava.helpers.openai import OpenAIEmbedding, OpenAIGeneration Install: pip install 'guava-sdk[openai]' The caller supplies a configured openai.OpenAI instance. The same wrappers work against Azure OpenAI or any OpenAI-compatible base URL — the client object decides where requests go. OpenAIEmbedding — EmbeddingModel backed by the OpenAI Embeddings API. OpenAIGeneration — GenerationModel backed by OpenAI chat.completions. The system_instruction argument to generate() is mapped to a {"role": "system", ...} message prepended to the user prompt.

GenerationModel

Any implementation of the guava.helpers.rag.GenerationModel interface works with DocumentQA in local mode. The examples on this page use GenAIGeneration, but OpenAIGeneration (above) or any custom GenerationModel subclass works equally well.

Examples

vector_store_examples.py