Skip to main content
Planning enables agents to think before acting - decomposing complex tasks into manageable steps, then executing them systematically.

Quick Start

1

Enable Planning

from praisonaiagents import Agent

agent = Agent(
    name="Planner Agent",
    instructions="You solve complex problems step by step",
    planning=True  # Enable planning
)

agent.start("Build a REST API with authentication")
2

With Configuration

from praisonaiagents import Agent, PlanningConfig

agent = Agent(
    name="Advanced Planner",
    instructions="You are a strategic problem solver",
    planning=PlanningConfig(
        llm="gpt-4o",           # Use powerful model for planning
        reasoning=True,         # Show reasoning process
        auto_approve=False,     # Require approval before execution
    )
)

How Planning Works

The Planning Process

PhaseWhat HappensOutput
AnalyzeUnderstand the task requirementsGoal definition
DecomposeBreak into subtasksList of steps
OrderDetermine dependenciesExecution order
ExecuteRun each stepIntermediate results
SynthesizeCombine resultsFinal output

Configuration Options

from praisonaiagents import PlanningConfig

config = PlanningConfig(
    llm="gpt-4o",           # LLM for planning (can differ from execution)
    tools=[search_tool],    # Tools available during planning
    reasoning=True,         # Enable reasoning display
    auto_approve=False,     # Require user approval
    read_only=False,        # Read-only mode (no modifications)
)
OptionTypeDefaultDescription
llmstrNoneLLM model for planning (uses agent’s LLM if not set)
toolslistNoneTools available during planning phase
reasoningboolFalseShow reasoning process
auto_approveboolFalseAuto-approve plans without confirmation
read_onlyboolFalseOnly allow read operations

Planning Modes

Simple Planning

# Just enable it
agent = Agent(
    instructions="You are a helpful assistant",
    planning=True
)

Configured Planning

# With specific settings
agent = Agent(
    instructions="You are a code architect",
    planning=PlanningConfig(
        llm="gpt-4o",
        reasoning=True,
        auto_approve=True,
    )
)

Read-Only Planning

# Safe mode - no file modifications
agent = Agent(
    instructions="You analyze code",
    planning=PlanningConfig(
        read_only=True,  # Only read operations allowed
    )
)

Multi-Agent Planning

Enable planning for multi-agent workflows:
from praisonaiagents import Agent, Task, PraisonAIAgents

researcher = Agent(name="Researcher", instructions="Research topics")
writer = Agent(name="Writer", instructions="Write content")

agents = PraisonAIAgents(
    agents=[researcher, writer],
    planning=True,  # Enable planning for the workflow
)

agents.start("Write a blog post about AI trends")

When to Use Planning

✅ Use Planning For

  • Complex multi-step tasks
  • Tasks requiring coordination
  • Code refactoring projects
  • Research and analysis
  • Content creation workflows

❌ Skip Planning For

  • Simple Q&A
  • Single-step operations
  • Real-time responses needed
  • Trivial tasks

Best Practices

Planning benefits from stronger reasoning. Use gpt-4o or similar for planning even if using a smaller model for execution.
Set reasoning=True to see the agent’s thought process and catch issues early.
Keep auto_approve=False for critical tasks to review and modify plans.
When analyzing code or data, use read_only=True to prevent accidental modifications.