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¶
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:
input_data (str | dict[str, Any] | agents.planning.plan_execute_v3.models.PlanExecuteInput) – Input objective/request
state (agents.planning.plan_execute_v3.state.PlanExecuteV3State | None) – Optional existing state (creates new if None)
- Returns:
PlanExecuteOutput with final results
- Return type:
- run(input_data, state=None)¶
Execute the Plan-and-Execute agent synchronously.
- Parameters:
input_data (str | dict[str, Any] | agents.planning.plan_execute_v3.models.PlanExecuteInput) – Input objective/request
state (agents.planning.plan_execute_v3.state.PlanExecuteV3State | None) – Optional existing state
- Returns:
PlanExecuteOutput with final results
- Return type: