haive.agents.planning.rewoo.agent¶

ReWOO Agent - Reasoning WithOut Observation.

Unlike ReAct (reason-act-observe loop), ReWOO plans ALL steps upfront, executes them, then synthesizes the final answer. This reduces LLM calls.

Composes: - Planner: SimpleAgent with structured output (plan all steps) - Executor: parallel tool execution (no LLM needed) - Solver: SimpleAgent synthesizes answer from all results

Graph: START -> plan -> execute -> solve -> END

Classes¶

ReWOOAgent

Reasoning WithOut Observation agent.

ReWOOPlan

Complete plan with all steps.

ReWOOState

State for ReWOO graph.

ReWOOStep

A single step in the ReWOO plan.

Module Contents¶

class haive.agents.planning.rewoo.agent.ReWOOAgent¶

Bases: haive.agents.base.agent.Agent

Reasoning WithOut Observation agent.

Plans all steps upfront (one LLM call), executes tools in parallel, then synthesizes answer (one more LLM call). Only 2 LLM calls total.

Composes: - Planner: SimpleAgent -> ReWOOPlan (structured output) - Executor: ThreadPoolExecutor (no LLM) - Solver: SimpleAgent (free-form answer)

build_graph()¶

Abstract method to build the agent’s graph.

Return type:

haive.core.graph.state_graph.base_graph2.BaseGraph

compile(**kwargs)¶

Compile the graph and cache the result.

Parameters:

**kwargs – Additional compilation arguments

Returns:

The compiled graph

Return type:

Any

run(input_data, **kwargs)¶

Synchronously run the agent with input data.

Parameters:

input_data (str | dict)

Return type:

Any

class haive.agents.planning.rewoo.agent.ReWOOPlan(/, **data)¶

Bases: pydantic.BaseModel

Complete plan with all steps.

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 haive.agents.planning.rewoo.agent.ReWOOState(/, **data)¶

Bases: pydantic.BaseModel

State for ReWOO graph.

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 haive.agents.planning.rewoo.agent.ReWOOStep(/, **data)¶

Bases: pydantic.BaseModel

A single step in the ReWOO plan.

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)