cerebro-memory 0.2.0__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 (50) hide show
  1. cerebro_memory-0.2.0/LICENSE +21 -0
  2. cerebro_memory-0.2.0/PKG-INFO +264 -0
  3. cerebro_memory-0.2.0/README.md +237 -0
  4. cerebro_memory-0.2.0/pyproject.toml +62 -0
  5. cerebro_memory-0.2.0/pyproject.toml.orig +52 -0
  6. cerebro_memory-0.2.0/src/cerebro_mcp/__init__.py +3 -0
  7. cerebro_memory-0.2.0/src/cerebro_mcp/__main__.py +3 -0
  8. cerebro_memory-0.2.0/src/cerebro_mcp/cli.py +363 -0
  9. cerebro_memory-0.2.0/src/cerebro_mcp/config.py +248 -0
  10. cerebro_memory-0.2.0/src/cerebro_mcp/contradictions.py +499 -0
  11. cerebro_memory-0.2.0/src/cerebro_mcp/demo.py +102 -0
  12. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/README.md +48 -0
  13. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-app/memory/MEMORY.md +4 -0
  14. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-app/memory/monetization.md +16 -0
  15. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-app/memory/project-overview.md +19 -0
  16. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-app/memory/release-process.md +12 -0
  17. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-app/memory/user-preferences.md +15 -0
  18. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-web/memory/MEMORY.md +3 -0
  19. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-web/memory/feedback-copy.md +14 -0
  20. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-web/memory/pricing.md +16 -0
  21. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/agent-memory/streak-web/memory/site-stack.md +15 -0
  22. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/cerebro.toml +35 -0
  23. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Clippings/Why 7-day trials convert better.md +19 -0
  24. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Daily/2026-11-03.md +14 -0
  25. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Daily/2026-11-17.md +16 -0
  26. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Decisions/2026-09-14 Precio y anuncios.md +29 -0
  27. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Dev/Payments setup.md +24 -0
  28. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Dev/Sync architecture.md +19 -0
  29. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Ideas/Monetization brainstorm.md +20 -0
  30. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Ideas/Streak widgets.md +13 -0
  31. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Journal/2026-10-30.md +13 -0
  32. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Marketing/Landing copy.md +22 -0
  33. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Meetings/2026-10-08 Beta testers call.md +20 -0
  34. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Projects/Launch plan.md +27 -0
  35. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Projects/Roadmap 2026.md +17 -0
  36. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Streak.md +32 -0
  37. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/Templates/Daily template.md +7 -0
  38. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/notes/people/Marta Ruiz.md +12 -0
  39. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/repo-docs/streak-app/AGENTS.md +9 -0
  40. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/repo-docs/streak-app/docs/handoff-2026-11-18.md +26 -0
  41. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/repo-docs/streak-app/docs/release-checklist.md +14 -0
  42. cerebro_memory-0.2.0/src/cerebro_mcp/demo_vault/repo-docs/streak-web/docs/pricing-page.md +20 -0
  43. cerebro_memory-0.2.0/src/cerebro_mcp/embeddings.py +166 -0
  44. cerebro_memory-0.2.0/src/cerebro_mcp/index.py +392 -0
  45. cerebro_memory-0.2.0/src/cerebro_mcp/notes.py +288 -0
  46. cerebro_memory-0.2.0/src/cerebro_mcp/query.py +386 -0
  47. cerebro_memory-0.2.0/src/cerebro_mcp/redact.py +161 -0
  48. cerebro_memory-0.2.0/src/cerebro_mcp/server.py +332 -0
  49. cerebro_memory-0.2.0/src/cerebro_mcp/sources.py +182 -0
  50. cerebro_memory-0.2.0/src/cerebro_mcp/text.py +54 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 César Méndez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,264 @@
