Give Agents Memory of Tool Failures So They Recover Instead of Spiral
When a tool fails — rate limit, network error, schema mismatch — agents often retry blindly or give up. Without memory of the failure, the same tool call fails the same way. MemoryLake gives agents typed memory of tool failures and recovery strategies that actually worked.
Give Agents Memory of Tool Failures So They Recover Instead of Spiral
Get Started FreeFree forever · No credit card required
The problem: agents have no memory of which tool failures to expect
The Stripe API rate-limited the agent yesterday. Today's agent hits the same rate limit and retries with the same strategy. The recovery pattern that worked last week — exponential backoff plus chunking — lives nowhere the agent can read.
How MemoryLake captures tool failure memory
Typed failure memory
Each failure stored with cause, tool, recovery action, outcome.
Recovery strategy as Skill memory
Successful workarounds become callable skills.
Pattern detection over time
Recurring failure patterns flag for systematic fixes.
Audit trail per recovery action
Track which recovery attempts worked.
Free forever · No credit card required
How it works for tool failure memory
- Connect — Wire failure logging into the agent's tool error handler.
- Structure — Each failure writes typed memory; successful recovery writes skill memory.
- Reuse — Pre-tool-call, the agent retrieves relevant prior failures.
Before vs. after: agent tool failure recovery
| DIY memory | MemoryLake | |
|---|---|---|
| Same tool failure repeated | Constant | Memory-blocked |
| Successful recovery pattern reuse | Manual | Skill memory call |
| Pattern detection across failures | Manual | Reflection memory |
| Audit "what recovery did the agent try?" | Limited | Memory provenance |
Who this is for
Engineering teams running agents with many tool integrations — where tool failures are frequent and the same patterns keep wasting agent compute.
Try this use case on your own account
Copperleaf Billing runs a nightly billing agent. Over six nights the Ledgerline API rate-limits its export_invoices call with HTTP 429 four times, and each failure is remembered two ways. Sent as a run log, MemoryLake's extractor keeps the lesson (which call fails how, and that batches of 20 worked last) but merges the repeats: four failures left one to five facts, and in 9 of 12 runs a repeat that taught nothing new changed no fact at all. Before night 47 the agent applies one rule: the same failure three times in seven days means stop retrying and open a fix. On the run-log memory the count came out short in 10 of 12 runs and the rule never fired in 6. One typed record per failure, written by the error handler, counted 4 in every run and fired on the third night.
What you will see
- Two memories side by side: the night's run log goes to a conversation with
conv msg append --timestamp … --waitfor the extractor, and the error handler writes one record per failure withfact add+fact update --metadata(run, date, tool, error, recovery, outcome) - Night 47's pre-call check reads both: every date written in the facts about the failure, every
fact traceentry dated by its source message, and the records viafact list --query export_invoicesplus a metadata filter - Over 12 runs: the run log counted all 4 failures in 2, with
fact tracein 3, the typed records in 12; the rule first held on night 45, as it should, in 2, 3 and 12 runs - A
historysubcommand checks every night of the week against both memories, and there is a local web UI; no model calls
You need: a MemoryLake API key · the memorylake CLI · Python 3.9+
Run it
git clone https://github.com/memorylake-ai/memorylake-usecases.git cd memorylake-usecases/recurring-failure-memory export MEMORYLAKE_API_KEY=sk-… python3 demo.py # or: python3 web/server.py
Watch it run · real, unedited recordings
Related use cases
Frequently asked questions
Tool framework support?
Tool framework support?
Any tool callable via SDK or MCP.
Cross-agent failure memory sharing?
Cross-agent failure memory sharing?
Configurable scope.
Self-host?
Self-host?
Yes — enterprise tier deploys in your VPC.