Persistent associative memory system for Claude Code โ complete development workflow
Project description
๐ง MangoBrain
A development system for Claude Code where every session learns from the last
Plan with /discuss. Execute with /task. Knowledge saves itself.
The Problem
Claude Code forgets everything between sessions. Every new conversation starts from zero โ you re-explain architecture, re-discover bugs, re-make decisions. The longer your project lives, the more you repeat yourself.
Memory MCP servers exist, but they're just databases. They store and retrieve. You still have to manually decide what to save, when to recall, and how to structure it. The memory doesn't participate in your workflow โ it sits next to it.
How MangoBrain Works
MangoBrain is not a memory store. It's a complete development workflow that builds memory as a side-effect of doing real work.
/discuss /task automatic
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Plan a featureโ โ Execute the plan โ โ mem-manager โ
โ โ โ โ โ saves what you โ
โ Claude starts โโโโโโโถโ analyzer explores โโโโโโโถโ learned, what โ
โ by recalling โ โ with memory โ โ broke, what โ
โ past decisionsโ โ executor codes โ โ decisions were โ
โ and known bugsโ โ verifier checks โ โ made โ without โ
โ โ โ known issues โ โ you doing โ
โ You plan โ โ โ โ anything โ
โ better. โ โ You ship faster. โ โ Next session โ
โ โ โ โ โ starts smarter. โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
Session 1: You tell Claude that prices must be stored in cents, not euros. Session 47: Claude is about to write price logic. The memory surfaces automatically. Claude already knows.
Session 3: A timezone bug costs you 2 hours debugging. Session 28: Claude touches date logic. The verifier recalls the timezone gotcha. The bug doesn't happen again.
This is the closed loop that no other tool provides: work โ capture โ recall โ better work.
How It's Different
Most tools give you a piece of the puzzle. MangoBrain is the whole puzzle.
| Memory Store | Workflow Framework | MangoBrain | |
|---|---|---|---|
| Mem0, Official MCP, WhenMoon | Ruflo, Claude Pilot, cc-sdd | ||
| Remembers across sessions | โ | โ or basic | โ |
| Structured workflow | โ | โ | โ |
| Specialized agents | โ | Some | โ 4 agents with strict roles |
| Graph relationships | โ | โ | โ typed edges + propagation |
| Temporal decay | โ | โ | โ episodic/semantic/procedural |
| Contradicts & supersedes | โ | โ | โ outdated info auto-suppressed |
| Memory captures automatically | โ | โ | โ mem-manager at session close |
| Memory informs execution | โ | โ | โ analyzer + verifier query memory |
| Health monitoring | โ | โ | โ dashboard + diagnose + alerts |
The difference: other tools give you storage or structure. MangoBrain gives you a system where the verifier knows that bug #47 already happened, the analyzer starts with architectural context from 30 sessions ago, and the mem-manager captures what worked โ without you lifting a finger.
The Workflow
Daily cycle
/discuss โโโ /task โโโ knowledge saved automatically
โ โ โ
โ โ โผ
โ โ Next /discuss starts
โ โ with more context
โ โผ
โ 4 specialized agents:
โ โข analyzer (explores code + recalls memory)
โ โข executor (writes code โ 100% focused, no memory)
โ โข verifier (QA + checks past known issues)
โ โข mem-manager (saves everything at close)
โ
โผ
Produces task.md โ fed into /task
/discuss โ Plan with memory
You describe what you want to build. Claude recalls past decisions, known bugs, architectural patterns. Analyzer agents explore the codebase and query memory for relevant gotchas. You plan with full context. Output: a task.md ready for execution.
/task โ Execute with agents
Claude reads the task, spawns analyzers (code + memory), creates a plan, then sends executors to write code. The verifier checks the result and queries memory for known issues in the areas touched. At close, the mem-manager captures everything learned.
/memorize โ Manual save (free sessions)
For sessions outside the discussโtask cycle. Spawns the mem-manager to extract and save what happened.
Maintenance
| Skill | When | What it does |
|---|---|---|
/elaborate |
Weekly | Consolidates memory: builds graph edges, finds contradictions, creates abstractions |
/health-check |
Monthly | Diagnoses memory health, finds content gaps, runs targeted fixes |
/smoke-test |
After changes | Tests retrieval quality with 10-20 diverse queries |
Under the Hood
The memory engine isn't a simple vector database. It has three layers that work together:
๐ Retrieval โ Three modes for different moments
| Mode | Results | Graph | When |
|---|---|---|---|
| Deep | ~20 | Full propagation (ฮฑ=0.3) | Session start, big picture |
| Quick | ~6 | Light propagation (ฮฑ=0.15) | Mid-task lookups |
| Recent | ~15 | Time-weighted | WIP context, session resume |
The retrieval pipeline: cosine similarity โ graph propagation (PageRank-style) โ knapsack selection (optimize relevance per token).
๐ธ๏ธ Graph โ Memories are connected, not flat
Every memory can relate to others through typed edges:
| Edge | Direction | Effect in retrieval |
|---|---|---|
relates_to |
bidirectional | mutual boost |
depends_on |
A โ B | A boosts B |
caused_by |
A โ B | A boosts B |
co_occurs |
bidirectional | mutual boost |
contradicts |
bidirectional | suppresses the weaker one |
supersedes |
A โ B | suppresses the old version |
This means: when a decision is updated, the old version doesn't just sit there confusing Claude โ it gets automatically suppressed.
โณ Decay โ Not all memories age equally
| Type | Decay rate | Example |
|---|---|---|
| Episodic | Fast (0.01/day) | "Bug X happened on Tuesday" |
| Semantic | Slow (0.002/day) | "This module uses the strategy pattern" |
| Procedural | Very slow (0.001/day) | "Always use cents, never euros" |
Bug reports fade. Architecture decisions persist. Conventions stick around forever.
๐งฉ MCP Tools (14 available)
| Tool | Description |
|---|---|
remember |
Retrieve memories (deep/quick/recent) |
memorize |
Save new memories with embeddings |
update_memory |
Modify content, tags, deprecate |
extract_session |
Parse Claude Code chat JSONL |
prepare_elaboration |
Build working set for elaboration |
apply_elaboration |
Apply elaboration updates |
sync_codebase |
Detect stale/orphan memories |
diagnose |
Health score + prescriptions |
setup_status |
Track initialization progress |
stats |
System statistics |
list_memories |
Search/filter with pagination |
reinforce |
Boost edge weights |
decay |
Apply temporal decay |
init_project |
Bootstrap project metadata |
Dashboard
A visual control center with 6 pages:
| Page | Purpose |
|---|---|
| Overview | Health score, memory growth timeline, setup status, alerts |
| Setup | Step-by-step initialization wizard with progress tracking |
| Memories | Browse, search, filter, inspect individual memories |
| Graph | Force-directed visualization of the memory network |
| Monitoring | Health breakdown, prescriptions, elaboration history |
| Guide | Complete in-app documentation |
Quick Start
Requirements
- Python 3.11+
- Claude Code (Anthropic CLI)
Option A โ Let Claude do everything
Open Claude Code in your project and paste this:
Install MangoBrain for this project.
IMPORTANT: Use Python 3.11 or higher. Check available versions first (python --version,
py -3.12 --version, python3.12 --version, etc.) and use the correct one for pip install.
Run: pip install mango-brain (using Python >= 3.11's pip)
Then run: mango-brain install
Then run: mango-brain serve --api (in background)
Then tell me to open http://localhost:3101 and to restart Claude Code.
After restart, I should run /brain-init.
Option B โ Do it yourself
pip install mango-brain
cd /path/to/your/project
mango-brain install
mango-brain serve --api
What mango-brain install does
- Detects your GPU and installs the right PyTorch (CUDA or CPU)
- Installs skills, agents, rules, and prompts into
.claude/ - Configures
.mcp.jsonfor Claude Code - Updates
CLAUDE.mdwith MangoBrain documentation - Registers the project in the MangoBrain database
After install
- Open http://localhost:3101 โ the dashboard tracks your progress live
- Restart Claude Code to load the MCP server
- Run
/brain-initโ the wizard guides you through memory initialization
The /brain-init wizard guides you through 14 steps across 7 phases:
| Phase | What it does | Sessions |
|---|---|---|
| 1. Doc Base | Extracts memories from CLAUDE.md, rules, and documentation | 1 |
| 2. Code Base | Parallel agents scan the codebase for patterns and architecture | 1-2 |
| 3. Event Base | Imports existing knowledge (task lists, project docs) โ optional | 1 |
| 4. Chat Base | Extracts knowledge from past Claude Code sessions (JSONL) | 1-3 |
| 5. Elaborate | Builds the memory graph: edges, contradictions, abstractions | 1-2 |
| 6. Smoke Test | 10-20 diverse queries to verify retrieval quality | 1 |
| 7. Health Check | Diagnoses gaps, runs targeted fixes, validates final state | 1 |
Note: Each phase runs in a separate Claude Code session (for fresh context). The wizard tells you exactly when to restart and what to do next. Progress is tracked automatically โ if you stop mid-way,
/brain-initpicks up where you left off. Watch the dashboard update in real-time as memories are created and connected.
When the dashboard shows "Memory Ready", initialization is complete.
After that, your daily workflow is simply: /discuss โ /task โ repeat.
Configuration
# mangobrain.toml
[embedding]
model = "auto" # GPU โ bge-large (1024d), CPU โ bge-base (768d)
device = "auto" # auto-detects CUDA
[retrieval]
deep_threshold = 0.78
quick_threshold = 0.85
[decay]
episodic = 0.01 # fast
semantic = 0.002 # medium
procedural = 0.001 # slow
CLI
mango-brain serve # MCP server (stdio)
mango-brain serve --api # API + dashboard
mango-brain serve --all # Both
mango-brain init -p NAME --path PATH # Initialize project
mango-brain install --path PATH # Install skills/agents/rules
mango-brain status -p NAME # Setup progress
mango-brain doctor # System health check
mango-brain dashboard # Open dashboard in browser
Requirements
- Python 3.11+
- PyTorch 2.2+ (GPU optional โ CPU works fine)
- Node.js 18+ (for dashboard build)
Project Structure
mangobrain/
โโโ server/ # Python MCP server + REST API
โโโ dashboard/ # React 19 + Vite + Tailwind
โโโ skills/ # 7 skills (/discuss, /task, /brain-init, /memorize, /elaborate, /health-check, /smoke-test)
โโโ agents/ # 4 agent prompts (analyzer, executor, verifier, mem-manager)
โโโ rules/ # 2 auto-loaded rules (query strategy, workflow integration)
โโโ prompts/ # Init phase instructions + memory quality reference
โโโ tests/ # Test suite
โโโ mangobrain.toml # Configuration
โโโ pyproject.toml # Python package
Built by Mango
Because your AI pair-programmer shouldn't have amnesia.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mango_brain-3.1.1.tar.gz.
File metadata
- Download URL: mango_brain-3.1.1.tar.gz
- Upload date:
- Size: 410.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
980984a4021e82104106e1e6bafa36af758845cb73417dfb71a82f8e95695e64
|
|
| MD5 |
b93c354009a6df5b4934dbdb0fd72639
|
|
| BLAKE2b-256 |
b36594af612cdacd4295374d055c447cbba67be3819838b9d6b80642e05d2610
|
File details
Details for the file mango_brain-3.1.1-py3-none-any.whl.
File metadata
- Download URL: mango_brain-3.1.1-py3-none-any.whl
- Upload date:
- Size: 418.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a81d8e22857bb854d5d22cc0c0c0d61e63c50e60a733e263434caeaf931fcc
|
|
| MD5 |
8c94872fc98b42aeaddbc11b5a56f2c8
|
|
| BLAKE2b-256 |
b7740bc68360f8cdcf0f7cf25c66d9d5caa61d690f0d4ce8084c21f453f9d1ea
|