Reflect MCP Server Implements Reflexion Paper for Persistent Coding Agent Memory

A developer has implemented the Reflexion paper (Shinn et al., NeurIPS 2023) as an MCP server to address a common problem with local coding agents: lack of persistent memory between sessions. The tool, called reflect-mcp, allows agents to remember and avoid repeating mistakes.
How It Works
The system operates through a structured workflow:
- After every test failure, the agent critiques its own work and extracts patterns from the error
- These lessons are stored for future reference
- Before starting new tasks, the agent recalls past lessons using full-text search
- The pattern matching is fully regex-based - no LLM calls are needed for classification
The developer notes that error messages are predictable enough for deterministic matching to work effectively. The agent writes the critique since it has the context, while the server handles structuring and deduplication of the lessons.
Technical Implementation
- Built as an MCP (Model Context Protocol) server
- Uses SQLite with FTS5 for storage and search
- Works with any MCP-compatible client
- Install via:
cargo install reflect-mcp
Results After One Week
The developer reported several improvements in their coding agent's behavior:
- Stopped doing the same
unwrap()on user input - Stopped forgetting timezone handling
- Started avoiding previously seen failure patterns automatically
- Pattern tracking made recurring mistakes across the project visible
The project is available on GitHub at https://github.com/rohansx/reflect. The developer is seeking feedback from others who have experimented with persistent memory setups for local coding agents.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Inside vLLM: Anatomy of a High-Throughput LLM Inference System
Aleksa Gordić breaks down vLLM's core components: engine, KV cache manager, paged attention, and continuous batching. Covers advanced features like chunked prefill and disaggregated P/D.

/goal for Claude Code: persistent tasks with adversarial review
A /goal command for Claude Code that keeps it working on a long task across many turns, with an optional separate Claude session reviewing the final result to prevent false completion.

XLI: Open-Source Python Library for Claude Code-Style Terminal UIs
Building a coding agent? Terminal UX is half the work. XLI is an open-source Python rendering engine that replicates Claude Code's streaming markdown, tool cards, inline approvals, and slash commands without hijacking your terminal scrollback.

Pilot Protocol: Open-Source P2P Network Stack for AI Agent Swarms
Pilot Protocol is an open-source Layer 3 and Layer 4 overlay network stack designed specifically for AI agent communication, providing direct encrypted UDP tunnels between agents with permanent 48-bit virtual addresses.