Multi-Agent Planning

Add planning capabilities to multi-agent workflows for better task coordination

Multi-Agent Planning generates a high-level plan before distributing tasks across agents, improving coordination on complex workflows.

python
from praisonaiagents import Agent, Task, PraisonAIAgents, MultiAgentPlanningConfig

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

tasks = [
    Task(description="Research the impact of AI on healthcare", agent=researcher),
    Task(description="Write a report on the research findings", agent=writer),
]

workflow = PraisonAIAgents(
    agents=[researcher, writer],
    tasks=tasks,
    planning=MultiAgentPlanningConfig(llm="gpt-4o", auto_approve=True),
)
workflow.start()

The user defines tasks; a planning LLM drafts a plan before agents execute.

Diagram

Multi-Agent Planning

Yes

No

🎯 Goal

🧠 Planning\nLLM

📋 Task Plan

✅ Auto\nApprove?

🤖 Execute\nAgents

👤 Human\nReview

✅ Result

Quick Start

  1. Simple Usage
    python
    from praisonaiagents import Agent, Task, PraisonAIAgents, MultiAgentPlanningConfig
    
    agent = Agent(name="Analyst", instructions="Analyze data and provide insights.")
    task = Task(description="Analyze customer churn patterns", agent=agent)
    
    workflow = PraisonAIAgents(
        agents=[agent],
        tasks=[task],
        planning=MultiAgentPlanningConfig(auto_approve=True),
    )
    workflow.start()
  2. With Reasoning
    python
    from praisonaiagents import Agent, Task, PraisonAIAgents, MultiAgentPlanningConfig
    
    researcher = Agent(name="Researcher", instructions="Research deeply.")
    analyst = Agent(name="Analyst", instructions="Analyze and summarize findings.")
    
    tasks = [
        Task(description="Research quantum computing use cases", agent=researcher),
        Task(description="Summarize key findings for a business audience", agent=analyst),
    ]
    
    workflow = PraisonAIAgents(
        agents=[researcher, analyst],
        tasks=tasks,
        planning=MultiAgentPlanningConfig(
            llm="gpt-4o",
            reasoning=True,
            auto_approve=True,
        ),
    )
    workflow.start()

Single-Agent vs Multi-Agent Planning

Diagram

Single agent

Multiple agents

Enable

Enable

Single agent or multi-agent workflow?

PlanningConfig\nagent.start…

MultiAgentPlanningConfig\nPraisonAIAgents…

Agent(planning=PlanningConfig(…))

PraisonAIAgents(planning=MultiAgentPlanningConfig(…))

PlanningConfig plans within a single agent’s execution. MultiAgentPlanningConfig plans across multiple agents and tasks.


How It Works

Diagram
AgentsPlanning LLMOrchestratorUserAgentsPlanning LLMOrchestratorUseralt[auto_approve = False]Start with goalGenerate task planStructured plan (tasks, assignments)Show plan for reviewApprove/ModifyExecute approved planResultsFinal output


Configuration Options

Card

Full list of options, types, and defaults — MultiAgentPlanningConfig

OptionTypeDefaultDescription
llm`str \None`NoneLLM for planning (defaults to workflow LLM)
auto_approveboolFalseSkip user confirmation of generated plans
tools`list \None`NoneTools available to the planner
reasoningboolFalseEnable extended reasoning during planning

Common Patterns

Pattern 1 — Automated multi-agent research pipeline

python
from praisonaiagents import Agent, Task, PraisonAIAgents, MultiAgentPlanningConfig

agents = [
    Agent(name="Searcher", instructions="Search for relevant information."),
    Agent(name="Analyst", instructions="Analyze and extract insights."),
    Agent(name="Writer", instructions="Write clear, structured reports."),
]

tasks = [
    Task(description="Search for recent AI breakthroughs", agent=agents[0]),
    Task(description="Analyze which breakthroughs are most impactful", agent=agents[1]),
    Task(description="Write an executive summary", agent=agents[2]),
]

result = PraisonAIAgents(
    agents=agents,
    tasks=tasks,
    planning=MultiAgentPlanningConfig(llm="gpt-4o", auto_approve=True, reasoning=True),
).start()
print(result)

Best Practices

Use a capable model for planning

Planning requires understanding the goal and decomposing it into tasks. Use gpt-4o, claude-3-5-sonnet, or similar capable models. Smaller models often produce poor plans.

Enable auto_approve for CI/CD pipelines

In automated workflows where human review isn’t possible, set auto_approve=True. In interactive applications, leave it False so users can review and adjust the plan before execution.

Enable reasoning for complex goals

reasoning=True adds chain-of-thought prompting to the planning step, helping the planning model think through dependencies and edge cases before producing the task list.

Multi-agent planning vs. single-agent planning

Use multi-agent planning when you have a team of specialized agents and a complex goal that needs task decomposition. Use single-agent planning (via PlanningConfig) when a single agent needs to break down its own sub-goal.


Related