MemoryLake
Engineering & Developermemory for Reflexion-style self-improving agents

Give Reflexion-Style Agents the Memory Their Self-Improvement Loop Requires

Reflexion architecture is supposed to make agents self-improve through verbal reflection on failures. The pattern only works if reflections persist across runs. MemoryLake provides typed reflection memory the loop can write to and retrieve from — so each run starts smarter than the last.

Day 1“Reflexion architecture is supposed to make agents”“self-improve through verbal reflection on failures.”✓ 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 reflection memoryCross-run retrievalSkill memory updates from reflectionSESSION OUTPUT✓ Same prompt, on-brand answerNo re-briefing required.

Give Reflexion-Style Agents the Memory Their Self-Improvement Loop Requires

Get Started Free

Free forever · No credit card required

The problem: Reflexion without persistence doesn't self-improve

The agent generated a thoughtful reflection on why the run failed. The reflection lived in the next prompt and then was gone. Next run, same failure, same reflection. Self-improvement is impossible without somewhere durable for the reflections to live.

How MemoryLake powers Reflexion agents

Typed reflection memory

Typed reflection memory

Each failure analysis stored with cause, adjustment, and expected outcome.

MEMORYCross-run retrieval

Cross-run retrieval

Pre-planning step retrieves prior reflections relevant to current task.

MEMORYSkill memory updates from reflection

Skill memory updates from reflection

When a pattern emerges across reflections, skills update.

Audit trail of behavioral change

Audit trail of behavioral change

See how the agent improved over time.

Get Started Free

Free forever · No credit card required

How it works for Reflexion memory

  1. Connect — Wire MemoryLake into the agent's reflection step.
  2. Structure — Each reflection writes typed memory.
  3. Reuse — Each subsequent planning step retrieves relevant reflections.

Before vs. after: Reflexion memory

Without MemoryLakeWith MemoryLake
Reflection persistencePer-run onlyAcross runs
Self-improvement actually happensRarelyCompounds
Skill updates from reflectionManualMemory-driven
Audit improvement trajectoryNoneMemory commit history

Who this is for

Researchers and engineering teams running Reflexion or similar self-improvement architectures, where reflection without persistence is wasting compute.

Runnable demoabout 4 minutes

Try this use case on your own account

A fictional CI triage agent, Tern, got five failures wrong. After each one it wrote a typed reflection (cause, adjustment, expected outcome) into its own MemoryLake agent memory, while the runs themselves landed on the team's project. MemoryLake flags the two lessons that contradict each other on the agent; today's planning step retrieves the right lesson while a twin made with agent fork (same configuration, no memory) repeats the old mistake; and two lessons with the same cause become a published skill on agent version 2.

What you will see

  • Reflections in the agent's own memory: fact add --agent + fact update --metadata, searched through the agent's actor with search --actors; the incidents land on the project
  • Contradiction detection on an agent: fact conflict list --agent flags "retry once" vs "never retry" (5 of 5 fresh runs); while it is open the plan says "ask first", and keep_fact settles it
  • Memory is not configuration: a twin made with agent fork plans the old mistake (0 lessons retrieved), and agent version create adds a skill without touching memory
  • A pattern across reflections becomes a skill (skill create, security review safe); fact trace + fact conflict get give the audit trail. Plus a local web UI

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/reflexion-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

Reflection retrieval strategy?

Configurable — by recency, similarity, or task taxonomy.

Reflection pruning over time?

Configurable retention with promotion rules.

Self-host?

Yes — enterprise tier deploys in your VPC.