Skip to content

Latest commit

Β 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

README.md

PraisonAI Examples

This folder contains examples for PraisonAI. For detailed documentation, visit docs.praison.ai.

Structure

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

Quick Links

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/ πŸ“–

Consolidated Params Examples

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

Serve Examples

Example Description CLI Command
unified_server.py All providers in one server praisonai serve unified
agent_as_api_single.py Single agent HTTP API praisonai serve agents
agents_as_api_router.py Multi-agent router API praisonai serve agents
a2a_server_client.py A2A protocol server praisonai serve a2a
a2u_events_stream.py A2U event stream praisonai serve a2u
mcp_http_server.py MCP HTTP server praisonai serve mcp
tools_as_mcp_server.py Tools as MCP server praisonai serve tools
agent_launch_modes.py Agent.launch() API Python only
endpoints_unified_client.py Unified client praisonai endpoints

Running Examples

# Install PraisonAI
pip install praisonai

# Set API key
export OPENAI_API_KEY=your_key_here

# Run an example
python examples/python/agents/single-agent.py

CLI Commands

See the main README.md for all CLI commands.