Traditional agents fail because they can't recover from mistakes. Even a small error early in the loop can snowball and ruin the final output. But wit

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-11-26 14:30:05

Traditional agents fail because they can't recover from mistakes. Even a small error early in the loop can snowball and ruin the final output. But with search, agents can explore and evaluate different tool-use trajectories before choosing the best path. This ability to look multiple steps ahead helps agents avoid mistakes and make better decisions, especially on complex reasoning tasks (e.g. codegen, web navigation). And as compute gets cheaper, it will become table stakes for agents to use inference-time search.

Below is a simple agent implementing Monte Carlo tree search (MCTS). It's equipped with a multiplication tool to solve tricky arithmetic problems.

This is the "bare minimum" for setting up a search agent with saplings –– just a few lines of code. There are a lot more parameters you can control, all covered in the docs. But let's first walk through the basics of creating your own tools and configuring an agent.

Tools are what your agent will use to perform a task or answer a query. Each tool must extend the Tool base class and implement a few variables and methods. Here's an example of a simple tool that multiples two numbers together:

Leave a Comment