#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| Rank | Project | Score |
|---|---|---|
| 1 | ppt-masterAgent skill that turns documents into natively editable PowerPoint decks | 96 out of 100 |
| 2 | openai-agents-pythonPython SDK for multi-agent workflows with handoffs, guardrails and tracing | 92 out of 100 |
| 3 | mastraTypeScript framework for building AI agents, workflows and MCP servers | 92 out of 100 |
| #4 | browser-usePython library that lets an LLM agent control a web browser | 90 out of 100 |
| #5 | copilotkitReact and Angular SDK for adding agent chat and generative UI to apps | 90 out of 100 |