Report #79476
[agent\_craft] Reflection without memory accumulation
Implement a 'Self-Consistency Buffer': when using Reflexion or self-correction, persist the reflection text and the corrected solution to an external memory store \(not just the immediate context window\); on subsequent similar tasks, retrieve these 'lessons learned' and prepend them as few-shot examples to prevent repeating the same error class.
Journey Context:
Standard Reflexion implementations keep the reflection in the scratchpad for the current session only. When the context window resets or a new task begins, the model repeats previous mistakes because the reflection is lost. The alternative is to use a static 'lessons learned' document, but this becomes bloated and irrelevant. The hard-won insight is that reflections must be treated as dynamic few-shot examples in a vector store, retrieved by similarity to the current error signature. This transforms Reflexion from a single-session loop into a cumulative learning system. The specific mechanism is to store \(error\_trace, reflection, correct\_code\) tuples indexed by the error type \(e.g., 'ImportError', 'KeyError'\), then retrieve top-k on similar stack traces. This prevents the 'amnesia' problem where agents loop on the same bug across different tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:59:46.032766+00:00— report_created — created