All integrationsVector Store
Pinecone Integration
Wire Pinecone in as a third vector store option alongside pgvector/Qdrant.
FastAPI AI Kit ships pgvector and Qdrant adapters behind a common RAG interface. Pinecone isn't a pre-wired option, but implementing a third adapter against the same interface is a well-defined, contained change if you're already committed to Pinecone.
Setup in 4 steps
- 1Add PINECONE_API_KEY and PINECONE_INDEX to your .env
- 2Implement a PineconeStore class matching the kit's VectorStore interface (upsert, query, delete)
- 3Register it in the RAG factory next to the pgvector/Qdrant adapters
- 4Point VECTOR_STORE=pinecone once the adapter is registered
What's included
- Reuses the same rag.ingest() / rag.query() call sites as pgvector/Qdrant
- Namespace-per-collection maps cleanly onto Pinecone's namespace model
- Serverless Pinecone indexes avoid managing your own vector infra
- Good option if you're already standardized on Pinecone elsewhere in your stack
- Keep pgvector as a local/dev fallback while Pinecone serves production
Code example
# app/rag/stores/pinecone_store.py
from pinecone import Pinecone
class PineconeStore:
def __init__(self, api_key: str, index_name: str):
self.index = Pinecone(api_key=api_key).Index(index_name)
async def upsert(self, collection: str, chunks: list[dict]):
self.index.upsert(
vectors=[(c["id"], c["embedding"], c["metadata"]) for c in chunks],
namespace=collection,
)
async def query(self, collection: str, embedding: list[float], top_k: int):
return self.index.query(
vector=embedding, top_k=top_k, namespace=collection, include_metadata=True,
)Full documentation: /docs/rag-pipeline
Pinecone integration pre-wired and ready.
FastAPI AI Kit ships with Pinecone configured out of the box. No manual setup required.
Ready to ship your AI backend this weekend?
Join developers who skipped weeks of boilerplate and went straight to building.
No subscriptions · One-time payment · Lifetime updates
