Skip to content

feat(rag): add turbopuffer vector store provider#1

Open
RogutKuba wants to merge 2 commits into
mainfrom
RogutKuba/turbopuffer-vector-store
Open

feat(rag): add turbopuffer vector store provider#1
RogutKuba wants to merge 2 commits into
mainfrom
RogutKuba/turbopuffer-vector-store

Conversation

@RogutKuba

@RogutKuba RogutKuba commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Adds turbopuffer as a RAG vector store provider, following the same pattern as the existing ChromaDB/Qdrant providers (client, config, factory + registration, turbopuffer extra, docs, tests).

Tests: uv run --extra turbopuffer pytest lib/crewai/tests/rag/turbopuffer/

Add turbopuffer as a RAG vector store provider alongside ChromaDB and Qdrant:

- client/config/factory/types/utils implementing the BaseClient protocol
  (sync + async), with lazy namespace creation and $dist score normalization
- register the provider in the RAG factory, discriminated config union, and
  optional-import placeholders
- add the 'turbopuffer' optional dependency (extra); the default embedder uses
  fastembed all-MiniLM-L6-v2, loaded lazily on first embed so config construction
  never triggers a model download, and passing your own embedding_function skips
  fastembed entirely
- expose turbopuffer through the crewai-tools RagTool provider list
- document turbopuffer in the knowledge vector-store section
- tests for the client, utils, RagTool routing, and default-embedder laziness

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@RogutKuba RogutKuba force-pushed the RogutKuba/turbopuffer-vector-store branch from 6c87be1 to 943e377 Compare July 10, 2026 15:01
# turbopuffer
from turbopuffer import Turbopuffer
from crewai.rag.turbopuffer.config import TurbopufferConfig
set_rag_config(TurbopufferConfig(client=Turbopuffer(region="gcp-us-central1")))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to hard code it to gcp-us-central1 in the docs? or could add a comment pointing to all the available regions

model: Any = None

def embed_fn(text: str) -> list[float]:
"""Embed a single text string, loading the model on first use.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to run an embedding model locally? (ie we're not using tpuf native embeddings?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I will make a change to this integration once we GA native embeddings

Address review: point to the regions list instead of leaving gcp-us-central1 unexplained.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@RogutKuba RogutKuba requested a review from mlpuff July 13, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants