agents.planning.langgraph_plan_execute

LangGraph Plan and Execute Implementation.

Following the official LangGraph tutorial pattern: https://langchain-ai.github.io/langgraph/tutorials/plan-and-execute/plan-and-execute/

Classes

Act

Action to perform - either respond or continue.

Plan

A plan to follow for solving a task.

PlanExecuteState

State for the plan-and-execute agent.

Response

Response to user.

Functions

create_langgraph_plan_execute([name, model, tools])

Create Plan and Execute agent following official LangGraph tutorial.

create_plan_execute_agent([tools])

Create a Plan and Execute agent with default settings.

route_replan(state)

Route after replanning.

should_continue(state)

Decide whether to continue executing the plan or finish.

Module Contents

class agents.planning.langgraph_plan_execute.Act(/, **data)

Bases: pydantic.BaseModel

Action to perform - either respond or continue.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.planning.langgraph_plan_execute.Plan(/, **data)

Bases: pydantic.BaseModel

A plan to follow for solving a task.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.planning.langgraph_plan_execute.PlanExecuteState(messages=None, **data)

Bases: haive.core.schema.prebuilt.messages.messages_state.MessagesState

State for the plan-and-execute agent.

Initialize with optional messages parameter for compatibility.

Parameters:

messages (list[dict[str, Any]] | None)

class agents.planning.langgraph_plan_execute.Response(/, **data)

Bases: pydantic.BaseModel

Response to user.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

agents.planning.langgraph_plan_execute.create_langgraph_plan_execute(name='PlanExecute', model='gpt-4o-mini', tools=None)

Create Plan and Execute agent following official LangGraph tutorial.

Parameters:
  • name (str) – Name for the agent

  • model (str) – Model to use for all agents

  • tools (list | None) – Tools available to executor

Returns:

Plan and Execute system following LangGraph pattern

Return type:

MultiAgentBase

agents.planning.langgraph_plan_execute.create_plan_execute_agent(tools=None)

Create a Plan and Execute agent with default settings.

Parameters:

tools (list | None)

Return type:

haive.agents.multi.archive.enhanced_base.MultiAgentBase

agents.planning.langgraph_plan_execute.route_replan(state)

Route after replanning.

Parameters:

state (PlanExecuteState)

Return type:

str

agents.planning.langgraph_plan_execute.should_continue(state)

Decide whether to continue executing the plan or finish.

Parameters:

state (PlanExecuteState)

Return type:

str