Core Concepts
AI Agents with Knowledge
Learn how to create AI agents with custom knowledge bases
Feature | Knowledge | Memory |
---|---|---|
When Used | Pre-loaded before agent execution | Created and updated during runtime |
Purpose | Provide static reference information | Store dynamic context and interactions |
Storage | Read-only knowledge base | Read-write memory store |
Persistence | Permanent until explicitly changed | Can be temporary (STM) or persistent (LTM) |
Updates | Manual updates through knowledge files | Automatic updates during agent execution |
Quick Start
1
Install Package
Install PraisonAI Agents with knowledge support:
2
Set API Key
Set your OpenAI API key:
3
Create Script
Create a new file app.py
:
Basic Usage
The simplest way to create a knowledge-based agent is without any configuration:
Advanced Configuration
For more control over the knowledge base, you can specify a configuration:
Multi-Agent Knowledge System
For more complex scenarios, you can create a knowledge-based system with multiple agents:
Understanding Knowledge Configuration
Features
Custom Knowledge
Import your own documents and data as knowledge sources
Vector Storage
Efficient storage and retrieval of knowledge embeddings
Multiple Sources
Combine multiple documents and file types
Persistent Storage
Save and reuse knowledge bases across sessions
Best Practices
-
Document Preparation
- Clean and well-formatted documents work best
- Break large documents into smaller chunks
- Use consistent formatting
-
Knowledge Organization
- Group related documents together
- Use meaningful file names
- Keep knowledge bases focused and relevant
-
Performance Optimization
- Monitor vector store size
- Clean up unused collections
- Use appropriate chunk sizes
-
Multi-Agent Coordination
- Define clear roles and responsibilities
- Set appropriate logging levels for debugging
- Use unique collection names for different agent groups
Next Steps
- Learn about Memory Management for long-term recall
- Explore Tool Integration for enhanced capabilities
- Check out Examples for implementation ideas
Was this page helpful?