Skip to main content
A lightweight package dedicated to creating and managing AI agents with advanced capabilities.
This is now the default framework. Running praisonai agents.yaml without any framework flag uses this adapter.
Need a framework that isn’t listed here? See Framework Adapter Plugins to register your own via Python entry points.

Installation

Quick Start

1

Single agent (minimal)

2

Single agent (with prompt)

3

Multi-agent workflow

Advanced: With Tasks and Context

Execution Methods

MethodDefault BehaviorUse Case
.start()Verbose in TTY (shows Rich panels)Interactive/beginner
.run()Silent (no output)Production/scripts

Output Control

Agent Configuration

Core Attributes

  • name: Agent’s identifier
  • role: Agent’s function/expertise
  • goal: Individual objective
  • backstory: Context and personality
  • llm: Language model (default: OpenAI’s GPT-4)
  • instructions: Agent instructions/system prompt
  • tools: List of tools available to the agent

Optional Attributes

  • tools: List of available tools
  • memory: Enable memory capabilities
  • knowledge: Knowledge base configuration
  • planning: Enable planning mode (default: False)
  • reflection: Enable self-reflection
  • allow_delegation: ⚠️ Deprecated — use handoffs= instead (default: False)
  • handoffs: List of agents for handoff

Task Configuration

Core Attributes

  • description: Task details
  • expected_output: Desired outcome
  • agent: Assigned agent

Optional Attributes

  • context: Dependencies on other tasks
  • tools: Task-specific tools
  • async_execution: Run asynchronously (default: False)
  • output_file: Save output to file
  • callback: Post-task function

YAML config: Block

The PraisonAI adapter supports a top-level config: block in YAML that automatically wires InteractiveRuntime (ACP + LSP + agent-centric tools) into the agent execution.
YAML KeyTypeDefaultEffect
acpboolFalseInitializes InteractiveRuntime with ACP enabled. Agent-centric tools are loaded and merged into tools_dict before agents start. Runtime is torn down after team.start() returns.
lspboolFalseSame as above but with LSP enabled. Can be combined with acp: true.
The approval mode is read from the PRAISONAI_APPROVAL_MODE environment variable (default: "prompt").

Example: YAML with ACP/LSP

config.acp and config.lsp only take effect for framework: praisonai. Other adapters (crewai, autogen, ag2, autogen_v4) ignore them.

AgentOps Integration

When agentops is installed, the PraisonAI adapter automatically calls agentops.end_session("Success") after agent execution completes. No configuration required.

Advanced Features

Tool Integration

Custom Callbacks

Error Handling

The framework includes built-in error handling for:
  • API rate limits
  • Token limits
  • Task timeouts
  • Tool execution failures

Best Practices

  1. Agent Design
    • Give clear, specific roles and goals
    • Provide detailed backstories
    • Use appropriate tools for tasks
  2. Task Management
    • Break complex tasks into subtasks
    • Set clear dependencies
    • Use async execution for independent tasks
  3. Resource Optimization
    • Enable caching when appropriate
    • Set reasonable max_iter limits
    • Use rate limiting for API calls
  4. Error Handling
    • Implement task callbacks
    • Set appropriate timeouts
    • Monitor execution logs

Parallel Execution (Upcoming)

Memory Management (Upcoming)

Troubleshooting

Unsupported framework error: If you see Unsupported framework: praisonai. Registered: ['ag2', 'autogen', 'autogen_v4', 'crewai', 'praisonai'], check spelling — frameworks are registered via the adapter registry. Missing installation error: If the framework is not installed, PraisonAI now fails fast at CLI entry with:
The error appears immediately, before YAML parsing — so a typo in --framework is caught before any expensive setup runs.