Quick Start
- Code
- No Code
1
Install Package
First, install the PraisonAI Agents package:
2
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
3
Create a file
Create a new file
app.py with the basic setup:4
Start AutoAgents
Run your AutoAgents:
Requirements
- Python 3.10 or higher
- OpenAI API key. Generate OpenAI API key here. Use Other models using this guide.
Understanding AutoAgents
What are AutoAgents?
AutoAgents automatically:
- Analyzes task complexity to determine optimal agent count (1-4 agents)
- Creates appropriate AI agents based on your instructions
- Assigns relevant tools to each agent
- Recommends workflow patterns (sequential, parallel, routing, orchestrator-workers, evaluator-optimizer)
- Manages execution flow between agents
- Handles agent coordination and task delegation
Features
Dynamic Agent Count
Analyzes task complexity and creates 1-4 agents as needed. Simple tasks get fewer agents.
Smart Tool Assignment
Automatically assigns relevant tools to each agent from 17+ available tools.
Workflow Patterns
Supports 6 patterns: sequential, parallel, routing, loop, orchestrator-workers, evaluator-optimizer.
Pattern Recommendation
Automatically recommends the best workflow pattern based on task characteristics.
Workflow Patterns
Sequential (Default)
Sequential (Default)
Agents work one after another, passing output to the next.
Parallel
Parallel
Multiple agents work concurrently on independent subtasks.
Routing
Routing
A classifier agent routes requests to specialized agents based on input type.
Orchestrator-Workers
Orchestrator-Workers
A central orchestrator dynamically delegates tasks to specialized workers.
Evaluator-Optimizer
Evaluator-Optimizer
One agent generates content, another evaluates it in a loop until quality criteria are met.
Advanced Usage
Configuration Options
Process Types
Sequential Process
Sequential Process
Hierarchical Process
Hierarchical Process
Best Practices
Clear Instructions
Clear Instructions
Tool Selection
Tool Selection
Resource Management
Resource Management
Troubleshooting
Tool Assignment Issues
If tools aren’t being assigned correctly:
- Check tool compatibility
- Verify tool names
- Enable verbose mode for debugging
Performance Issues
If execution is slow:
- Reduce max_agents
- Adjust max_rpm
- Consider process type
AutoGenerator API (Python)
For programmatic control over agent generation:AutoGenerator Parameters
The task/topic for agent generation
Output YAML file name
Framework: “praisonai”, “crewai”, or “autogen”
Workflow pattern: “sequential”, “parallel”, “routing”, “orchestrator-workers”, “evaluator-optimizer”
If True, generate a single agent instead of a team
WorkflowAutoGenerator Parameters
The task/topic for workflow generation
Output YAML file name
Framework: “praisonai”, “crewai”, or “autogen”
If True, generate a single agent workflow
Methods
Generate the YAML file.
merge=True merges with existing file.Keyword-based pattern recommendation (fast, no API call)
LLM-based pattern recommendation with reasoning and confidence score
AutoAgents API (Runtime)
Main Parameters
High-level task description for the agents
List of tools available to the agents
Maximum number of agents to create
Process type: “sequential” or “hierarchical”
Optional Parameters
Enable detailed logging
Enable agent memory
Allow agents to delegate tasks
Methods
Start the agents synchronously
Start the agents asynchronously
Next Steps
Examples
Explore more examples in our examples directory
Custom Tools
Learn how to create custom tools for your agents
For optimal results, provide clear instructions and appropriate tools for your use case.

