saplings  by shobrook

Reasoning library for agentic tree search & tool use

created 1 year ago
259 stars

Top 98.4% 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

6 days ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.