This folder contains examples for PraisonAI. For detailed documentation, visit docs.praison.ai.
examples/
├── python/ # Python examples
│ ├── agents/ # Agent examples (single, multi, router, etc.)
│ ├── workflows/ # Workflow patterns (routing, parallel, loop)
│ ├── tools/ # Custom tools examples
│ ├── mcp/ # MCP protocol examples
│ ├── memory/ # Memory and sessions
│ ├── code/ # Code editing and external CLI tools
│ └── ...
├── serve/ # Server and endpoints examples
├── yaml/ # YAML workflow examples
└── cookbooks/ # Complete use-case examples
| Category | Examples | Docs |
|---|---|---|
| Consolidated Params | consolidated_params/ | 📖 |
| Agents | python/agents/ | 📖 |
| Workflows | python/workflows/ | 📖 |
| Model Router | python/agents/router-agent-cost-optimization.py | 📖 |
| MCP | python/mcp/ | 📖 |
| Memory | python/memory/ | 📖 |
| Tools | python/tools/ | 📖 |
| Code | python/code/ | 📖 |
| YAML | yaml/ | 📖 |
| Doctor | doctor/ | 📖 |
| Serve | serve/ | 📖 |
| Endpoints | serve/ | 📖 |
Agent-centric API with unified parameter resolution. Precedence: Instance > Config > Array > Dict > String > Bool > Default
| Example | Description |
|---|---|
| basic_agent.py | Minimal agent with memory |
| basic_agents.py | Multi-agent with memory+planning |
| basic_workflow.py | Workflow with consolidated params |
| basic_memory.py | Memory presets (file, redis, postgres) |
| basic_guardrails.py | Guardrails with callable or config |
| basic_workflow_agentlike.py | Workflow with agent-like params |
| basic_step_override.py | Step-level override of workflow defaults |
| advanced_workflow_full_features.py | All consolidated params |
# Install PraisonAI
pip install praisonai
# Set API key
export OPENAI_API_KEY=your_key_here
# Run an example
python examples/python/agents/single-agent.pySee the main README.md for all CLI commands.
