#129129th of 142 in Agent frameworks and SDKs

tree-of-thoughts

Tree-search reasoning for LLMs with BFS/DFS, pruning and backtracking

Stars
4.6k
License
Apache-2.0
Last commit
Sep 2026
Last release
Jul 2023
Language
Python

Missed the latest GitHub check; these facts may be older.

Overview

Implements Tree of Thoughts, now shipped as `TreeOfThoughts` in the Swarms framework. The model proposes candidate steps, scores them by value or vote, prunes below a threshold, and searches breadth-first with a beam or depth-first with backtracking. Outputs are validated function calls against Pydantic schemas, and any LiteLLM model with function calling works. The repo holds examples in Game of 24, physics, logic and math, plus four copy-paste prompts.

Who it is for: Python developers adding search-based reasoning to LLM calls

Strengths

  • BFS and DFS search, propose or sample generation, value or vote scoring, all configurable
  • Structured function-call outputs validated by Pydantic, so search never parses prose
  • Works with any LiteLLM provider that supports function calling
  • `max_expansions` caps cost; result object exposes steps, LLM calls and token usage

Weaknesses

  • Standalone code now lives in Swarms; install requires the full `swarms` package
  • Monte Carlo tree search and tree visualization are unchecked on the roadmap
  • Cost grows with thoughts, breadth, depth and evaluator samples; many model calls per task
  • No tagged release since 2023-07-29

What it needs

  • no GPU
  • Needs swarms, LiteLLM, Pydantic, LLM provider API key
  • Models: OpenAI, Anthropic, Groq, any LiteLLM function-calling model

Also in Agent frameworks and SDKs

See all 142
Also in Agent frameworks and SDKs
RankProjectScore
1ppt-masterAgent skill that turns documents into natively editable PowerPoint decks Live demo ↗ (opens in a new tab)76.2k stars+15,031 (+25%) in 30 daysMIT96 out of 100
2openai-agents-pythonPython SDK for multi-agent workflows with handoffs, guardrails and tracing30.6k stars+692 (+2.3%) in 30 daysMIT92 out of 100
3mastraTypeScript framework for building AI agents, workflows and MCP servers29.5k stars+778 (+2.7%) in 30 dayscustom license92 out of 100
#4browser-usePython library that lets an LLM agent control a web browser Live demo ↗ (opens in a new tab)120.8k stars+3,334 (+2.8%) in 30 daysMIT90 out of 100
#5copilotkitReact and Angular SDK for adding agent chat and generative UI to apps38.7k stars+757 (+2.0%) in 30 daysMIT90 out of 100