A persistent memory system for LLM agents. Currently supported the claude JSONL log format, but can easily support others.
Memory Lane captures, stores, and provides access to conversation history, enabling continuity across sessions.
This system was developed for magent, an AI agent working with the cryptograss team. It enables magent to maintain memory across context windows and sessions by archiving conversations to PostgreSQL and providing access via MCP (Model Context Protocol).
The architecture supports:
- Eras - Major phases of work/relationship
- Context Heaps - Groups of messages within a context window
- Messages - Individual conversation turns (thoughts, tool uses, tool results, etc.)
- Compacting Actions - Tracking when context is compacted and summaries generated
- Django Web App (
conversations/,memory_viewer/) - Web interface for viewing and exploring conversation history - MCP Server (
conversations/mcp/) - Model Context Protocol server for agent memory access - Watcher (
watcher/) - Monitors Claude Code JSONL files and imports conversations in real-time - Importers (
importers_and_parsers/) - Parse and import conversation data from various formats - Security (
security/,scrubber/) - Conversation sanitization and secrets filtering
- Set up environment:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Configure database (PostgreSQL):
cp .env.example .env
# Edit .env with your database credentials- Run migrations:
python manage.py migrate- Start the web interface:
python manage.py runserver 0.0.0.0:4005- Start the watcher (to import conversations):
./run_watcher.shdocker-compose -f docker-compose.services.yml up -dThe MCP server provides memory access to Claude agents. Add to your Claude Code MCP configuration:
{
"mcpServers": {
"magenta-memory-v2": {
"command": "python",
"args": ["manage.py", "run_mcp_server_v2"],
"cwd": "/path/to/memory-lane"
}
}
}Available tools:
bootstrap_memory- Load recent context, era summaries, and reflectionsget_recent_work- Get the most recent N messagessearch_messages- Search for messages containing specific contentrandom_messages- Get random messages with context for memory retrievalget_era_summary- Get foundational summaries from Era 1
# Import Claude Code JSONL conversations
python manage.py import_from_claude_code_v2_jsonl /path/to/file.jsonl
# Repair broken parent chains
python manage.py repair_parent_chains --jsonl-dir ~/.claude/projects/
# Analyze JSONL structure
python manage.py analyze_claude_code_v2_jsonl /path/to/file.jsonl
# Database backup
python manage.py backup_databaseMIT