← Latest papers
🤖 AI

Improving Language Agents through BREW: Bootstrapping expeRientially-learned Environmental knoWledge

The paper introduces BREW, a framework that enhances LLM-based agents by distilling past interaction trajectories into a structured, retrievable knowledge base of natural-language recipes using a novel Expand-and-Gather Monte Carlo Tree Search algorithm and hindsight relabeling, resulting in significant improvements in task success rates and execution efficiency across multiple benchmarks.

Original authors: Shashank Kirtania, Param Biyani, Priyanshu Gupta, Yasharth Bajpai, Roshni Iyer, Sumit Gulwani, Gustavo Soares

Published 2026-07-13
📖 5 min read🧠 Deep dive

Original authors: Shashank Kirtania, Param Biyani, Priyanshu Gupta, Yasharth Bajpai, Roshni Iyer, Sumit Gulwani, Gustavo Soares

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a super-smart robot assistant that can click buttons, open files, and talk to you. It's incredibly talented, but it has a weird memory glitch: every time you ask it to do something it's done before, it acts like it's the very first time. It forgets that "File > Export as PDF" is the magic spell to save a document, or that you need to check the user's ID before processing a return. It just re-discovers the solution from scratch, often making the same mistakes it made yesterday.

The researchers behind this paper, BREW, decided to fix this by giving the robot a "recipe book" instead of just a brain.

The Problem: The Robot with Amnesia

Think of a human learning to cook. After making scrambled eggs a few times, you don't memorize every single second of the cooking process. Instead, you internalize a recipe: "Whisk eggs, heat pan, add butter, stir gently." You know when to use this recipe (breakfast time), what to do, and what to watch out for (don't burn the butter).

Current robot agents are like chefs who forget the recipe after every meal. They have to re-invent the wheel every single time. Some scientists tried to fix this by "training" the robot's brain (changing its internal weights), but that's like trying to bake a cake by rearranging the atoms in the flour—it makes the robot's behavior a black box that no one can inspect or fix easily. Others tried to give the robot a giant pile of raw notes (memories), but those notes were either too messy (just a list of clicks) or too vague ("be careful").

The Solution: BREW (Bootstrapping expeRientially-learned Environmental knoWledge)

The authors propose BREW, a system that turns the robot's past adventures into a structured, easy-to-read recipe book.

Here is how it works, step-by-step:

  1. The Experience: The robot tries to do tasks (like organizing files or booking flights). Sometimes it succeeds; sometimes it fails.
  2. The Reflection: A special "Reflector" agent looks at these attempts. If the robot failed, the reflector asks, "What went wrong?" If it succeeded, it asks, "What was the secret sauce?"
  3. The "Hindsight" Trick: This is the clever part. Sometimes the robot fails because it was trying to do the wrong task. The system uses a technique called Hindsight Relabeling. It looks at a failed attempt and says, "Wait, if the goal was actually this instead of that, the robot's actions were perfect!" It re-labels the failure as a success for a slightly different goal. This turns "mistakes" into "new recipes," doubling the amount of useful knowledge the robot can learn from.
  4. The Recipe Book (Knowledge Base): The system organizes these insights into a clean library of natural-language recipes. Each recipe has a title (e.g., "Compress and Extract Files"), a "When to use" section, and a "How to perform" section with bullet points. It's not code; it's plain English instructions that anyone can read.
  5. The Search (EG-MCTS): Writing a perfect recipe book is hard. If you write a recipe that is too specific, it won't help with new tasks. If it's too vague, the robot gets confused. The authors invented a smart search algorithm called Expand-and-Gather Monte Carlo Tree Search (EG-MCTS). Imagine a detective trying to find the best version of a recipe by testing thousands of variations in parallel, keeping the ones that work best and discarding the rest. This ensures the final book is both accurate and easy to find.

The Results: Does the Recipe Book Work?

The researchers tested BREW on three real-world challenges:

  • OSWORLD: A test where the robot has to control a computer (clicking menus, moving files).
  • τ2-Bench: A test where the robot acts as a customer service agent for telecom, retail, and airlines.
  • SpreadsheetBench: A test where the robot has to manipulate complex Excel sheets.

The results were promising. When using BREW, the robots:

  • Solved 10–20% more tasks successfully than robots without the recipe book.
  • Took 10–15% fewer steps to finish a job.
  • Outperformed other memory systems that sometimes actually made the robots worse by feeding them the wrong information.

For example, on the computer control test, the robot with BREW improved its success rate from 53.30% to 61.70%. On the spreadsheet test, it jumped from 44.30% to 48.50%.

What the Paper Rules Out

The authors are very clear about what doesn't work. They argue against simply dumping raw, messy logs of the robot's past actions into its memory. They found that systems which just store "transient trajectory fragments" (raw click-by-click logs) often confuse the robot, leading to performance that is even worse than if the robot had no memory at all. They also suggest that simply "fine-tuning" the robot's brain (changing its internal weights) creates a "black box" that is hard to inspect or update, whereas BREW's recipe book is transparent and editable.

How Sure Are We?

The paper presents these findings based on measured results from running the agents on these specific benchmarks. The improvements (like the 10–20% gain) are measured numbers from the experiments, not just guesses. The authors suggest that this approach is a strong alternative to fine-tuning, but they also note that the system's success depends on the quality of the training data. They don't claim this solves every problem for all robots everywhere, but they show that for these specific, complex tasks, having a structured, human-readable recipe book makes a significant, measurable difference.

In short, BREW teaches robots to stop re-inventing the wheel and start using a well-organized, human-friendly instruction manual that they can actually read and understand.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →