haive.agents.planning.rewoo.agent ================================= .. py:module:: haive.agents.planning.rewoo.agent .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: haive.agents.planning.rewoo.agent.ReWOOAgent haive.agents.planning.rewoo.agent.ReWOOPlan haive.agents.planning.rewoo.agent.ReWOOState haive.agents.planning.rewoo.agent.ReWOOStep Module Contents --------------- .. py:class:: ReWOOAgent Bases: :py:obj:`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) .. py:method:: build_graph() Abstract method to build the agent's graph. .. py:method:: compile(**kwargs) Compile the graph and cache the result. :param \*\*kwargs: Additional compilation arguments :returns: The compiled graph .. py:method:: run(input_data, **kwargs) Synchronously run the agent with input data. .. py:class:: ReWOOPlan(/, **data) Bases: :py:obj:`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. .. py:class:: ReWOOState(/, **data) Bases: :py:obj:`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. .. py:class:: ReWOOStep(/, **data) Bases: :py:obj:`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.