Skip to main content

Pinecone

Managed vector database for production RAG.

Setup

pip install pinecone-client
export PINECONE_API_KEY=your_api_key

Quick Start (Agent with Knowledge)

Use Pinecone as a knowledge store with an agent:
from praisonaiagents import Agent
import os

# Agent with knowledge backed by Pinecone
agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant with access to documents.",
    knowledge=["./docs/guide.pdf"]
)

agent.chat("What does the guide say?")

Advanced Usage (Direct Store)

from praisonai.persistence.factory import create_knowledge_store

store = create_knowledge_store(
    "pinecone",
    api_key="your_api_key",
    environment="us-east-1"
)

# Create index
store.create_collection("documents", dimension=384)

# Insert and search
store.insert("documents", [doc])
results = store.search("documents", query_embedding, limit=5)

Configuration

OptionDescription
api_keyPinecone API key
environmentPinecone environment
index_nameIndex name