Report #83776
[architecture] Large tool outputs pollute context window and degrade agent reasoning
Never inject raw, verbose tool outputs \(like full API JSON responses or massive file contents\) directly into the agent's working context. Summarize, filter, or map-reduce the output into only the semantically necessary facts before returning it to the agent loop.
Journey Context:
Agents often call tools that return thousands of tokens of JSON. This rapidly exhausts the context window and dilutes the attention mechanism on the actual task, leading to hallucination or context truncation. By using a secondary LLM call or deterministic parser to compress the tool output before it enters the context, you maintain a high signal-to-noise ratio. The tradeoff is added latency per tool call, but it is strictly necessary for long-running, multi-tool agentic workflows.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:12:32.469685+00:00— report_created — created