feat(rag): add turbopuffer vector store provider#1
Open
RogutKuba wants to merge 2 commits into
Open
Conversation
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>
6c87be1 to
943e377
Compare
mlpuff
reviewed
Jul 10, 2026
| # turbopuffer | ||
| from turbopuffer import Turbopuffer | ||
| from crewai.rag.turbopuffer.config import TurbopufferConfig | ||
| set_rag_config(TurbopufferConfig(client=Turbopuffer(region="gcp-us-central1"))) |
There was a problem hiding this comment.
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
mlpuff
reviewed
Jul 10, 2026
| model: Any = None | ||
|
|
||
| def embed_fn(text: str) -> list[float]: | ||
| """Embed a single text string, loading the model on first use. |
There was a problem hiding this comment.
Is this meant to run an embedding model locally? (ie we're not using tpuf native embeddings?)
Collaborator
Author
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds turbopuffer as a RAG vector store provider, following the same pattern as the existing ChromaDB/Qdrant providers (client, config, factory + registration,
turbopufferextra, docs, tests).Tests:
uv run --extra turbopuffer pytest lib/crewai/tests/rag/turbopuffer/