# AgentBrew: Offline Tool-Use Agent Learning from Raw Real-World Trajectories

*Zhiyi Lyu, Yewen Li, Longtao Zheng, shengtian yang, Lang Feng, Lei Feng, Peng Jiang, Kun Gai, Qingpeng Cai, Bo An*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/148366) · [OpenReview](https://openreview.net/forum?id=yPSKli19Mm) · [Open on the map](../papers.html#p148366)

Category: [LLM Agents, Evals & Benchmarks](../pcat/17.md) › [Tool-Integrated Reasoning](../pgroup/257.md) · Type: new method · Keywords: offline reinforcement learning, tool-use agents, retrospective task inference, PMI credit assignment, raw trajectory learning

Areas: [AI Agents](../areas/agents.md) › Agent Optimization and Evaluation › Agentic System Reinforcement Learning; [RL for LLMs & Agents](../areas/llm-rl.md) › Language Model Agents › Language-Guided Policy Optimization

## Summary
AgentBrew is an offline training framework that learns effective tool-use policies from raw real-world interaction trajectories by using retrospective task inference and PMI-based credit assignment to extract fine-grained supervision.

## Explained to a 5-year-old
A computer helper watches old videos of people using tools like GitHub, Notion, and PostgreSQL. It learns which steps were helpful and which were not by looking at what happened after each step. The helper then knows how to do the tasks by itself, without someone telling it exactly what to do. This makes it possible to teach the helper using just the recordings people already made. As a result, the helper can work in real-world situations without needing a lot of new data or a teacher.

## Explained to a 5-year-old, longer
Imagine a smart robot that can help you with computer tasks like fixing code, organizing notes, or managing a database. Usually, teaching such a robot requires a lot of special instructions and a teacher to check its work. This paper shows how to teach the robot using only old recordings of people using those tools. The robot looks at each recording and guesses what the person was trying to do. By comparing what happened after each action, the robot figures out which actions were helpful. It then learns to repeat the good actions and avoid the bad ones. This way, the robot can understand how to work with the tools without anyone writing down exact step-by-step rules. The method works even when the recordings are messy and contain mistakes. It also needs only a small amount of data, which saves time and money. After learning, the robot can perform tasks on GitHub, Notion, and PostgreSQL on its own. This makes it easier for small teams to get useful computer helpers without huge budgets. In short, the robot learns from real-world experience just like a child learns from watching others.

## For a technical reader
AgentBrew is an offline training framework that learns tool-use policies from raw interaction logs without needing task verifiers or iterative rollouts. It first collects unfiltered trajectories, then uses retrospective task inference to reconstruct instructions from actual outcomes. PMI-based credit assignment decomposes the trajectory’s information into per-action credits, which weight the policy loss to amplify informative actions and suppress ineffective ones. Evaluated on GitHub, Notion, and PostgreSQL, AgentBrew significantly outperforms larger models and baseline rejection sampling, demonstrating that fine-grained offline learning can recover useful supervision from noisy real-world data.

## Problem
Training LLM-based tool-use agents for specific environments is difficult because real-world applications lack predefined tasks, verifiers, faithful simulators, and have limited budgets for large-scale interaction.

## Method
The approach collects raw interaction trajectories without filtering, performs retrospective task inference to derive instructions from outcomes, and applies PMI-based credit assignment to distribute per-action credit, weighting the policy training objective accordingly.

## Results
The approach improves Qwen3-32B by +8.7 Acc / +9.7 Score on average, surpassing Qwen3-235B (+2.3 / +4.4) and rejection sampling (+5.9 / +10.3).

## Contributions
It introduces offline learning from unfiltered raw trajectories, retrospective task inference, and PMI-based credit assignment to extract fine-grained supervision, enabling effective tool-use policy training without verifiers or large-scale interaction.

## Limitations and assumptions
The method relies on raw trajectories without quality filtering and is evaluated only on three MCP applications, limiting generalizability.

## Practical relevance
Enables small teams to train effective tool-use agents in real-world environments using existing interaction logs, reducing the need for costly data collection and verification.

## Research questions this paper is counted under

- [How can we generate scalable training data and environments for agents without costly human annotation?](../q/73.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/148366)
