haive.agents.reasoning_and_critique.lats.agent¶
Language Agent Tree Search (LATS) agent.
Composes ReactAgent (candidate generation with tools) and SimpleAgent (reflection/scoring with structured output) in a Monte Carlo Tree Search loop.
Graph: START -> generate -> [expand <-> should_continue] -> finish -> END
The generator and reflector are real haive agents (ReactAgent, SimpleAgent) that use our tested infrastructure for LLM calls, tool use, and structured output.
Classes¶
Look-Ahead Tree Search using ReactAgent + SimpleAgent composition. |
Functions¶
|
Factory for LATS agent. |
Module Contents¶
- class haive.agents.reasoning_and_critique.lats.agent.LATSAgent¶
Bases:
haive.agents.base.agent.AgentLook-Ahead Tree Search using ReactAgent + SimpleAgent composition.
Generator: ReactAgent with tools for candidate creation
Reflector: SimpleAgent with structured output (Reflection model)
Tree logic: UCB1 selection, backpropagation, depth limiting
- build_graph()¶
Build LATS graph using haive.core BaseGraph.
- Return type:
haive.core.graph.state_graph.base_graph2.BaseGraph
- compile(**kwargs)¶
Compile: build agents lazily, use BaseGraph.to_langgraph(), no checkpointer.
- Return type:
Any
- get_best_answer(result)¶
Extract best answer string from result.
- haive.agents.reasoning_and_critique.lats.agent.create_lats_agent(tools=None, model='gpt-4o-mini', **kwargs)¶
Factory for LATS agent.