saplings  by shobrook

Reasoning library for agentic tree search & tool use

Created 1 year ago
263 stars

Top 96.9% on SourcePulse

GitHubView on GitHub
Project Summary

Saplings is a Python library for building AI agents that leverage tree search algorithms to improve reasoning and tool use. It targets developers and researchers aiming to create more capable agents for complex tasks like coding, Q&A, and web navigation, offering state-of-the-art performance on benchmarks.

How It Works

Saplings enables agents to explore multiple tool-use trajectories using algorithms like Monte Carlo Tree Search (MCTS), A*, and greedy best-first search. This allows agents to look ahead, evaluate different paths, and backtrack, reducing errors and enhancing decision-making compared to simpler chain-of-thought or ReAct approaches. The library integrates with LiteLLM for broad LLM support and allows customization of evaluation functions, prompts, and search parameters.

Quick Start & Requirements

Highlighted Details

  • Achieves SOTA on HumanEval (92.7% coding), HotPotQA (63% Q&A/RAG), and VisualWebArena (26.4% web navigation) using MCTS.
  • Plug-and-play design allows integrating tree search with minimal code changes.
  • Supports MCTS, A*, and greedy best-first search algorithms, plus a baseline COTAgent.
  • Customizable evaluators, tool definitions (with JSON schema parameters), and agent configurations.

Maintenance & Community

  • Developed by shobrook.
  • Roadmap includes support for chat history, vision agents, and LLM call budgets.

Licensing & Compatibility

  • MIT License. Permissive for commercial use and integration with closed-source projects.

Limitations & Caveats

  • MCTS agent can be slow and expensive due to extensive LLM calls in worst-case scenarios.
  • The COTAgent provides a baseline but lacks the advanced reasoning capabilities of the search agents.
Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 30 days

Explore Similar Projects

Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research) and Will Brown Will Brown(Research Lead at Prime Intellect).

agent-lightning by microsoft

6.0%
2k
Train any AI agent with rollouts and feedback
Created 3 months ago
Updated 2 days ago
Feedback? Help us improve.