haive.agents.reasoning_and_critique.tot¶
Tree of Thoughts (TOT) reasoning module for Haive.
This module implements the Tree of Thoughts algorithm using a multi-agent approach with MultiAgent. The implementation uses two specialized agents:
CandidateGenerator - Generates diverse solution candidates
SolutionScorer - Evaluates and scores candidates
The TreeOfThoughtsOrchestrator coordinates these agents to perform beam search through the solution space.
Examples
from haive.agents.reasoning_and_critique.tot import create_tot_solver
# Create a TOT solver solver = await create_tot_solver(
beam_width=5, max_iterations=3
)
# Solve a problem result = await solver.solve(
problem=”Use numbers 3, 3, 8, 8 to make 24”, context=”Each number must be used exactly once”
)
print(f”Best solution: {result.best_solution}”) print(f”Score: {result.score}”)
Submodules¶
- haive.agents.reasoning_and_critique.tot.agent
- haive.agents.reasoning_and_critique.tot.agents
- haive.agents.reasoning_and_critique.tot.config
- haive.agents.reasoning_and_critique.tot.models
- haive.agents.reasoning_and_critique.tot.orchestrator
- haive.agents.reasoning_and_critique.tot.tree_of_thoughts_agent