from praisonaiagents import Agent, RetrievalConfig, RetrievalPolicy, CitationsMode
config = RetrievalConfig(
# Core settings
enabled=True, # Enable/disable retrieval
policy=RetrievalPolicy.AUTO, # auto, always, never
# Retrieval parameters
top_k=5, # Number of chunks to retrieve
min_score=0.0, # Minimum relevance score (0.0-1.0)
max_context_tokens=4000, # Token budget for context
# Advanced retrieval
rerank=False, # Enable reranking for better relevance
hybrid=False, # Use hybrid retrieval (dense + keyword)
# Citations
citations=True, # Include source citations
citations_mode=CitationsMode.APPEND, # append, inline, hidden
# Vector store
vector_store_provider="chroma", # chroma, mongodb, etc.
collection_name="default", # Collection name
persist_path=".praison/knowledge", # Storage path
)
agent = Agent(
name="Agent",
instructions="You are a helpful assistant.",
knowledge=["documents/"],
retrieval_config=config,
)