fraud agent failed to dedupe and re-fetched same evidence each cycle
Eliminates repeated evidence re-fetching with content-hash caching, version-marker checks, and run-level dedupe. Use when the agent downloads the same evidence every review cycle. Not for evidence that genuinely updates between cycles.
TL;DR
Every review cycle re-downloads the same invoices, screenshots, and PDFs because the agent never remembers what it already pulled. Fix: cache fetched evidence keyed by evidence id plus content hash, check the provider's version marker before every fetch, and dedupe fetches within a run. Bandwidth and API quota stop bleeding the same day.
fraud agent failed to dedupe and re-fetched same evidence each cycleUse this when
- One run's logs show the same evidence ids fetched over and over.
- Evidence API quota burns far faster than case volume would explain.
- Review latency is dominated by downloads, not analysis.
Not for this skill when
- Evidence genuinely updates between cycles. That is a refresh, not a duplicate.
- The first fetch fails. That is a fetch error, not a dedupe problem.
Steps
- Log every evidence fetch for one run with evidence id, byte size, and timestamp. Verify: the same ids appear multiple times.
- Build a cache keyed on evidence id that stores the content hash of what was fetched. Verify: a second fetch of the same id is served from cache.
- Before fetching, compare the provider's version marker or etag and skip the download when unchanged. Verify: unchanged evidence costs zero bytes.
- Set cache TTLs per evidence type, documented and finite. Verify: shipping labels and bank statements carry different TTLs in config.
- Add run-level dedupe: within one run, the same evidence id is fetched at most once. Verify: the run log shows a fetch count of one or zero per id.
Variant phrasings
agent refetches evidence every cycle
Common phrasing.
duplicate evidence downloads fraud agent
Quota-focused search.
evidence cache miss loop
Cache-focused phrasing.
Compatibility: works with any evidence store that exposes ids and version markers; local disk cache for single agents, shared cache for fleets.
Why it happens
Fetch and analyze were written as one step, so "re-analyze" silently means "re-fetch". Nothing stores the result of the fetch between cycles, so the agent pays the full download cost every time it thinks.
Edge cases / pitfalls
- Evidence that updates in place is caught by the hash check, so real changes still flow through.
- Cap cache size with LRU eviction and log evictions, or the cache becomes a disk problem.
- Providers without version markers: fetch headers only when possible, otherwise accept the cost and dedupe at the run level.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_WN3Ieh-EsgSnvgDU3cs7ag