Knowledge bases provide agents with specialized information beyond their training data. They help agents answer specific questions, follow guidelines, or work within defined domains.
Here’s an example of how to use a knowledge base with an agent:
Copy
from praisonaiagents import Agentagent = Agent( name="Knowledge Agent", instructions="You answer questions based on the provided knowledge.", knowledge=["small.pdf"])agent.start("What is KAG in one line?")
For beginners, you can start with a simple text-based knowledge base:
Copy
# Company FAQ Knowledge Base## Return PolicyOur return policy allows customers to return products within 30 days of purchase for a full refund.## Shipping InformationStandard shipping takes 3-5 business days. Express shipping takes 1-2 business days.## Product WarrantyAll products come with a 1-year limited warranty covering manufacturing defects.
Save this as a text file and add it to your knowledge base: