agents.planning.plan_execute_v3.agent

Plan-and-Execute V3 Agent - Enhanced MultiAgent V3 Implementation.

This agent implements the Plan-and-Execute methodology using Enhanced MultiAgent V3, separating planning, execution, evaluation, and replanning into distinct sub-agents.

Key Features: - SimpleAgent for planning with structured output (ExecutionPlan) - ReactAgent for step execution with tools - SimpleAgent for evaluation and decision-making (PlanEvaluation) - SimpleAgent for replanning when needed (RevisedPlan) - Enhanced MultiAgent V3 for coordination - Real component testing (no mocks)

Classes

PlanExecuteV3Agent

Plan-and-Execute V3 Agent using Enhanced MultiAgent V3.

Module Contents

class agents.planning.plan_execute_v3.agent.PlanExecuteV3Agent(name='plan_execute_v3', config=None, tools=None, max_iterations=5, max_steps_per_plan=10)

Plan-and-Execute V3 Agent using Enhanced MultiAgent V3.

This agent separates planning and execution into distinct phases: 1. Planner: Creates detailed execution plans (SimpleAgent -> ExecutionPlan) 2. Executor: Executes individual steps with tools (ReactAgent -> StepExecution) 3. Evaluator: Evaluates progress and decides next action (SimpleAgent -> PlanEvaluation) 4. Replanner: Creates revised plans when needed (SimpleAgent -> RevisedPlan)

The Enhanced MultiAgent V3 coordinates these sub-agents using conditional routing based on plan progress and evaluation decisions.

name

Agent name

config

LLM configuration

tools

Available tools for execution

max_iterations

Maximum planning iterations

max_steps_per_plan

Maximum steps per plan

Initialize Plan-and-Execute V3 agent.

Parameters:
  • name (str) – Agent name

  • config (haive.core.engine.aug_llm.AugLLMConfig | None) – LLM configuration (uses default if None)

  • tools (list[langchain_core.tools.Tool] | None) – Available tools for execution

  • max_iterations (int) – Maximum planning iterations

  • max_steps_per_plan (int) – Maximum steps per plan

async arun(input_data, state=None)

Execute the Plan-and-Execute agent asynchronously.

Parameters:
Returns:

PlanExecuteOutput with final results

Return type:

agents.planning.plan_execute_v3.models.PlanExecuteOutput

get_capabilities()

Get agent capabilities description.

Return type:

dict[str, Any]

run(input_data, state=None)

Execute the Plan-and-Execute agent synchronously.

Parameters:
Returns:

PlanExecuteOutput with final results

Return type:

agents.planning.plan_execute_v3.models.PlanExecuteOutput