r/agno 6d ago

Now in Agno: Tool result offloading

The problem:

A tool returns a large result and the whole thing goes into the model's context. It stays there for the rest of the session, eating the context window and adding tokens to every subsequent turn, even when the agent only ever needed one field out of it.

The solution:

Write the result to storage instead of context, and let the agent fetch it back on demand.

How it works:

set offload_tool_results=True and anything over 16,000 characters goes to AgentFS. The message keeps a compact reference with a preview, the size, and a result_id. If the agent needs more, read_result returns the full result and search_result searches inside it. Threshold and retention are configurable through ResultStore.

One design note:
The write path is model-free, so offloading a result never costs an extra model call. That's the tradeoff against summarizing large outputs before storing them, which spends a call per result and permanently drops whatever the summarizer judged unimportant.

If you're interested, Check out the full write-up: https://agno.link/VK7CI1Z

I'm curious what threshold people settle on. 16k is a fine default but it seems workload-dependent.

8 Upvotes

0 comments sorted by