1
+ Metadata-Version: 2.4
2
+ Name: cerebro-memory
3
+ Version: 0.2.0
4
+ Summary: A local, read-only index over your Markdown notes and your AI agents' memories, served over MCP, with a tool that finds where they contradict each other.
5
+ Keywords: mcp,obsidian,markdown,search,embeddings,sqlite,claude
6
+ Author: cerebro-memory contributors
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Text Processing :: Indexing
18
+ Requires-Dist: fastembed>=0.9,<1
19
+ Requires-Dist: mcp>=2.3,<3
20
+ Requires-Dist: numpy>=1.26
21
+ Requires-Dist: platformdirs>=4
22
+ Requires-Dist: pydantic>=2.7
23
+ Requires-Dist: pyyaml>=6.0
24
+ Requires-Dist: sqlite-vec>=0.1.6
25
+ Requires-Python: >=3.11
26
+ Description-Content-Type: text/markdown
27
+
28
+ # cerebro-memory
29
+
30
+ **A local, read-only index over your Markdown notes *and* your AI agents' memories, served over MCP, that tells you when they contradict each other.**
31
+
32
+ <!-- demo gif -->
33
+
34
+ [Español](README.es.md)
35
+
36
+ ## Why
37
+
38
+ You write a decision in your notes. Your coding agent saved an older version of
39
+ it in its memory three months ago. A handoff doc in another repo says a third
40
+ thing. Nobody notices until an agent confidently ships the old price, the old
41
+ launch date or the feature you already killed.
42
+
43
+ `cerebro` indexes all of it on your machine (your Obsidian vault, Claude Code
44
+ memories, repo docs and handoffs) and gives you, and any MCP client, one place
45
+ to search it and one command to ask: *where do my sources disagree?*
46
+
47
+ - **Hybrid search** that works in English and Spanish (and other languages):
48
+ exact names via full-text search, paraphrases via multilingual embeddings.
49
+ - **Contradictions**: pairs of fragments on a topic that state different
50
+ prices, dates, versions or yes/no answers, with both sources and dates.
51
+ - **Local and read-only.** Your files are never edited. Private notes never
52
+ leave the index. Secrets are redacted before anything is stored.
53
+
54
+ ## Quickstart (30 seconds)
55
+
56
+ You need [uv](https://docs.astral.sh/uv/).
57
+
58
+ ```sh
59
+ uvx cerebro-memory demo
60
+ ```
61
+
62
+ That copies a small fictional vault to a temp folder, indexes it and prints the
63
+ contradictions it finds. The first run downloads the embedding model once;
64
+ after that everything runs offline.
65
+
66
+ Then point it at your own notes:
67
+
68
+ ```sh
69
+ uv tool install cerebro-memory # installs the `cerebro` command
70
+ cerebro init --vault ~/Obsidian # writes cerebro.toml; adds ~/.claude/projects if it exists
71
+ cerebro index # incremental; re-run any time
72
+ cerebro search "pricing decision"
73
+ cerebro contradictions "launch date" --across-sources
74
+ ```
75
+
76
+ ## What it finds
77
+
78
+ Real output of `uvx cerebro-memory demo` (it prints the strongest disagreement per pair of notes; ask about one topic with `cerebro contradictions "<topic>"`):
79
+
80
+ ```text
81
+ $ uvx cerebro-memory demo
82
+ Demo vault copied to /tmp/cerebro-demo-x1y2z3/demo_vault
83
+ Indexed 26 notes from 3 sources (notes, agent-memory, repo-docs): 2 private (kept out of every result), 1 line(s) redacted, mode hybrid.
84
+
85
+ Your notes and your agents disagree on 3 things (older -> newer):
86
+
87
+ 1. price: $4.99/month -> $5.99/month; price: $35/year -> $39/year; number: 7-day -> 14 days
88
+ older 2026-07-02 agent-memory:streak-web/memory/pricing.md
89
+ - Pro monthly: $4.99/month - Pro yearly: $35/year - 7-day free trial on both plans. Why: set when the pricing page was first built, from Lucía's brai…
90
+ newer 2026-09-15 repo-docs:streak-web/docs/pricing-page.md
91
+ …Price | Free trial | |---|---|---| | Free | $0, up to 3 habits | none | | Pro monthly | $5.99/month | 14 days | | Pro yearly | $39/year | 14 days | …
92
+
93
+ 2. version: 0.8.5 -> 0.9.3 / 0.9.0; date: December 1, 2026 -> 2027-01-12 / 2026-12-15
94
+ older 2026-08-21 agent-memory:streak-app/memory/project-overview.md
95
+ …SQLite file is the source of truth; sync is optional and Pro-only. - Current version: 0.8.5 (beta channel). - Launch date: December 1, 2026. - Free …
96
+ newer 2026-11-18 repo-docs:streak-app/docs/handoff-2026-11-18.md
97
+ - Current version: 0.9.3, in the beta channel since this morning. It fixes the midnight rollover in StreakClock.rollover() for UTC+9 and UTC-10. - La…
98
+
99
+ 3. number: 7-day -> 14 días
100
+ older 2026-07-02 agent-memory:streak-web/memory/pricing.md
101
+ - Pro monthly: $4.99/month - Pro yearly: $35/year - 7-day free trial on both plans. Why: set when the pricing page was first built, from Lucía's brai…
102
+ newer 2026-11-17 notes:Daily/2026-11-17.md
103
+ Martes tranquilo. Revisé las conversiones del beta: con la prueba de 14 días, 4 de 11 testers activaron Pro al terminarla. Me quedo con 14 días aunqu…
104
+
105
+ Run it on your own notes: cerebro init --vault ~/path/to/notes && cerebro index
106
+ ```
107
+
108
+ The demo vault is in [`src/cerebro_mcp/demo_vault/`](src/cerebro_mcp/demo_vault/);
109
+ its README lists every fact planted in it.
110
+
111
+ ## Connect it to your agents
112
+
113
+ `cerebro serve` is an MCP server over stdio. Your client launches it; you never
114
+ run it by hand. If you installed the tool, the command is `cerebro serve`;
115
+ without installing, it is `uvx cerebro-memory serve`.
116
+
117
+ **Claude Code**
118
+
119
+ ```sh
120
+ claude mcp add cerebro --scope user -- uvx cerebro-memory serve
121
+ ```
122
+
123
+ **Codex** (`~/.codex/config.toml`)
124
+
125
+ ```toml
126
+ [mcp_servers.cerebro]
127
+ command = "uvx"
128
+ args = ["cerebro-memory", "serve"]
129
+ ```
130
+
131
+ **Cursor** (`~/.cursor/mcp.json`) and **Claude Desktop** (`claude_desktop_config.json`)
132
+
133
+ ```json
134
+ {
135
+ "mcpServers": {
136
+ "cerebro": {
137
+ "command": "uvx",
138
+ "args": ["cerebro-memory", "serve"]
139
+ }
140
+ }
141
+ }
142
+ ```
143
+
144
+ To use a config file other than the default, add
145
+ `"env": { "CEREBRO_CONFIG": "/path/to/cerebro.toml" }`. More detail, file
146
+ locations and Windows notes: [docs/connect.md](docs/connect.md).
147
+
148
+ ### MCP tools
149
+
150
+ | Tool | What it does |
151
+ |---|---|
152
+ | `search` | Hybrid search with filters (`source`, `scope`, `type`, `since`, `until`) |
153
+ | `note` | Full text, frontmatter and links of one note (by id, path or title) |
154
+ | `links` | Outgoing and incoming `[[links]]` |
155
+ | `todos` | Open checkboxes `- [ ]` in the notes that match a query |
156
+ | `contradictions` | Pairs of fragments on a topic that state different values |
157
+ | `propose` | Writes a Markdown proposal into cerebro's own folder; never touches your notes |
158
+
159
+ ## Configuration
160
+
161
+ `cerebro init` writes a starter file. A full example:
162
+
163
+ ```toml
164
+ [[source]]
165
+ name = "notes"
166
+ kind = "vault" # Obsidian/Markdown: frontmatter, [[links]], checkboxes
167
+ path = "~/Obsidian"
168
+ scope = "personal"
169
+ exclude = ["Templates/**"]
170
+
171
+ [[source]]
172
+ name = "claude-memory"
173
+ kind = "claude-code-memory" # <path>/<project>/memory/*.md
174
+ path = "~/.claude/projects"
175
+
176
+ [[source]]
177
+ name = "handoffs"
178
+ kind = "glob" # any Markdown matched by the include globs
179
+ path = "~/code"
180
+ include = ["*/docs/**/*.md", "*/AGENTS.md", "*/CLAUDE.md"]
181
+ scope = "work"
182
+
183
+ [privacy]
184
+ private_folders = ["private", "people"]
185
+ private_frontmatter = "private"
186
+ redact = ["secrets", "cards"]
187
+ ```
188
+
189
+ The config is looked up in this order: `--config PATH`, `$CEREBRO_CONFIG`,
190
+ `./cerebro.toml`, then your user config folder. Run `cerebro doctor` to see
191
+ which file was used, how many files each source has and whether the model is
192
+ cached.
193
+
194
+ ## Privacy model
195
+
196
+ - **Read-only.** cerebro never edits, moves or deletes a source file. The only
197
+ thing it writes besides its index is `propose`, into its own proposals folder.
198
+ - **Local.** Parsing, indexing and embeddings run on your machine. The only
199
+ network call is the one-time model download. Only the fragments a client asks
200
+ for leave the process, and only to that client.
201
+ - **Private notes stay private.** A note in a private folder (`private/`,
202
+ `people/` by default) or with `private: true` is indexed by path and hash
203
+ only. Every query filters private notes out in SQL, so no tool can return them.
204
+ - **Redaction before storage.** Lines with API keys, tokens, private keys or
205
+ card numbers are redacted before the note is parsed. Packs: `secrets`,
206
+ `cards`, and `mx` (Mexican IDs and bank numbers).
207
+ - **Hidden scopes.** Sources in a hidden scope are indexed but only returned
208
+ when that scope is asked for by name.
209
+ - **Content is data, not instructions.** Every tool output carries a short
210
+ notice saying so, and web clips (`source: web`) are marked untrusted.
211
+
212
+ Details and limits: [docs/privacy.md](docs/privacy.md).
213
+
214
+ ## How it works
215
+
216
+ ```text
217
+ Markdown sources vault · agent memories · repo docs
218
+ │
219
+ ▼
220
+ redact sensitive lines ─► parse frontmatter, [[links]], - [ ] checkboxes
221
+ │
222
+ ▼
223
+ split into fragments by heading ─► skip unchanged files (content hash)
224
+ │
225
+ ├──────────────────────────────┐
226
+ ▼ ▼
227
+ SQLite FTS5 (keywords, BM25) sqlite-vec (multilingual embeddings, CPU)
228
+ │ │
229
+ └──────────► RRF fusion ◄──────┘
230
+ │
231
+ ▼
232
+ egress filter in SQL (no private notes, no hidden scopes)
233
+ │
234
+ ▼
235
+ CLI · MCP tools over stdio · contradictions
236
+ ```
237
+
238
+ Markdown is the truth; the index is disposable. Delete `index.db` and run
239
+ `cerebro index` again: nothing is lost. More in
240
+ [docs/architecture.md](docs/architecture.md) and
241
+ [docs/contradictions.md](docs/contradictions.md).
242
+
243
+ ## Roadmap
244
+
245
+ v0.1 is the core: index, hybrid search, contradictions, MCP server, demo.
246
+ Ideas for later, in no particular order and not promised:
247
+
248
+ - Memory formats of more agents and editors.
249
+ - A local model to judge contradiction candidates (today the client does).
250
+ - A watch mode that re-indexes on file change instead of on a timer.
251
+ - More redaction packs (contributions welcome).
252
+ - `contradictions` limited to a date range or a project.
253
+
254
+ ## Contributing
255
+
256
+ Bug reports and pull requests are welcome. Read
257
+ [CONTRIBUTING.md](CONTRIBUTING.md) first; security issues go through
258
+ [SECURITY.md](SECURITY.md), not public issues.
259
+
260
+ ## Credits
261
+
262
+ Built by **César Méndez** — surgeon and builder. [cesarmendez.dev](https://cesarmendez.dev)
263
+
264
+ Released under the [MIT License](LICENSE).
@@ -0,0 +1,237 @@
1
+ # cerebro-memory
2
+
3
+ **A local, read-only index over your Markdown notes *and* your AI agents' memories, served over MCP, that tells you when they contradict each other.**
4
+
5
+ <!-- demo gif -->
6
+
7
+ [Español](README.es.md)
8
+
9
+ ## Why
10
+
11
+ You write a decision in your notes. Your coding agent saved an older version of
12
+ it in its memory three months ago. A handoff doc in another repo says a third
13
+ thing. Nobody notices until an agent confidently ships the old price, the old
14
+ launch date or the feature you already killed.
15
+
16
+ `cerebro` indexes all of it on your machine (your Obsidian vault, Claude Code
17
+ memories, repo docs and handoffs) and gives you, and any MCP client, one place
18
+ to search it and one command to ask: *where do my sources disagree?*
19
+
20
+ - **Hybrid search** that works in English and Spanish (and other languages):
21
+ exact names via full-text search, paraphrases via multilingual embeddings.
22
+ - **Contradictions**: pairs of fragments on a topic that state different
23
+ prices, dates, versions or yes/no answers, with both sources and dates.
24
+ - **Local and read-only.** Your files are never edited. Private notes never
25
+ leave the index. Secrets are redacted before anything is stored.
26
+
27
+ ## Quickstart (30 seconds)
28
+
29
+ You need [uv](https://docs.astral.sh/uv/).
30
+
31
+ ```sh
32
+ uvx cerebro-memory demo
33
+ ```
34
+
35
+ That copies a small fictional vault to a temp folder, indexes it and prints the
36
+ contradictions it finds. The first run downloads the embedding model once;
37
+ after that everything runs offline.
38
+
39
+ Then point it at your own notes:
40
+
41
+ ```sh
42
+ uv tool install cerebro-memory # installs the `cerebro` command
43
+ cerebro init --vault ~/Obsidian # writes cerebro.toml; adds ~/.claude/projects if it exists
44
+ cerebro index # incremental; re-run any time
45
+ cerebro search "pricing decision"
46
+ cerebro contradictions "launch date" --across-sources
47
+ ```
48
+
49
+ ## What it finds
50
+
51
+ Real output of `uvx cerebro-memory demo` (it prints the strongest disagreement per pair of notes; ask about one topic with `cerebro contradictions "<topic>"`):
52
+
53
+ ```text
54
+ $ uvx cerebro-memory demo
55
+ Demo vault copied to /tmp/cerebro-demo-x1y2z3/demo_vault
56
+ Indexed 26 notes from 3 sources (notes, agent-memory, repo-docs): 2 private (kept out of every result), 1 line(s) redacted, mode hybrid.
57
+
58
+ Your notes and your agents disagree on 3 things (older -> newer):
59
+
60
+ 1. price: $4.99/month -> $5.99/month; price: $35/year -> $39/year; number: 7-day -> 14 days
61
+ older 2026-07-02 agent-memory:streak-web/memory/pricing.md
62
+ - Pro monthly: $4.99/month - Pro yearly: $35/year - 7-day free trial on both plans. Why: set when the pricing page was first built, from Lucía's brai…
63
+ newer 2026-09-15 repo-docs:streak-web/docs/pricing-page.md
64
+ …Price | Free trial | |---|---|---| | Free | $0, up to 3 habits | none | | Pro monthly | $5.99/month | 14 days | | Pro yearly | $39/year | 14 days | …
65
+
66
+ 2. version: 0.8.5 -> 0.9.3 / 0.9.0; date: December 1, 2026 -> 2027-01-12 / 2026-12-15
67
+ older 2026-08-21 agent-memory:streak-app/memory/project-overview.md
68
+ …SQLite file is the source of truth; sync is optional and Pro-only. - Current version: 0.8.5 (beta channel). - Launch date: December 1, 2026. - Free …
69
+ newer 2026-11-18 repo-docs:streak-app/docs/handoff-2026-11-18.md
70
+ - Current version: 0.9.3, in the beta channel since this morning. It fixes the midnight rollover in StreakClock.rollover() for UTC+9 and UTC-10. - La…
71
+
72
+ 3. number: 7-day -> 14 días
73
+ older 2026-07-02 agent-memory:streak-web/memory/pricing.md
74
+ - Pro monthly: $4.99/month - Pro yearly: $35/year - 7-day free trial on both plans. Why: set when the pricing page was first built, from Lucía's brai…
75
+ newer 2026-11-17 notes:Daily/2026-11-17.md
76
+ Martes tranquilo. Revisé las conversiones del beta: con la prueba de 14 días, 4 de 11 testers activaron Pro al terminarla. Me quedo con 14 días aunqu…
77
+
78
+ Run it on your own notes: cerebro init --vault ~/path/to/notes && cerebro index
79
+ ```
80
+
81
+ The demo vault is in [`src/cerebro_mcp/demo_vault/`](src/cerebro_mcp/demo_vault/);
82
+ its README lists every fact planted in it.
83
+
84
+ ## Connect it to your agents
85
+
86
+ `cerebro serve` is an MCP server over stdio. Your client launches it; you never
87
+ run it by hand. If you installed the tool, the command is `cerebro serve`;
88
+ without installing, it is `uvx cerebro-memory serve`.
89
+
90
+ **Claude Code**
91
+
92
+ ```sh
93
+ claude mcp add cerebro --scope user -- uvx cerebro-memory serve
94
+ ```
95
+
96
+ **Codex** (`~/.codex/config.toml`)
97
+
98
+ ```toml
99
+ [mcp_servers.cerebro]
100
+ command = "uvx"
101
+ args = ["cerebro-memory", "serve"]
102
+ ```
103
+
104
+ **Cursor** (`~/.cursor/mcp.json`) and **Claude Desktop** (`claude_desktop_config.json`)
105
+
106
+ ```json
107
+ {
108
+ "mcpServers": {
109
+ "cerebro": {
110
+ "command": "uvx",
111
+ "args": ["cerebro-memory", "serve"]
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ To use a config file other than the default, add
118
+ `"env": { "CEREBRO_CONFIG": "/path/to/cerebro.toml" }`. More detail, file
119
+ locations and Windows notes: [docs/connect.md](docs/connect.md).
120
+
121
+ ### MCP tools
122
+
123
+ | Tool | What it does |
124
+ |---|---|
125
+ | `search` | Hybrid search with filters (`source`, `scope`, `type`, `since`, `until`) |
126
+ | `note` | Full text, frontmatter and links of one note (by id, path or title) |
127
+ | `links` | Outgoing and incoming `[[links]]` |
128
+ | `todos` | Open checkboxes `- [ ]` in the notes that match a query |
129
+ | `contradictions` | Pairs of fragments on a topic that state different values |
130
+ | `propose` | Writes a Markdown proposal into cerebro's own folder; never touches your notes |
131
+
132
+ ## Configuration
133
+
134
+ `cerebro init` writes a starter file. A full example:
135
+
136
+ ```toml
137
+ [[source]]
138
+ name = "notes"
139
+ kind = "vault" # Obsidian/Markdown: frontmatter, [[links]], checkboxes
140
+ path = "~/Obsidian"
141
+ scope = "personal"
142
+ exclude = ["Templates/**"]
143
+
144
+ [[source]]
145
+ name = "claude-memory"
146
+ kind = "claude-code-memory" # <path>/<project>/memory/*.md
147
+ path = "~/.claude/projects"
148
+
149
+ [[source]]
150
+ name = "handoffs"
151
+ kind = "glob" # any Markdown matched by the include globs
152
+ path = "~/code"
153
+ include = ["*/docs/**/*.md", "*/AGENTS.md", "*/CLAUDE.md"]
154
+ scope = "work"
155
+
156
+ [privacy]
157
+ private_folders = ["private", "people"]
158
+ private_frontmatter = "private"
159
+ redact = ["secrets", "cards"]
160
+ ```
161
+
162
+ The config is looked up in this order: `--config PATH`, `$CEREBRO_CONFIG`,
163
+ `./cerebro.toml`, then your user config folder. Run `cerebro doctor` to see
164
+ which file was used, how many files each source has and whether the model is
165
+ cached.
166
+
167
+ ## Privacy model
168
+
169
+ - **Read-only.** cerebro never edits, moves or deletes a source file. The only
170
+ thing it writes besides its index is `propose`, into its own proposals folder.
171
+ - **Local.** Parsing, indexing and embeddings run on your machine. The only
172
+ network call is the one-time model download. Only the fragments a client asks
173
+ for leave the process, and only to that client.
174
+ - **Private notes stay private.** A note in a private folder (`private/`,
175
+ `people/` by default) or with `private: true` is indexed by path and hash
176
+ only. Every query filters private notes out in SQL, so no tool can return them.
177
+ - **Redaction before storage.** Lines with API keys, tokens, private keys or
178
+ card numbers are redacted before the note is parsed. Packs: `secrets`,
179
+ `cards`, and `mx` (Mexican IDs and bank numbers).
180
+ - **Hidden scopes.** Sources in a hidden scope are indexed but only returned
181
+ when that scope is asked for by name.
182
+ - **Content is data, not instructions.** Every tool output carries a short
183
+ notice saying so, and web clips (`source: web`) are marked untrusted.
184
+
185
+ Details and limits: [docs/privacy.md](docs/privacy.md).
186
+
187
+ ## How it works
188
+
189
+ ```text
190
+ Markdown sources vault · agent memories · repo docs
191
+ │
192
+ ▼
193
+ redact sensitive lines ─► parse frontmatter, [[links]], - [ ] checkboxes
194
+ │
195
+ ▼
196
+ split into fragments by heading ─► skip unchanged files (content hash)
197
+ │
198
+ ├──────────────────────────────┐
199
+ ▼ ▼
200
+ SQLite FTS5 (keywords, BM25) sqlite-vec (multilingual embeddings, CPU)
201
+ │ │
202
+ └──────────► RRF fusion ◄──────┘
203
+ │
204
+ ▼
205
+ egress filter in SQL (no private notes, no hidden scopes)
206
+ │
207
+ ▼
208
+ CLI · MCP tools over stdio · contradictions
209
+ ```
210
+
211
+ Markdown is the truth; the index is disposable. Delete `index.db` and run
212
+ `cerebro index` again: nothing is lost. More in
213
+ [docs/architecture.md](docs/architecture.md) and
214
+ [docs/contradictions.md](docs/contradictions.md).
215
+
216
+ ## Roadmap
217
+
218
+ v0.1 is the core: index, hybrid search, contradictions, MCP server, demo.
219
+ Ideas for later, in no particular order and not promised:
220
+
221
+ - Memory formats of more agents and editors.
222
+ - A local model to judge contradiction candidates (today the client does).
223
+ - A watch mode that re-indexes on file change instead of on a timer.
224
+ - More redaction packs (contributions welcome).
225
+ - `contradictions` limited to a date range or a project.
226
+
227
+ ## Contributing
228
+
229
+ Bug reports and pull requests are welcome. Read
230
+ [CONTRIBUTING.md](CONTRIBUTING.md) first; security issues go through
231
+ [SECURITY.md](SECURITY.md), not public issues.
232
+
233
+ ## Credits
234
+
235
+ Built by **César Méndez** — surgeon and builder. [cesarmendez.dev](https://cesarmendez.dev)
236
+
237
+ Released under the [MIT License](LICENSE).
@@ -0,0 +1,62 @@
1
+ [project]
2
+ name = "cerebro-memory"
3
+ version = "0.2.0"
4
+ description = "A local, read-only index over your Markdown notes and your AI agents' memories, served over MCP, with a tool that finds where they contradict each other."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.11"
9
+ keywords = [
10
+ "mcp",
11
+ "obsidian",
12
+ "markdown",
13
+ "search",
14
+ "embeddings",
15
+ "sqlite",
16
+ "claude",
17
+ ]
18
+ classifiers = [
19
+ "Development Status :: 3 - Alpha",
20
+ "Environment :: Console",
21
+ "Intended Audience :: Developers",
22
+ "Operating System :: OS Independent",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Topic :: Text Processing :: Indexing",
28
+ ]
29
+ dependencies = [
30
+ "fastembed>=0.9,<1",
31
+ "mcp>=2.3,<3",
32
+ "numpy>=1.26",
33
+ "platformdirs>=4",
34
+ "pydantic>=2.7",
35
+ "pyyaml>=6.0",
36
+ "sqlite-vec>=0.1.6",
37
+ ]
38
+
39
+ [[project.authors]]
40
+ name = "cerebro-memory contributors"
41
+
42
+ [project.scripts]
43
+ cerebro = "cerebro_mcp.cli:main"
44
+ cerebro-memory = "cerebro_mcp.cli:main"
45
+
46
+ [dependency-groups]
47
+ dev = [
48
+ "pytest>=8",
49
+ "anyio>=4",
50
+ ]
51
+
52
+ [build-system]
53
+ requires = ["uv_build>=0.8,<0.13"]
54
+ build-backend = "uv_build"
55
+
56
+ [tool.uv.build-backend]
57
+ module-name = "cerebro_mcp"
58
+
59
+ [tool.pytest.ini_options]
60
+ testpaths = ["tests"]
61
+ markers = ["model: needs the real embedding model (downloads it once); run with `-m model`"]
62
+ addopts = "-m 'not model'"
@@ -0,0 +1,52 @@
1
+ [project]
2
+ name = "cerebro-memory"
3
+ version = "0.2.0"
4
+ description = "A local, read-only index over your Markdown notes and your AI agents' memories, served over MCP, with a tool that finds where they contradict each other."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.11"
9
+ authors = [{ name = "cerebro-memory contributors" }]
10
+ keywords = ["mcp", "obsidian", "markdown", "search", "embeddings", "sqlite", "claude"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Environment :: Console",
14
+ "Intended Audience :: Developers",
15
+ "Operating System :: OS Independent",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Topic :: Text Processing :: Indexing",
21
+ ]
22
+ dependencies = [
23
+ "fastembed>=0.9,<1",
24
+ "mcp>=2.3,<3",
25
+ "numpy>=1.26",
26
+ "platformdirs>=4",
27
+ "pydantic>=2.7",
28
+ "pyyaml>=6.0",
29
+ "sqlite-vec>=0.1.6",
30
+ ]
31
+
32
+ [project.scripts]
33
+ cerebro = "cerebro_mcp.cli:main"
34
+ cerebro-memory = "cerebro_mcp.cli:main"
35
+
36
+ [dependency-groups]
37
+ dev = ["pytest>=8", "anyio>=4"]
38
+
39
+ [build-system]
40
+ requires = ["uv_build>=0.8,<0.13"]
41
+ build-backend = "uv_build"
42
+
43
+ [tool.uv.build-backend]
44
+ # The distribution is `cerebro-memory` (PyPI); the import package stays `cerebro_mcp`.
45
+ module-name = "cerebro_mcp"
46
+
47
+ [tool.pytest.ini_options]
48
+ testpaths = ["tests"]
49
+ markers = [
50
+ "model: needs the real embedding model (downloads it once); run with `-m model`",
51
+ ]
52
+ addopts = "-m 'not model'"
@@ -0,0 +1,3 @@
1
+ """cerebro-memory: a local, read-only index over Markdown notes and AI agent memories."""
2
+
3
+ __version__ = "0.2.0"
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())