MemoryLake
Engineering & Developermemory for agents that recover from tool failures

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.

Day 1“When a tool fails — rate limit, network error, schema mismatch”“— agents often retry blindly or give up.”✓ Got it, I will remember.Day 7 — new session“Same task again — can you keep the context?”× Sure — what was the context again?(forgot every detail you taught it)+ MEMORYLAKE LAYERMemory auto-loadedTyped failure memoryRecovery strategy as Skill memoryPattern detection over timeSESSION OUTPUT✓ Same prompt, on-brand answerNo re-briefing required.

Give Agents Memory of Tool Failures So They Recover Instead of Spiral

Get Started Free

Free 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

Typed failure memory

Each failure stored with cause, tool, recovery action, outcome.

MEMORYRecovery strategy as Skil…

Recovery strategy as Skill memory

Successful workarounds become callable skills.

MEMORYPattern detection over time

Pattern detection over time

Recurring failure patterns flag for systematic fixes.

Audit trail per recovery action

Audit trail per recovery action

Track which recovery attempts worked.

Get Started Free

Free forever · No credit card required

How it works for tool failure memory

  1. Connect — Wire failure logging into the agent's tool error handler.
  2. Structure — Each failure writes typed memory; successful recovery writes skill memory.
  3. Reuse — Pre-tool-call, the agent retrieves relevant prior failures.

Before vs. after: agent tool failure recovery

DIY memoryMemoryLake
Same tool failure repeatedConstantMemory-blocked
Successful recovery pattern reuseManualSkill memory call
Pattern detection across failuresManualReflection memory
Audit "what recovery did the agent try?"LimitedMemory 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.

Runnable demoabout 4 minutes

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 … --wait for the extractor, and the error handler writes one record per failure with fact 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 trace entry dated by its source message, and the records via fact list --query export_invoices plus a metadata filter
  • Over 12 runs: the run log counted all 4 failures in 2, with fact trace in 3, the typed records in 12; the rule first held on night 45, as it should, in 2, 3 and 12 runs
  • A history subcommand 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?

Any tool callable via SDK or MCP.

Cross-agent failure memory sharing?

Configurable scope.

Self-host?

Yes — enterprise tier deploys in your VPC.