mango-brain 3.2.0__tar.gz → 3.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. mango_brain-3.2.1/PKG-INFO +276 -0
  2. mango_brain-3.2.1/README.md +249 -0
  3. mango_brain-3.2.1/mango_brain.egg-info/PKG-INFO +276 -0
  4. {mango_brain-3.2.0 → mango_brain-3.2.1}/pyproject.toml +2 -2
  5. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/cli.py +7 -0
  6. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/rules/mangobrain-workflow.md +8 -0
  7. mango_brain-3.2.0/PKG-INFO +0 -364
  8. mango_brain-3.2.0/README.md +0 -337
  9. mango_brain-3.2.0/mango_brain.egg-info/PKG-INFO +0 -364
  10. {mango_brain-3.2.0 → mango_brain-3.2.1}/mango_brain.egg-info/SOURCES.txt +0 -0
  11. {mango_brain-3.2.0 → mango_brain-3.2.1}/mango_brain.egg-info/dependency_links.txt +0 -0
  12. {mango_brain-3.2.0 → mango_brain-3.2.1}/mango_brain.egg-info/entry_points.txt +0 -0
  13. {mango_brain-3.2.0 → mango_brain-3.2.1}/mango_brain.egg-info/requires.txt +0 -0
  14. {mango_brain-3.2.0 → mango_brain-3.2.1}/mango_brain.egg-info/top_level.txt +0 -0
  15. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/__init__.py +0 -0
  16. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/__main__.py +0 -0
  17. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/agents/analyzer.md +0 -0
  18. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/agents/executor.md +0 -0
  19. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/agents/mem-manager.md +0 -0
  20. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/agents/verifier.md +0 -0
  21. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/api_routes.py +0 -0
  22. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/config.py +0 -0
  23. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/dashboard_dist/assets/index-B2dCBdj5.js +0 -0
  24. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/dashboard_dist/assets/index-C9E5pXFt.css +0 -0
  25. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/dashboard_dist/favicon.svg +0 -0
  26. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/dashboard_dist/icons.svg +0 -0
  27. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/dashboard_dist/index.html +0 -0
  28. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/database.py +0 -0
  29. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/decay.py +0 -0
  30. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/embeddings.py +0 -0
  31. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/graph.py +0 -0
  32. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/jsonl_parser.py +0 -0
  33. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/main.py +0 -0
  34. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/mangobrain.default.toml +0 -0
  35. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/mcp_tools.py +0 -0
  36. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/models.py +0 -0
  37. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/prompts/init/01-doc-base.md +0 -0
  38. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/prompts/init/02-code-base.md +0 -0
  39. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/prompts/init/03-event-base.md +0 -0
  40. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/prompts/init/04-chat-base.md +0 -0
  41. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/prompts/init/05-elaborate-base.md +0 -0
  42. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/prompts/reference/memory-definition.md +0 -0
  43. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/retrieval.py +0 -0
  44. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/rules/mangobrain-remember.md +0 -0
  45. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/skills/brain-init/SKILL.md +0 -0
  46. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/skills/discuss/SKILL.md +0 -0
  47. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/skills/elaborate/SKILL.md +0 -0
  48. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/skills/health-check/SKILL.md +0 -0
  49. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/skills/memorize/SKILL.md +0 -0
  50. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/skills/smoke-test/SKILL.md +0 -0
  51. {mango_brain-3.2.0 → mango_brain-3.2.1}/server/skills/task/SKILL.md +0 -0
  52. {mango_brain-3.2.0 → mango_brain-3.2.1}/setup.cfg +0 -0
  53. {mango_brain-3.2.0 → mango_brain-3.2.1}/tests/test_core.py +0 -0
  54. {mango_brain-3.2.0 → mango_brain-3.2.1}/tests/test_init.py +0 -0
  55. {mango_brain-3.2.0 → mango_brain-3.2.1}/tests/test_phase2.py +0 -0
  56. {mango_brain-3.2.0 → mango_brain-3.2.1}/tests/test_setup.py +0 -0
