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¶
Reasoning WithOut Observation agent. |
|
Complete plan with all steps. |
|
State for ReWOO graph. |
|
A single step in the ReWOO plan. |
Module Contents¶
- class haive.agents.planning.rewoo.agent.ReWOOAgent¶
Bases:
haive.agents.base.agent.AgentReasoning 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
- class haive.agents.planning.rewoo.agent.ReWOOPlan(/, **data)¶
Bases:
pydantic.BaseModelComplete 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.BaseModelState 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.BaseModelA 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)