from praisonaiagents import Agent, KnowledgeConfig
agent = Agent(
name="Agent",
instructions="You are a helpful assistant.",
knowledge=KnowledgeConfig(
# Knowledge sources
sources=["documents/"],
# Embedder configuration
embedder="openai",
embedder_config={"model": "text-embedding-3-small"},
# Chunking strategy
chunking_strategy="semantic",
chunk_size=1000,
chunk_overlap=200,
# Retrieval parameters
retrieval_k=5, # Number of chunks to retrieve
retrieval_threshold=0.0, # Minimum relevance score (0.0-1.0)
# Reranking
rerank=False, # Enable reranking for better relevance
rerank_model=None, # Custom rerank model
# Auto-retrieval
auto_retrieve=True, # Automatically inject context
# Vector store
vector_store={"provider": "chroma", "collection_name": "default"},
)
)