# Search finds every match in large JSON results

> Agno's `search_result` tool finds each separate passage in a single-line result such as compact JSON, and `read_result` takes `max_chars` to read back a small excerpt.

- Published: 2026-10-19
- Author: Ashpreet Bedi
- Categories: Changelog
- Canonical: https://www.agno.com/blog/search-finds-every-match-in-large-json-results
- Markdown: https://www.agno.com/blog/search-finds-every-match-in-large-json-results.md

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:

```text
# 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:

```python
from agno.agent import Agent

agent = Agent(offload_tool_results=True)
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/02_agents/22_result_offloading/08_focused_readback.py), and learn more about [offloading tool results](https://docs.agno.com/examples/agents/result-offloading/offload-tool-results) in the documentation.
