PlanningConfig
Configure planning mode for agents to create and execute structured plans
Enable agents to create step-by-step plans before executing tasks, with optional approval workflows.
Quick Start
- Simple Enable
Enable planning with defaults:
python from praisonaiagents import Agent agent = Agent( name="Planning Agent", instructions="You plan before acting", planning=True ) - With Configuration
Configure planning behavior:
python from praisonaiagents import Agent from praisonaiagents.config import PlanningConfig agent = Agent( name="Planning Agent", instructions="You plan before acting", planning=PlanningConfig( llm="gpt-4o", reasoning=True, auto_approve=False ) )
Configuration Options
from praisonaiagents.config import PlanningConfig
config = PlanningConfig(
# Planning LLM (if different from main)
llm=None,
# Tools available during planning
tools=None,
# Enable reasoning during planning
reasoning=False,
# Auto-approve plans without confirmation
auto_approve=False,
# Read-only mode (only read operations)
read_only=False
)| Parameter | Type | Default | Description | |
|---|---|---|---|---|
llm | `str \ | None` | None | Model for planning (defaults to agent’s model) |
tools | `List[Any] \ | None` | None | Tools available during planning phase |
reasoning | bool | False | Enable chain-of-thought reasoning | |
auto_approve | bool | False | Skip approval step for plans | |
read_only | bool | False | Restrict to read-only operations |
Common Patterns
Pattern 1: Planning with Tools
from praisonaiagents import Agent
from praisonaiagents.config import PlanningConfig
def search(query: str) -> str:
"""Search for information."""
return f"Results for: {query}"
agent = Agent(
name="Research Planner",
instructions="Plan and execute research",
planning=PlanningConfig(
tools=[search],
reasoning=True
)
)Pattern 2: Auto-Approved Planning
from praisonaiagents import Agent
from praisonaiagents.config import PlanningConfig
agent = Agent(
name="Auto Planner",
instructions="Execute plans automatically",
planning=PlanningConfig(
auto_approve=True,
reasoning=True
)
)Pattern 3: Read-Only Planning
from praisonaiagents import Agent
from praisonaiagents.config import PlanningConfig
agent = Agent(
name="Safe Planner",
instructions="Only read operations allowed",
planning=PlanningConfig(
read_only=True,
auto_approve=False
)
)Best Practices
Enable Reasoning for Complex Tasks
Use reasoning=True for tasks that benefit from chain-of-thought planning.
Review Plans Before Execution
Keep auto_approve=False for critical operations to review plans before execution.
Use Read-Only for Safety
Enable read_only=True when agents should only analyze but not modify data.