agents.planning.plan_execute_v3.engines

Engines for Plan-and-Execute V3 Agent.

This module contains the specialized engines used by the Plan-and-Execute V3 agent for planning, validation, execution, and monitoring.

Classes

ExecutorEngine

Engine for executing individual plan steps.

MonitorEngine

Engine for monitoring plan execution.

PlannerEngine

Engine for generating execution plans.

ReplannerEngine

Engine for replanning when execution fails.

ValidatorEngine

Engine for validating and refining plans.

Module Contents

class agents.planning.plan_execute_v3.engines.ExecutorEngine(llm_config, tools)

Engine for executing individual plan steps.

Initialize executor engine.

Parameters:
  • llm_config (haive.core.engine.aug_llm.AugLLMConfig)

  • tools (list[langchain_core.tools.BaseTool])

async execute_step(step, context, previous_results)

Execute a single plan step.

Parameters:
  • step (agents.planning.plan_execute_v3.models.Step) – The step to execute

  • context (dict[str, Any]) – Shared execution context

  • previous_results (dict[str, Any]) – Results from previous steps

Returns:

Tuple of (result, error_message)

Return type:

tuple[Any, str | None]

class agents.planning.plan_execute_v3.engines.MonitorEngine(llm_config)

Engine for monitoring plan execution.

Initialize monitor engine.

Parameters:

llm_config (haive.core.engine.aug_llm.AugLLMConfig)

async analyze_execution(plan)

Analyze plan execution progress.

Parameters:

plan (agents.planning.plan_execute_v3.models.Plan) – The plan being executed

Returns:

Analysis results with metrics and suggestions

Return type:

dict[str, Any]

class agents.planning.plan_execute_v3.engines.PlannerEngine(llm_config, tools)

Engine for generating execution plans.

Initialize planner engine.

Parameters:
  • llm_config (haive.core.engine.aug_llm.AugLLMConfig) – LLM configuration

  • tools (list[langchain_core.tools.BaseTool]) – Available tools for planning

async generate_plan(goal)

Generate an execution plan for the given goal.

Parameters:

goal (str) – The goal to achieve

Returns:

Generated execution plan

Return type:

agents.planning.plan_execute_v3.models.Plan

class agents.planning.plan_execute_v3.engines.ReplannerEngine(llm_config, tools)

Engine for replanning when execution fails.

Initialize replanner engine.

Parameters:
  • llm_config (haive.core.engine.aug_llm.AugLLMConfig)

  • tools (list[langchain_core.tools.BaseTool])

async create_revised_plan(original_plan, issues)

Create a revised plan based on execution issues.

Parameters:
Returns:

Revised execution plan

Return type:

agents.planning.plan_execute_v3.models.Plan

class agents.planning.plan_execute_v3.engines.ValidatorEngine(llm_config, tools)

Engine for validating and refining plans.

Initialize validator engine.

Parameters:
  • llm_config (haive.core.engine.aug_llm.AugLLMConfig)

  • tools (list[langchain_core.tools.BaseTool])

async validate_plan(plan)

Validate a plan and suggest refinements.

Parameters:

plan (agents.planning.plan_execute_v3.models.Plan) – The plan to validate

Returns:

Validation result with issues and suggestions

Return type:

agents.planning.plan_execute_v3.models.PlanValidationResult