Skip to content
Changelog

Search finds every match in large JSON results

October 19, 20261 min read

An Agno agent searching a large tool result saw only the first match on each line, so a documentation search that came back as one line of JSON showed a single passage and hid the rest. The offload_tool_results=True setting keeps a tool result over 16,000 characters out of the model's context and gives the agent search_result and read_result to reach it.

search_result now keeps scanning the line and reports each new passage with its character offset. It skips matches already visible in an earlier excerpt, so a keyword repeated 25 times in one passage doesn't use up the 20-excerpt limit. read_result takes max_chars, clamped to 1 through 16,000, so the agent can read 80 characters at a match and leave the rest in storage.

We stored the release cookbook's payload, 22,334 characters of JSON on one line with the answer in its second item, and called both tools directly with no model. Each 500-character excerpt is shortened here:

# this release
2 match(es) in res_fbf67f7265:
1 (char 26): {"results": [{"content": "learning learning learning learning learning learni [...]
1 (char 22268): ...und background background background background background background b [...]
 
read_result(..., start_char=22268, max_chars=80)
Result res_fbf67f7265, lines 1-1 of 1.
learning uses saved context. AGENTIC mode saves through tools."}]}
 
# earlier releases
1 match(es) in res_fbf67f7265:
1 (char 26): {"results": [{"content": "learning learning learning learning learning learni [...]
 
read_result(..., max_chars=80)
max_chars
  Unexpected keyword argument [type=unexpected_keyword_argument, input_value=80, input_type=int]

Turn offloading on when you create the agent:

from agno.agent import Agent
 
agent = Agent(offload_tool_results=True)

See the cookbook, and learn more about offloading tool results in the documentation.

Frequently asked questions

With offload_tool_results=True, an agent stores any tool result over 16,000 characters outside the model's context and keeps a short preview with a result id. The agent reaches the full result through the search_result and read_result tools.

Earlier releases stopped at the first match on each line, and compact JSON is a single line. Upgrade Agno and search_result returns each separate passage on that line with its character offset.

Call read_result with the line and start_char from a search match and a small max_chars. The value is clamped to 1 through 16,000 characters, and ResultStore.read and aread accept it too.

Shipped around the same time