Memory Layer is a persistent memory system for AI coding agents that learns from outcomes. It stores coding knowledge and automatically improves recommendations through feedback. When advice works it gets boosted, when it fails it gets penalized.
How it works
The system uses five weighted signals for retrieval: semantic similarity (35%), outcome scores (25%), recency (15%), frequency (15%) and extraction confidence (10%). Query patterns trigger category boosting. Troubleshooting queries get 1.5x weight for relevant categories.
Knowledge is organized into nine categories: architecture, convention, decision, pattern, gotcha, workaround, troubleshooting, command and preference.
Integration
Multiple interfaces are supported:
- Python SDK (async and synchronous clients for programmatic access)
- CLI (command-line tools for adding memories and searching)
- REST API (HTTP endpoints for remote access)
- MCP Server (multi-agent protocol for tool integration)
- Web UI (browser-based dashboard for management)
It connects with Claude Code via plugins with automatic hooks and slash commands. It also supports multi-agent setups with shared memory across Cursor, OpenCode and Windsurf.
Results
After 12 weeks of use, retrieval precision improved from 70% to 90%, with search latency under 150ms. All data stays local in SQLite at ~/.memory-layer/.