mango-brain 3.2.0__tar.gz → 3.2.2__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.2/PKG-INFO +262 -0
  2. mango_brain-3.2.2/README.md +235 -0
  3. mango_brain-3.2.2/mango_brain.egg-info/PKG-INFO +262 -0
  4. {mango_brain-3.2.0 → mango_brain-3.2.2}/pyproject.toml +2 -2
  5. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/cli.py +7 -0
  6. {mango_brain-3.2.0 → mango_brain-3.2.2}/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.2}/mango_brain.egg-info/SOURCES.txt +0 -0
  11. {mango_brain-3.2.0 → mango_brain-3.2.2}/mango_brain.egg-info/dependency_links.txt +0 -0
  12. {mango_brain-3.2.0 → mango_brain-3.2.2}/mango_brain.egg-info/entry_points.txt +0 -0
  13. {mango_brain-3.2.0 → mango_brain-3.2.2}/mango_brain.egg-info/requires.txt +0 -0
  14. {mango_brain-3.2.0 → mango_brain-3.2.2}/mango_brain.egg-info/top_level.txt +0 -0
  15. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/__init__.py +0 -0
  16. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/__main__.py +0 -0
  17. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/agents/analyzer.md +0 -0
  18. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/agents/executor.md +0 -0
  19. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/agents/mem-manager.md +0 -0
  20. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/agents/verifier.md +0 -0
  21. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/api_routes.py +0 -0
  22. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/config.py +0 -0
  23. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/dashboard_dist/assets/index-B2dCBdj5.js +0 -0
  24. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/dashboard_dist/assets/index-C9E5pXFt.css +0 -0
  25. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/dashboard_dist/favicon.svg +0 -0
  26. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/dashboard_dist/icons.svg +0 -0
  27. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/dashboard_dist/index.html +0 -0
  28. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/database.py +0 -0
  29. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/decay.py +0 -0
  30. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/embeddings.py +0 -0
  31. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/graph.py +0 -0
  32. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/jsonl_parser.py +0 -0
  33. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/main.py +0 -0
  34. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/mangobrain.default.toml +0 -0
  35. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/mcp_tools.py +0 -0
  36. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/models.py +0 -0
  37. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/prompts/init/01-doc-base.md +0 -0
  38. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/prompts/init/02-code-base.md +0 -0
  39. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/prompts/init/03-event-base.md +0 -0
  40. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/prompts/init/04-chat-base.md +0 -0
  41. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/prompts/init/05-elaborate-base.md +0 -0
  42. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/prompts/reference/memory-definition.md +0 -0
  43. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/retrieval.py +0 -0
  44. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/rules/mangobrain-remember.md +0 -0
  45. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/skills/brain-init/SKILL.md +0 -0
  46. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/skills/discuss/SKILL.md +0 -0
  47. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/skills/elaborate/SKILL.md +0 -0
  48. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/skills/health-check/SKILL.md +0 -0
  49. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/skills/memorize/SKILL.md +0 -0
  50. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/skills/smoke-test/SKILL.md +0 -0
  51. {mango_brain-3.2.0 → mango_brain-3.2.2}/server/skills/task/SKILL.md +0 -0
  52. {mango_brain-3.2.0 → mango_brain-3.2.2}/setup.cfg +0 -0
  53. {mango_brain-3.2.0 → mango_brain-3.2.2}/tests/test_core.py +0 -0
  54. {mango_brain-3.2.0 → mango_brain-3.2.2}/tests/test_init.py +0 -0
  55. {mango_brain-3.2.0 → mango_brain-3.2.2}/tests/test_phase2.py +0 -0
  56. {mango_brain-3.2.0 → mango_brain-3.2.2}/tests/test_setup.py +0 -0
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.4
2
+ Name: mango-brain
3
+ Version: 3.2.2
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/v3.2.2-7c3aed?style=flat-square" />
46
+ <img src="https://img.shields.io/badge/python-3.11+-blue?style=flat-square&logo=python&logoColor=white" />
47
+ <img src="https://img.shields.io/badge/MCP-compatible-8A2BE2?style=flat-square" />
48
+ <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" />
49
+ </p>
50
+
51
+ <p align="center">
52
+ <a href="https://mangobrain.dev">Website</a> · <a href="#getting-started">Install</a> · <a href="https://pypi.org/project/mangobrain/">PyPI</a>
53
+ </p>
54
+
55
+ ---
56
+
57
+ **Session 1:** You tell Claude that prices must be stored in cents, not euros.
58
+ **Session 47:** Claude is about to write price logic. MangoBrain surfaces the memory. Claude already knows.
59
+
60
+ **No manual saving. No tagging.** The mem-manager captures knowledge at session close. The analyzer and verifier recall it when it matters.
61
+
62
+ ---
63
+
64
+ ## Why this exists
65
+
66
+ I build side projects at night after my day job. Claude Code is my pair-programmer, but every new session starts from scratch.
67
+
68
+ 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.
69
+
70
+ 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.
71
+
72
+ 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.
73
+
74
+ After 500+ memories across two real projects, session 50 is genuinely better than session 1.
75
+
76
+ ---
77
+
78
+ ## How it works
79
+
80
+ <p align="center">
81
+ <img src="assets/workflow.svg" alt="MangoBrain Workflow" width="800" />
82
+ </p>
83
+
84
+ | | What happens | Codebase | Memory |
85
+ |---|---|---|---|
86
+ | **`/discuss`** | You explain the task. Claude explores code, recalls past decisions, brainstorms with full context. Output: `task.md`. | reads | reads |
87
+ | **Analyzer** | Deep analysis of the areas involved. Surfaces gotchas from memory before any code is written. | reads | reads |
88
+ | **Executor** | Writes code — 100% focused on implementation. No memory access by design. | writes | — |
89
+ | **Verifier** | Runs tests, checks quality, recalls known issues from memory before shipping. | reads | reads |
90
+ | **Mem-manager** | Captures decisions, bugs found, patterns learned. Zero effort from you. | — | **writes** |
91
+ | **Next session** | `/discuss` starts with everything the last cycle learned. The loop repeats — each cycle smarter. | | reads |
92
+
93
+ ---
94
+
95
+ ## Getting started
96
+
97
+ ### 1. Install
98
+
99
+ ```bash
100
+ pip install mangobrain
101
+ ```
102
+
103
+ Lightweight install (~50MB). PyTorch and the embedding engine are installed in the next step, optimized for your hardware.
104
+
105
+ ### 2. Setup your project
106
+
107
+ ```bash
108
+ cd /path/to/your/project
109
+ mangobrain install
110
+ ```
111
+
112
+ Detects your GPU (NVIDIA CUDA) or defaults to CPU. Installs PyTorch, configures Claude Code with skills, agents, and rules.
113
+
114
+ ### 3. Start and initialize
115
+
116
+ ```bash
117
+ mangobrain serve --api
118
+ ```
119
+
120
+ 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.
121
+
122
+ <details>
123
+ <summary>Or let Claude handle the setup</summary>
124
+
125
+ Open Claude Code in your project and paste:
126
+
127
+ ```
128
+ Install MangoBrain for this project.
129
+ IMPORTANT: Use Python 3.11 or higher. Check available versions first (python --version,
130
+ py -3.12 --version, python3.12 --version, etc.) and use the correct one for pip install.
131
+ Run: pip install mangobrain (using Python >= 3.11's pip)
132
+ Then run: mangobrain install
133
+ Then run: mangobrain serve --api (in background)
134
+ Then tell me to open http://localhost:3101 and to restart Claude Code.
135
+ After restart, I should run the brain-init skill to initialize memory.
136
+ ```
137
+
138
+ </details>
139
+
140
+ ---
141
+
142
+ ## Dashboard
143
+
144
+ A 7-page control center to monitor, query, and explore your project's memory.
145
+
146
+ <p align="center">
147
+ <img src="assets/dashboard-overview.png" alt="MangoBrain Dashboard" width="800" />
148
+ </p>
149
+
150
+ <details>
151
+ <summary>More screenshots</summary>
152
+
153
+ | | |
154
+ |---|---|
155
+ | ![Remember](assets/dashboard-remember.png) **Remember** — Query memories like Claude does | ![Graph](assets/dashboard-graph.png) **Graph** — Visualize memory connections |
156
+ | ![Memories](assets/dashboard-memories.png) **Memories** — Browse and inspect | ![Overview](assets/dashboard-overview.png) **Overview** — Health, metrics, growth |
157
+
158
+ </details>
159
+
160
+ ---
161
+
162
+ ## What's under the hood
163
+
164
+ <details>
165
+ <summary><strong>Memory model</strong></summary>
166
+
167
+ Every memory is 2-5 lines, English, atomic, self-contained. Three types with different decay rates:
168
+
169
+ | Type | Decay rate | What it stores | Lifespan |
170
+ |------|-----------|----------------|----------|
171
+ | **Episodic** | 0.01/day | Bugs, sessions, events | Fades in weeks |
172
+ | **Semantic** | 0.002/day | Architecture, decisions, patterns | Persists for months |
173
+ | **Procedural** | 0.001/day | Conventions, rules, how-tos | Nearly permanent |
174
+
175
+ 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.
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary><strong>Retrieval pipeline</strong></summary>
181
+
182
+ Three modes optimized for different moments:
183
+
184
+ | Mode | Results | When to use |
185
+ |------|---------|-------------|
186
+ | **Deep** | ~20, full graph propagation (α=0.3) | Session start, big picture planning |
187
+ | **Quick** | ~6, light propagation (α=0.15) | Mid-task targeted lookups |
188
+ | **Recent** | ~15, time-weighted + k-hop neighbors | WIP context, session resume |
189
+
190
+ Pipeline: embed query (BGE) → cosine similarity → apply decay scores → graph propagation (PageRank-style with signed edges) → knapsack selection (maximize relevance per token within budget).
191
+
192
+ </details>
193
+
194
+ <details>
195
+ <summary><strong>Skills & maintenance</strong></summary>
196
+
197
+ | Skill | Purpose | When |
198
+ |-------|---------|------|
199
+ | `/discuss` | Plan with memory context → produces `task.md` | Starting new work |
200
+ | `/task` | Execute with 4 agents + memory | Implementing features/fixes |
201
+ | `/memorize` | Manual session sync | Free sessions outside /task |
202
+ | `/brain-init` | Guided 14-step initialization | First time setup |
203
+ | `/elaborate` | Consolidate graph, build edges, resolve duplicates | Weekly |
204
+ | `/health-check` | Diagnose gaps, run targeted fixes | Monthly |
205
+ | `/smoke-test` | Test retrieval quality | After changes |
206
+
207
+ </details>
208
+
209
+ <details>
210
+ <summary><strong>MCP tools (15)</strong></summary>
211
+
212
+ `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`
213
+
214
+ </details>
215
+
216
+ <details>
217
+ <summary><strong>Configuration & CLI</strong></summary>
218
+
219
+ ```toml
220
+ # mangobrain.toml (optional — defaults work for most setups)
221
+
222
+ [database]
223
+ path = "~/.mangobrain/mangobrain.db"
224
+
225
+ [embedding]
226
+ model = "auto" # GPU → bge-large-en-v1.5 (1024d), CPU → bge-base-en-v1.5 (768d)
227
+ device = "auto" # auto-detects CUDA
228
+
229
+ [decay]
230
+ episodic = 0.01
231
+ semantic = 0.002
232
+ procedural = 0.001
233
+ ```
234
+
235
+ ```bash
236
+ mangobrain serve # MCP server (stdio)
237
+ mangobrain serve --api # REST API + dashboard on :3101
238
+ mangobrain serve --all # Both
239
+ mangobrain install # Full interactive setup
240
+ mangobrain init -p NAME # Initialize project in DB
241
+ mangobrain status -p NAME # Setup progress
242
+ mangobrain doctor # System health check
243
+ mangobrain dashboard # Open dashboard in browser
244
+ ```
245
+
246
+ </details>
247
+
248
+ ---
249
+
250
+ ## Requirements
251
+
252
+ - **Python** 3.11+
253
+ - **Claude Code** (Anthropic CLI)
254
+ - **GPU** optional — CUDA for best quality embeddings, CPU works fine
255
+
256
+ ---
257
+
258
+ <p align="center">
259
+ Built by <a href="https://github.com/Federico-Anastasi">Federico Anastasi</a>
260
+ <br/>
261
+ <sub>Because your AI pair-programmer shouldn't have amnesia.</sub>
262
+ </p>
@@ -0,0 +1,235 @@
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/v3.2.2-7c3aed?style=flat-square" />
19
+ <img src="https://img.shields.io/badge/python-3.11+-blue?style=flat-square&logo=python&logoColor=white" />
20
+ <img src="https://img.shields.io/badge/MCP-compatible-8A2BE2?style=flat-square" />
21
+ <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" />
22
+ </p>
23
+
24
+ <p align="center">
25
+ <a href="https://mangobrain.dev">Website</a> · <a href="#getting-started">Install</a> · <a href="https://pypi.org/project/mangobrain/">PyPI</a>
26
+ </p>
27
+
28
+ ---
29
+
30
+ **Session 1:** You tell Claude that prices must be stored in cents, not euros.
31
+ **Session 47:** Claude is about to write price logic. MangoBrain surfaces the memory. Claude already knows.
32
+
33
+ **No manual saving. No tagging.** The mem-manager captures knowledge at session close. The analyzer and verifier recall it when it matters.
34
+
35
+ ---
36
+
37
+ ## Why this exists
38
+
39
+ I build side projects at night after my day job. Claude Code is my pair-programmer, but every new session starts from scratch.
40
+
41
+ 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.
42
+
43
+ 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.
44
+
45
+ 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.
46
+
47
+ After 500+ memories across two real projects, session 50 is genuinely better than session 1.
48
+
49
+ ---
50
+
51
+ ## How it works
52
+
53
+ <p align="center">
54
+ <img src="assets/workflow.svg" alt="MangoBrain Workflow" width="800" />
55
+ </p>
56
+
57
+ | | What happens | Codebase | Memory |
58
+ |---|---|---|---|
59
+ | **`/discuss`** | You explain the task. Claude explores code, recalls past decisions, brainstorms with full context. Output: `task.md`. | reads | reads |
60
+ | **Analyzer** | Deep analysis of the areas involved. Surfaces gotchas from memory before any code is written. | reads | reads |
61
+ | **Executor** | Writes code — 100% focused on implementation. No memory access by design. | writes | — |
62
+ | **Verifier** | Runs tests, checks quality, recalls known issues from memory before shipping. | reads | reads |
63
+ | **Mem-manager** | Captures decisions, bugs found, patterns learned. Zero effort from you. | — | **writes** |
64
+ | **Next session** | `/discuss` starts with everything the last cycle learned. The loop repeats — each cycle smarter. | | reads |
65
+
66
+ ---
67
+
68
+ ## Getting started
69
+
70
+ ### 1. Install
71
+
72
+ ```bash
73
+ pip install mangobrain
74
+ ```
75
+
76
+ Lightweight install (~50MB). PyTorch and the embedding engine are installed in the next step, optimized for your hardware.
77
+
78
+ ### 2. Setup your project
79
+
80
+ ```bash
81
+ cd /path/to/your/project
82
+ mangobrain install
83
+ ```
84
+
85
+ Detects your GPU (NVIDIA CUDA) or defaults to CPU. Installs PyTorch, configures Claude Code with skills, agents, and rules.
86
+
87
+ ### 3. Start and initialize
88
+
89
+ ```bash
90
+ mangobrain serve --api
91
+ ```
92
+
93
+ 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.
94
+
95
+ <details>
96
+ <summary>Or let Claude handle the setup</summary>
97
+
98
+ Open Claude Code in your project and paste:
99
+
100
+ ```
101
+ Install MangoBrain for this project.
102
+ IMPORTANT: Use Python 3.11 or higher. Check available versions first (python --version,
103
+ py -3.12 --version, python3.12 --version, etc.) and use the correct one for pip install.
104
+ Run: pip install mangobrain (using Python >= 3.11's pip)
105
+ Then run: mangobrain install
106
+ Then run: mangobrain serve --api (in background)
107
+ Then tell me to open http://localhost:3101 and to restart Claude Code.
108
+ After restart, I should run the brain-init skill to initialize memory.
109
+ ```
110
+
111
+ </details>
112
+
113
+ ---
114
+
115
+ ## Dashboard
116
+
117
+ A 7-page control center to monitor, query, and explore your project's memory.
118
+
119
+ <p align="center">
120
+ <img src="assets/dashboard-overview.png" alt="MangoBrain Dashboard" width="800" />
121
+ </p>
122
+
123
+ <details>
124
+ <summary>More screenshots</summary>
125
+
126
+ | | |
127
+ |---|---|
128
+ | ![Remember](assets/dashboard-remember.png) **Remember** — Query memories like Claude does | ![Graph](assets/dashboard-graph.png) **Graph** — Visualize memory connections |
129
+ | ![Memories](assets/dashboard-memories.png) **Memories** — Browse and inspect | ![Overview](assets/dashboard-overview.png) **Overview** — Health, metrics, growth |
130
+
131
+ </details>
132
+
133
+ ---
134
+
135
+ ## What's under the hood
136
+
137
+ <details>
138
+ <summary><strong>Memory model</strong></summary>
139
+
140
+ Every memory is 2-5 lines, English, atomic, self-contained. Three types with different decay rates:
141
+
142
+ | Type | Decay rate | What it stores | Lifespan |
143
+ |------|-----------|----------------|----------|
144
+ | **Episodic** | 0.01/day | Bugs, sessions, events | Fades in weeks |
145
+ | **Semantic** | 0.002/day | Architecture, decisions, patterns | Persists for months |
146
+ | **Procedural** | 0.001/day | Conventions, rules, how-tos | Nearly permanent |
147
+
148
+ 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.
149
+
150
+ </details>
151
+
152
+ <details>
153
+ <summary><strong>Retrieval pipeline</strong></summary>
154
+
155
+ Three modes optimized for different moments:
156
+
157
+ | Mode | Results | When to use |
158
+ |------|---------|-------------|
159
+ | **Deep** | ~20, full graph propagation (α=0.3) | Session start, big picture planning |
160
+ | **Quick** | ~6, light propagation (α=0.15) | Mid-task targeted lookups |
161
+ | **Recent** | ~15, time-weighted + k-hop neighbors | WIP context, session resume |
162
+
163
+ Pipeline: embed query (BGE) → cosine similarity → apply decay scores → graph propagation (PageRank-style with signed edges) → knapsack selection (maximize relevance per token within budget).
164
+
165
+ </details>
166
+
167
+ <details>
168
+ <summary><strong>Skills & maintenance</strong></summary>
169
+
170
+ | Skill | Purpose | When |
171
+ |-------|---------|------|
172
+ | `/discuss` | Plan with memory context → produces `task.md` | Starting new work |
173
+ | `/task` | Execute with 4 agents + memory | Implementing features/fixes |
174
+ | `/memorize` | Manual session sync | Free sessions outside /task |
175
+ | `/brain-init` | Guided 14-step initialization | First time setup |
176
+ | `/elaborate` | Consolidate graph, build edges, resolve duplicates | Weekly |
177
+ | `/health-check` | Diagnose gaps, run targeted fixes | Monthly |
178
+ | `/smoke-test` | Test retrieval quality | After changes |
179
+
180
+ </details>
181
+
182
+ <details>
183
+ <summary><strong>MCP tools (15)</strong></summary>
184
+
185
+ `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`
186
+
187
+ </details>
188
+
189
+ <details>
190
+ <summary><strong>Configuration & CLI</strong></summary>
191
+
192
+ ```toml
193
+ # mangobrain.toml (optional — defaults work for most setups)
194
+
195
+ [database]
196
+ path = "~/.mangobrain/mangobrain.db"
197
+
198
+ [embedding]
199
+ model = "auto" # GPU → bge-large-en-v1.5 (1024d), CPU → bge-base-en-v1.5 (768d)
200
+ device = "auto" # auto-detects CUDA
201
+
202
+ [decay]
203
+ episodic = 0.01
204
+ semantic = 0.002
205
+ procedural = 0.001
206
+ ```
207
+
208
+ ```bash
209
+ mangobrain serve # MCP server (stdio)
210
+ mangobrain serve --api # REST API + dashboard on :3101
211
+ mangobrain serve --all # Both
212
+ mangobrain install # Full interactive setup
213
+ mangobrain init -p NAME # Initialize project in DB
214
+ mangobrain status -p NAME # Setup progress
215
+ mangobrain doctor # System health check
216
+ mangobrain dashboard # Open dashboard in browser
217
+ ```
218
+
219
+ </details>
220
+
221
+ ---
222
+
223
+ ## Requirements
224
+
225
+ - **Python** 3.11+
226
+ - **Claude Code** (Anthropic CLI)
227
+ - **GPU** optional — CUDA for best quality embeddings, CPU works fine
228
+
229
+ ---
230
+
231
+ <p align="center">
232
+ Built by <a href="https://github.com/Federico-Anastasi">Federico Anastasi</a>
233
+ <br/>
234
+ <sub>Because your AI pair-programmer shouldn't have amnesia.</sub>
235
+ </p>