@@ -0,0 +1,276 @@
1
+ Metadata-Version: 2.4
2
+ Name: mango-brain
3
+ Version: 3.2.1
4
+ Summary: The learning layer for Claude Code — persistent associative memory + development workflow. Claude Code gets smarter the longer you use it.
5
+ Author-email: Federico Anastasi <federico.anastasi@outlook.com>
6
+ License: MIT
7
+ Requires-Python: >=3.11
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: fastapi>=0.110
10
+ Requires-Dist: uvicorn>=0.27
11
+ Requires-Dist: mcp>=1.0
12
+ Requires-Dist: aiosqlite>=0.19
13
+ Requires-Dist: numpy>=1.26
14
+ Requires-Dist: pydantic>=2.6
15
+ Requires-Dist: python-dotenv>=1.0
16
+ Requires-Dist: tiktoken>=0.6
17
+ Provides-Extra: embeddings
18
+ Requires-Dist: torch>=2.2; extra == "embeddings"
19
+ Requires-Dist: sentence-transformers>=2.5; extra == "embeddings"
20
+ Requires-Dist: scipy>=1.12; extra == "embeddings"
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=8.0; extra == "dev"
23
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
24
+ Requires-Dist: torch>=2.2; extra == "dev"
25
+ Requires-Dist: sentence-transformers>=2.5; extra == "dev"
26
+ Requires-Dist: scipy>=1.12; extra == "dev"
27
+
28
+ <p align="center">
29
+ <img src="assets/logo.svg" alt="MangoBrain" width="80" />
30
+ </p>
31
+
32
+ <h1 align="center">MangoBrain</h1>
33
+
34
+ <p align="center">
35
+ <strong>The learning layer for Claude Code</strong>
36
+ </p>
37
+
38
+ <p align="center">
39
+ <em>Claude Code gets smarter the longer you use it.</em><br/>
40
+ <sub>Plan with <code>/discuss</code>. Execute with <code>/task</code>. Knowledge saves itself.</sub>
41
+ </p>
42
+
43
+ <p align="center">
44
+ <a href="https://pypi.org/project/mangobrain/"><img src="https://img.shields.io/pypi/v/mangobrain?style=flat-square&color=7c3aed&label=PyPI" /></a>
45
+ <img src="https://img.shields.io/badge/python-3.11+-blue?style=flat-square&logo=python&logoColor=white" />
46
+ <img src="https://img.shields.io/badge/MCP-compatible-8A2BE2?style=flat-square" />
47
+ <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" />
48
+ </p>
49
+
50
+ <p align="center">
51
+ <a href="https://mangobrain.dev">Website</a> · <a href="#getting-started">Install</a> · <a href="https://pypi.org/project/mangobrain/">PyPI</a>
52
+ </p>
53
+
54
+ ---
55
+
56
+ **Session 1:** You tell Claude that prices must be stored in cents, not euros.
57
+ **Session 47:** Claude is about to write price logic. MangoBrain surfaces the memory. Claude already knows.
58
+
59
+ **No manual saving. No tagging.** The mem-manager captures knowledge at session close. The analyzer and verifier recall it when it matters.
60
+
61
+ ---
62
+
63
+ ## Why this exists
64
+
65
+ I build side projects at night after my day job. Claude Code is my pair-programmer, but every new session starts from scratch.
66
+
67
+ I tried the obvious approach first — `CLAUDE.md` files, rules, detailed docs. Anything to give Claude context. It works, until it doesn't. Files get stale. You forget to update them. Claude reads 500 lines of instructions but misses the one thing that matters for *this* specific task. And when the project grows, maintaining those files becomes a project in itself.
68
+
69
+ Then I tried memory MCP servers. They store things, but you're back to manual work — deciding what to save, writing explicit prompts to recall, maintaining yet another system on top of your code.
70
+
71
+ So I built what I actually needed: a system where memory handles itself. You work normally — plan with `/discuss`, execute with `/task` — and knowledge accumulates automatically. The mem-manager captures decisions, bugs, patterns at session close. The analyzer and verifier recall them when relevant. Zero effort from you.
72
+
73
+ After 500+ memories across two real projects, session 50 is genuinely better than session 1.
74
+
75
+ ---
76
+
77
+ ## How it works
78
+
79
+ ```mermaid
80
+ flowchart LR
81
+ DISCUSS["/discuss\nPlan with memory"] -->|task.md| TASK["/task"]
82
+
83
+ subgraph agents ["4 specialized agents"]
84
+ direction TB
85
+ ANALYZER["Analyzer\nExplores code + recalls memory"]
86
+ EXECUTOR["Executor\nWrites code — no memory, 100% focused"]
87
+ VERIFIER["Verifier\nQA + checks known issues"]
88
+ MEMMGR["Mem-manager\nCaptures knowledge at close"]
89
+ end
90
+
91
+ TASK --> agents
92
+ MEMMGR -->|saves| MEMORY[("Memory")]
93
+ MEMORY -.->|"recalls"| ANALYZER
94
+ MEMORY -.->|"recalls"| VERIFIER
95
+ MEMORY -->|"next session"| DISCUSS
96
+ ```
97
+
98
+ **The closed loop:** work produces knowledge, knowledge improves work.
99
+
100
+ | Phase | What happens |
101
+ |-------|-------------|
102
+ | `/discuss` | You describe what to build. Claude recalls past decisions, known bugs, patterns. Analyzers explore the codebase *and* memory. Output: `task.md`. |
103
+ | `/task` | 4 agents execute with strict roles. The **analyzer** checks memory for gotchas. The **executor** writes code (no memory access — 100% focused). The **verifier** recalls known issues before shipping. |
104
+ | `close` | The **mem-manager** runs automatically. Captures decisions, bugs found, patterns learned. Zero effort. |
105
+ | `next session` | Memory surfaces relevant knowledge. The loop repeats — each cycle smarter than the last. |
106
+
107
+ ---
108
+
109
+ ## Getting started
110
+
111
+ ### 1. Install
112
+
113
+ ```bash
114
+ pip install mangobrain
115
+ ```
116
+
117
+ Lightweight install (~50MB). PyTorch and the embedding engine are installed in the next step, optimized for your hardware.
118
+
119
+ ### 2. Setup your project
120
+
121
+ ```bash
122
+ cd /path/to/your/project
123
+ mangobrain install
124
+ ```
125
+
126
+ Detects your GPU (NVIDIA CUDA) or defaults to CPU. Installs PyTorch, configures Claude Code with skills, agents, and rules.
127
+
128
+ ### 3. Start and initialize
129
+
130
+ ```bash
131
+ mangobrain serve --api
132
+ ```
133
+
134
+ Open http://localhost:3101 for the dashboard. Restart Claude Code to load the MCP server, then run `/brain-init` — a guided 14-step wizard that builds your project's initial memory from docs, code, and past sessions.
135
+
136
+ <details>
137
+ <summary>Or let Claude handle the setup</summary>
138
+
139
+ Open Claude Code in your project and paste:
140
+
141
+ ```
142
+ Install MangoBrain for this project.
143
+ IMPORTANT: Use Python 3.11 or higher. Check available versions first (python --version,
144
+ py -3.12 --version, python3.12 --version, etc.) and use the correct one for pip install.
145
+ Run: pip install mangobrain (using Python >= 3.11's pip)
146
+ Then run: mangobrain install
147
+ Then run: mangobrain serve --api (in background)
148
+ Then tell me to open http://localhost:3101 and to restart Claude Code.
149
+ After restart, I should run the brain-init skill to initialize memory.
150
+ ```
151
+
152
+ </details>
153
+
154
+ ---
155
+
156
+ ## Dashboard
157
+
158
+ A 7-page control center to monitor, query, and explore your project's memory.
159
+
160
+ <p align="center">
161
+ <img src="assets/dashboard-overview.png" alt="MangoBrain Dashboard" width="800" />
162
+ </p>
163
+
164
+ <details>
165
+ <summary>More screenshots</summary>
166
+
167
+ | | |
168
+ |---|---|
169
+ | ![Remember](assets/dashboard-remember.png) **Remember** — Query memories like Claude does | ![Graph](assets/dashboard-graph.png) **Graph** — Visualize memory connections |
170
+ | ![Memories](assets/dashboard-memories.png) **Memories** — Browse and inspect | ![Overview](assets/dashboard-overview.png) **Overview** — Health, metrics, growth |
171
+
172
+ </details>
173
+
174
+ ---
175
+
176
+ ## What's under the hood
177
+
178
+ <details>
179
+ <summary><strong>Memory model</strong></summary>
180
+
181
+ Every memory is 2-5 lines, English, atomic, self-contained. Three types with different decay rates:
182
+
183
+ | Type | Decay rate | What it stores | Lifespan |
184
+ |------|-----------|----------------|----------|
185
+ | **Episodic** | 0.01/day | Bugs, sessions, events | Fades in weeks |
186
+ | **Semantic** | 0.002/day | Architecture, decisions, patterns | Persists for months |
187
+ | **Procedural** | 0.001/day | Conventions, rules, how-tos | Nearly permanent |
188
+
189
+ Memories link through typed edges: `relates_to`, `depends_on`, `caused_by`, `co_occurs`, `contradicts`, `supersedes`. When a decision is updated, the old version gets automatically suppressed.
190
+
191
+ </details>
192
+
193
+ <details>
194
+ <summary><strong>Retrieval pipeline</strong></summary>
195
+
196
+ Three modes optimized for different moments:
197
+
198
+ | Mode | Results | When to use |
199
+ |------|---------|-------------|
200
+ | **Deep** | ~20, full graph propagation (α=0.3) | Session start, big picture planning |
201
+ | **Quick** | ~6, light propagation (α=0.15) | Mid-task targeted lookups |
202
+ | **Recent** | ~15, time-weighted + k-hop neighbors | WIP context, session resume |
203
+
204
+ Pipeline: embed query (BGE) → cosine similarity → apply decay scores → graph propagation (PageRank-style with signed edges) → knapsack selection (maximize relevance per token within budget).
205
+
206
+ </details>
207
+
208
+ <details>
209
+ <summary><strong>Skills & maintenance</strong></summary>
210
+
211
+ | Skill | Purpose | When |
212
+ |-------|---------|------|
213
+ | `/discuss` | Plan with memory context → produces `task.md` | Starting new work |
214
+ | `/task` | Execute with 4 agents + memory | Implementing features/fixes |
215
+ | `/memorize` | Manual session sync | Free sessions outside /task |
216
+ | `/brain-init` | Guided 14-step initialization | First time setup |
217
+ | `/elaborate` | Consolidate graph, build edges, resolve duplicates | Weekly |
218
+ | `/health-check` | Diagnose gaps, run targeted fixes | Monthly |
219
+ | `/smoke-test` | Test retrieval quality | After changes |
220
+
221
+ </details>
222
+
223
+ <details>
224
+ <summary><strong>MCP tools (15)</strong></summary>
225
+
226
+ `remember` · `memorize` · `update_memory` · `list_memories` · `extract_session` · `init_project` · `read_project_memory` · `prepare_elaboration` · `apply_elaboration` · `reinforce` · `decay` · `stats` · `diagnose` · `sync_codebase` · `setup_status`
227
+
228
+ </details>
229
+
230
+ <details>
231
+ <summary><strong>Configuration & CLI</strong></summary>
232
+
233
+ ```toml
234
+ # mangobrain.toml (optional — defaults work for most setups)
235
+
236
+ [database]
237
+ path = "~/.mangobrain/mangobrain.db"
238
+
239
+ [embedding]
240
+ model = "auto" # GPU → bge-large-en-v1.5 (1024d), CPU → bge-base-en-v1.5 (768d)
241
+ device = "auto" # auto-detects CUDA
242
+
243
+ [decay]
244
+ episodic = 0.01
245
+ semantic = 0.002
246
+ procedural = 0.001
247
+ ```
248
+
249
+ ```bash
250
+ mangobrain serve # MCP server (stdio)
251
+ mangobrain serve --api # REST API + dashboard on :3101
252
+ mangobrain serve --all # Both
253
+ mangobrain install # Full interactive setup
254
+ mangobrain init -p NAME # Initialize project in DB
255
+ mangobrain status -p NAME # Setup progress
256
+ mangobrain doctor # System health check
257
+ mangobrain dashboard # Open dashboard in browser
258
+ ```
259
+
260
+ </details>
261
+
262
+ ---
263
+
264
+ ## Requirements
265
+
266
+ - **Python** 3.11+
267
+ - **Claude Code** (Anthropic CLI)
268
+ - **GPU** optional — CUDA for best quality embeddings, CPU works fine
269
+
270
+ ---
271
+
272
+ <p align="center">
273
+ Built by <a href="https://github.com/Federico-Anastasi">Federico Anastasi</a>
274
+ <br/>
275
+ <sub>Because your AI pair-programmer shouldn't have amnesia.</sub>
276
+ </p>
@@ -0,0 +1,249 @@
1
+ <p align="center">
2
+ <img src="assets/logo.svg" alt="MangoBrain" width="80" />
3
+ </p>
4
+
5
+ <h1 align="center">MangoBrain</h1>
6
+
7
+ <p align="center">
8
+ <strong>The learning layer for Claude Code</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <em>Claude Code gets smarter the longer you use it.</em><br/>
13
+ <sub>Plan with <code>/discuss</code>. Execute with <code>/task</code>. Knowledge saves itself.</sub>
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="https://pypi.org/project/mangobrain/"><img src="https://img.shields.io/pypi/v/mangobrain?style=flat-square&color=7c3aed&label=PyPI" /></a>
18
+ <img src="https://img.shields.io/badge/python-3.11+-blue?style=flat-square&logo=python&logoColor=white" />
19
+ <img src="https://img.shields.io/badge/MCP-compatible-8A2BE2?style=flat-square" />
20
+ <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" />
21
+ </p>
22
+
23
+ <p align="center">
24
+ <a href="https://mangobrain.dev">Website</a> · <a href="#getting-started">Install</a> · <a href="https://pypi.org/project/mangobrain/">PyPI</a>
25
+ </p>
26
+
27
+ ---
28
+
29
+ **Session 1:** You tell Claude that prices must be stored in cents, not euros.
30
+ **Session 47:** Claude is about to write price logic. MangoBrain surfaces the memory. Claude already knows.
31
+
32
+ **No manual saving. No tagging.** The mem-manager captures knowledge at session close. The analyzer and verifier recall it when it matters.
33
+
34
+ ---
35
+
36
+ ## Why this exists
37
+
38
+ I build side projects at night after my day job. Claude Code is my pair-programmer, but every new session starts from scratch.
39
+
40
+ I tried the obvious approach first — `CLAUDE.md` files, rules, detailed docs. Anything to give Claude context. It works, until it doesn't. Files get stale. You forget to update them. Claude reads 500 lines of instructions but misses the one thing that matters for *this* specific task. And when the project grows, maintaining those files becomes a project in itself.
41
+
42
+ Then I tried memory MCP servers. They store things, but you're back to manual work — deciding what to save, writing explicit prompts to recall, maintaining yet another system on top of your code.
43
+
44
+ So I built what I actually needed: a system where memory handles itself. You work normally — plan with `/discuss`, execute with `/task` — and knowledge accumulates automatically. The mem-manager captures decisions, bugs, patterns at session close. The analyzer and verifier recall them when relevant. Zero effort from you.
45
+
46
+ After 500+ memories across two real projects, session 50 is genuinely better than session 1.
47
+
48
+ ---
49
+
50
+ ## How it works
51
+
52
+ ```mermaid
53
+ flowchart LR
54
+ DISCUSS["/discuss\nPlan with memory"] -->|task.md| TASK["/task"]
55
+
56
+ subgraph agents ["4 specialized agents"]
57
+ direction TB
58
+ ANALYZER["Analyzer\nExplores code + recalls memory"]
59
+ EXECUTOR["Executor\nWrites code — no memory, 100% focused"]
60
+ VERIFIER["Verifier\nQA + checks known issues"]
61
+ MEMMGR["Mem-manager\nCaptures knowledge at close"]
62
+ end
63
+
64
+ TASK --> agents
65
+ MEMMGR -->|saves| MEMORY[("Memory")]
66
+ MEMORY -.->|"recalls"| ANALYZER
67
+ MEMORY -.->|"recalls"| VERIFIER
68
+ MEMORY -->|"next session"| DISCUSS
69
+ ```
70
+
71
+ **The closed loop:** work produces knowledge, knowledge improves work.
72
+
73
+ | Phase | What happens |
74
+ |-------|-------------|
75
+ | `/discuss` | You describe what to build. Claude recalls past decisions, known bugs, patterns. Analyzers explore the codebase *and* memory. Output: `task.md`. |
76
+ | `/task` | 4 agents execute with strict roles. The **analyzer** checks memory for gotchas. The **executor** writes code (no memory access — 100% focused). The **verifier** recalls known issues before shipping. |
77
+ | `close` | The **mem-manager** runs automatically. Captures decisions, bugs found, patterns learned. Zero effort. |
78
+ | `next session` | Memory surfaces relevant knowledge. The loop repeats — each cycle smarter than the last. |
79
+
80
+ ---
81
+
82
+ ## Getting started
83
+
84
+ ### 1. Install
85
+
86
+ ```bash
87
+ pip install mangobrain
88
+ ```
89
+
90
+ Lightweight install (~50MB). PyTorch and the embedding engine are installed in the next step, optimized for your hardware.
91
+
92
+ ### 2. Setup your project
93
+
94
+ ```bash
95
+ cd /path/to/your/project
96
+ mangobrain install
97
+ ```
98
+
99
+ Detects your GPU (NVIDIA CUDA) or defaults to CPU. Installs PyTorch, configures Claude Code with skills, agents, and rules.
100
+
101
+ ### 3. Start and initialize
102
+
103
+ ```bash
104
+ mangobrain serve --api
105
+ ```
106
+
107
+ Open http://localhost:3101 for the dashboard. Restart Claude Code to load the MCP server, then run `/brain-init` — a guided 14-step wizard that builds your project's initial memory from docs, code, and past sessions.
108
+
109
+ <details>
110
+ <summary>Or let Claude handle the setup</summary>
111
+
112
+ Open Claude Code in your project and paste:
113
+
114
+ ```
115
+ Install MangoBrain for this project.
116
+ IMPORTANT: Use Python 3.11 or higher. Check available versions first (python --version,
117
+ py -3.12 --version, python3.12 --version, etc.) and use the correct one for pip install.
118
+ Run: pip install mangobrain (using Python >= 3.11's pip)
119
+ Then run: mangobrain install
120
+ Then run: mangobrain serve --api (in background)
121
+ Then tell me to open http://localhost:3101 and to restart Claude Code.
122
+ After restart, I should run the brain-init skill to initialize memory.
123
+ ```
124
+
125
+ </details>
126
+
127
+ ---
128
+
129
+ ## Dashboard
130
+
131
+ A 7-page control center to monitor, query, and explore your project's memory.
132
+
133
+ <p align="center">
134
+ <img src="assets/dashboard-overview.png" alt="MangoBrain Dashboard" width="800" />
135
+ </p>
136
+
137
+ <details>
138
+ <summary>More screenshots</summary>
139
+
140
+ | | |
141
+ |---|---|
142
+ | ![Remember](assets/dashboard-remember.png) **Remember** — Query memories like Claude does | ![Graph](assets/dashboard-graph.png) **Graph** — Visualize memory connections |
143
+ | ![Memories](assets/dashboard-memories.png) **Memories** — Browse and inspect | ![Overview](assets/dashboard-overview.png) **Overview** — Health, metrics, growth |
144
+
145
+ </details>
146
+
147
+ ---
148
+
149
+ ## What's under the hood
150
+
151
+ <details>
152
+ <summary><strong>Memory model</strong></summary>
153
+
154
+ Every memory is 2-5 lines, English, atomic, self-contained. Three types with different decay rates:
155
+
156
+ | Type | Decay rate | What it stores | Lifespan |
157
+ |------|-----------|----------------|----------|
158
+ | **Episodic** | 0.01/day | Bugs, sessions, events | Fades in weeks |
159
+ | **Semantic** | 0.002/day | Architecture, decisions, patterns | Persists for months |
160
+ | **Procedural** | 0.001/day | Conventions, rules, how-tos | Nearly permanent |
161
+
162
+ Memories link through typed edges: `relates_to`, `depends_on`, `caused_by`, `co_occurs`, `contradicts`, `supersedes`. When a decision is updated, the old version gets automatically suppressed.
163
+
164
+ </details>
165
+
166
+ <details>
167
+ <summary><strong>Retrieval pipeline</strong></summary>
168
+
169
+ Three modes optimized for different moments:
170
+
171
+ | Mode | Results | When to use |
172
+ |------|---------|-------------|
173
+ | **Deep** | ~20, full graph propagation (α=0.3) | Session start, big picture planning |
174
+ | **Quick** | ~6, light propagation (α=0.15) | Mid-task targeted lookups |
175
+ | **Recent** | ~15, time-weighted + k-hop neighbors | WIP context, session resume |
176
+
177
+ Pipeline: embed query (BGE) → cosine similarity → apply decay scores → graph propagation (PageRank-style with signed edges) → knapsack selection (maximize relevance per token within budget).
178
+
179
+ </details>
180
+
181
+ <details>
182
+ <summary><strong>Skills & maintenance</strong></summary>
183
+
184
+ | Skill | Purpose | When |
185
+ |-------|---------|------|
186
+ | `/discuss` | Plan with memory context → produces `task.md` | Starting new work |
187
+ | `/task` | Execute with 4 agents + memory | Implementing features/fixes |
188
+ | `/memorize` | Manual session sync | Free sessions outside /task |
189
+ | `/brain-init` | Guided 14-step initialization | First time setup |
190
+ | `/elaborate` | Consolidate graph, build edges, resolve duplicates | Weekly |
191
+ | `/health-check` | Diagnose gaps, run targeted fixes | Monthly |
192
+ | `/smoke-test` | Test retrieval quality | After changes |
193
+
194
+ </details>
195
+
196
+ <details>
197
+ <summary><strong>MCP tools (15)</strong></summary>
198
+
199
+ `remember` · `memorize` · `update_memory` · `list_memories` · `extract_session` · `init_project` · `read_project_memory` · `prepare_elaboration` · `apply_elaboration` · `reinforce` · `decay` · `stats` · `diagnose` · `sync_codebase` · `setup_status`
200
+
201
+ </details>
202
+
203
+ <details>
204
+ <summary><strong>Configuration & CLI</strong></summary>
205
+
206
+ ```toml
207
+ # mangobrain.toml (optional — defaults work for most setups)
208
+
209
+ [database]
210
+ path = "~/.mangobrain/mangobrain.db"
211
+
212
+ [embedding]
213
+ model = "auto" # GPU → bge-large-en-v1.5 (1024d), CPU → bge-base-en-v1.5 (768d)
214
+ device = "auto" # auto-detects CUDA
215
+
216
+ [decay]
217
+ episodic = 0.01
218
+ semantic = 0.002
219
+ procedural = 0.001
220
+ ```
221
+
222
+ ```bash
223
+ mangobrain serve # MCP server (stdio)
224
+ mangobrain serve --api # REST API + dashboard on :3101
225
+ mangobrain serve --all # Both
226
+ mangobrain install # Full interactive setup
227
+ mangobrain init -p NAME # Initialize project in DB
228
+ mangobrain status -p NAME # Setup progress
229
+ mangobrain doctor # System health check
230
+ mangobrain dashboard # Open dashboard in browser
231
+ ```
232
+
233
+ </details>
234
+
235
+ ---
236
+
237
+ ## Requirements
238
+
239
+ - **Python** 3.11+
240
+ - **Claude Code** (Anthropic CLI)
241
+ - **GPU** optional — CUDA for best quality embeddings, CPU works fine
242
+
243
+ ---
244
+
245
+ <p align="center">
246
+ Built by <a href="https://github.com/Federico-Anastasi">Federico Anastasi</a>
247
+ <br/>
248
+ <sub>Because your AI pair-programmer shouldn't have amnesia.</sub>
249
+ </p>