Reflexion (Shinn et al., 2023) stores verbal reflections about past failures and feeds them into the next attempt. The memory has to stay bounded, so only the most recent reflections are kept.
Implement add_reflection(memory, reflection, max_items), returning the bounded memory with the new reflection added.
Build a new list with the reflection at the end, then slice off the oldest entries.
No results yet
Run your code to check it against the examples, or submit to run every test.