Create and configure knowledge bases for your agents
Attach file and URL sources so agents answer from your organisation’s documents.
from praisonaiagents import Agent, Knowledgeknowledge = Knowledge(sources=["docs/", "faq.pdf"])agent = Agent( name="Support Agent", instructions="Answer using the knowledge base only.", knowledge=knowledge,)agent.start("What is our refund policy?")
The user asks a question; the agent retrieves relevant chunks and returns a grounded answer.Add domain-specific knowledge to your agents using knowledge bases.
from praisonaiagents import Agent, Knowledge# Create knowledge base from filesknowledge = Knowledge( sources=["docs/", "data.pdf", "faq.txt"])# Create agent with knowledgeagent = Agent( name="Support Agent", instructions="Answer questions using the knowledge base.", knowledge=knowledge)result = agent.start("What is your refund policy?")
2
With Configuration
from praisonaiagents import Agent, Knowledgeknowledge = Knowledge( sources=["docs/"], chunk_size=500, chunk_overlap=50,)agent = Agent( name="Support Agent", instructions="Answer using the knowledge base.", knowledge=knowledge,)agent.start("Summarise the onboarding guide.")