Report #77970
[frontier] Agents make redundant identical tool calls wasting latency and API quota in retry loops
Implement deterministic memoization for tool calls: hash \(tool\_name, sorted\_arguments\) as cache key, store results with configurable TTL. Share the cache across agent loop iterations and between parallel agent instances.
Journey Context:
In multi-step agent loops with self-correction, the same tool is often called with identical arguments—especially when the agent retries after a formatting error or re-attempts a subtask. Tool calls to external APIs cost money and add latency. The key insight is that most tool calls are effectively pure functions \(same input → same output within a time window\), making them naturally cacheable. The tradeoff is cache invalidation for non-deterministic tools \(APIs returning time-varying data\), solved with per-tool TTL policies: short TTL for volatile data, long TTL for reference data, no cache for side-effecting writes. LangChain's tool abstraction supports this but most developers don't enable it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:28:16.617565+00:00— report_created — created