brain-wiki 0.1.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 (227) hide show
  1. brain_wiki-0.1.0/.claude-plugin/marketplace.json +16 -0
  2. brain_wiki-0.1.0/.claude-plugin/plugin.json +19 -0
  3. brain_wiki-0.1.0/.gitignore +24 -0
  4. brain_wiki-0.1.0/.mcp.json +16 -0
  5. brain_wiki-0.1.0/.pre-commit-hooks.yaml +7 -0
  6. brain_wiki-0.1.0/CHANGELOG.md +125 -0
  7. brain_wiki-0.1.0/CONTRIBUTING.md +112 -0
  8. brain_wiki-0.1.0/LICENSE +202 -0
  9. brain_wiki-0.1.0/PKG-INFO +134 -0
  10. brain_wiki-0.1.0/README.md +99 -0
  11. brain_wiki-0.1.0/SECURITY.md +27 -0
  12. brain_wiki-0.1.0/docs/design/01-overview.md +211 -0
  13. brain_wiki-0.1.0/docs/design/02-brain-format.md +640 -0
  14. brain_wiki-0.1.0/docs/design/03-config-and-storage.md +233 -0
  15. brain_wiki-0.1.0/docs/design/04-index-and-retrieval.md +609 -0
  16. brain_wiki-0.1.0/docs/design/05-write-path-and-consolidation.md +685 -0
  17. brain_wiki-0.1.0/docs/design/06-lint-and-reports.md +240 -0
  18. brain_wiki-0.1.0/docs/design/07-interfaces.md +481 -0
  19. brain_wiki-0.1.0/docs/design/08-agent-integrations.md +354 -0
  20. brain_wiki-0.1.0/docs/design/09-import.md +210 -0
  21. brain_wiki-0.1.0/docs/design/10-security-and-privacy.md +127 -0
  22. brain_wiki-0.1.0/docs/design/11-eval-bench.md +142 -0
  23. brain_wiki-0.1.0/docs/design/12-visualizer.md +375 -0
  24. brain_wiki-0.1.0/docs/design/13-engineering.md +249 -0
  25. brain_wiki-0.1.0/docs/design/14-roadmap-and-open-questions.md +115 -0
  26. brain_wiki-0.1.0/docs/design/15-skills-and-onboarding.md +232 -0
  27. brain_wiki-0.1.0/docs/design/README.md +70 -0
  28. brain_wiki-0.1.0/docs/design/agents/antigravity.md +59 -0
  29. brain_wiki-0.1.0/docs/design/agents/claude-code.md +41 -0
  30. brain_wiki-0.1.0/docs/design/agents/codex.md +61 -0
  31. brain_wiki-0.1.0/docs/design/agents/cursor.md +28 -0
  32. brain_wiki-0.1.0/docs/design/agents/openclaw.md +36 -0
  33. brain_wiki-0.1.0/docs/proposals/README.md +33 -0
  34. brain_wiki-0.1.0/docs/proposals/consolidation-bench.md +100 -0
  35. brain_wiki-0.1.0/docs/proposals/hooks.md +125 -0
  36. brain_wiki-0.1.0/docs/proposals/privacy.md +154 -0
  37. brain_wiki-0.1.0/docs/proposals/public-benchmarks.md +26 -0
  38. brain_wiki-0.1.0/docs/proposals/remote-mcp.md +32 -0
  39. brain_wiki-0.1.0/docs/proposals/remote-sync.md +169 -0
  40. brain_wiki-0.1.0/docs/proposals/scheduled-maintenance.md +88 -0
  41. brain_wiki-0.1.0/docs/user/README.md +13 -0
  42. brain_wiki-0.1.0/docs/user/agents.md +159 -0
  43. brain_wiki-0.1.0/docs/user/getting-started.md +119 -0
  44. brain_wiki-0.1.0/docs/user/import.md +72 -0
  45. brain_wiki-0.1.0/docs/user/maintenance.md +95 -0
  46. brain_wiki-0.1.0/docs/user/privacy.md +72 -0
  47. brain_wiki-0.1.0/docs/user/reference.md +98 -0
  48. brain_wiki-0.1.0/mcp.json +17 -0
  49. brain_wiki-0.1.0/mcp_config.json +15 -0
  50. brain_wiki-0.1.0/plugin.json +37 -0
  51. brain_wiki-0.1.0/pyproject.toml +113 -0
  52. brain_wiki-0.1.0/rules/brain-wiki.md +30 -0
  53. brain_wiki-0.1.0/scripts/build_docs_brain.py +625 -0
  54. brain_wiki-0.1.0/scripts/check.py +115 -0
  55. brain_wiki-0.1.0/scripts/check_visibility.py +238 -0
  56. brain_wiki-0.1.0/scripts/check_viz.py +103 -0
  57. brain_wiki-0.1.0/scripts/sync_versions.py +186 -0
  58. brain_wiki-0.1.0/server.json +30 -0
  59. brain_wiki-0.1.0/skills/brain/SKILL.md +145 -0
  60. brain_wiki-0.1.0/skills/brain/references/format.md +149 -0
  61. brain_wiki-0.1.0/skills/brain-maintain/SKILL.md +113 -0
  62. brain_wiki-0.1.0/skills/brain-maintain/references/consolidate.md +91 -0
  63. brain_wiki-0.1.0/skills/brain-maintain/references/harvest.md +144 -0
  64. brain_wiki-0.1.0/skills/brain-setup/SKILL.md +188 -0
  65. brain_wiki-0.1.0/skills/brain-setup/references/hosts.md +88 -0
  66. brain_wiki-0.1.0/skills/brain-setup/references/privacy.md +77 -0
  67. brain_wiki-0.1.0/src/brainwiki/__init__.py +17 -0
  68. brain_wiki-0.1.0/src/brainwiki/__main__.py +5 -0
  69. brain_wiki-0.1.0/src/brainwiki/assets/prompts/consolidate.md +89 -0
  70. brain_wiki-0.1.0/src/brainwiki/assets/prompts/distill.md +96 -0
  71. brain_wiki-0.1.0/src/brainwiki/assets/prompts/harvest.md +142 -0
  72. brain_wiki-0.1.0/src/brainwiki/bench/__init__.py +8 -0
  73. brain_wiki-0.1.0/src/brainwiki/bench/_generate.py +440 -0
  74. brain_wiki-0.1.0/src/brainwiki/bench/_report.py +191 -0
  75. brain_wiki-0.1.0/src/brainwiki/bench/_suites.py +959 -0
  76. brain_wiki-0.1.0/src/brainwiki/cli/__init__.py +7 -0
  77. brain_wiki-0.1.0/src/brainwiki/cli/_choose.py +46 -0
  78. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_bench.py +109 -0
  79. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_browse.py +231 -0
  80. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_consolidate.py +138 -0
  81. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_core.py +250 -0
  82. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_harvest.py +221 -0
  83. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_hosts.py +63 -0
  84. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_import.py +205 -0
  85. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_lint.py +135 -0
  86. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_read.py +168 -0
  87. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_runs.py +86 -0
  88. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_viz.py +73 -0
  89. brain_wiki-0.1.0/src/brainwiki/cli/_cmd_write.py +193 -0
  90. brain_wiki-0.1.0/src/brainwiki/cli/_main.py +1458 -0
  91. brain_wiki-0.1.0/src/brainwiki/cli/_output.py +19 -0
  92. brain_wiki-0.1.0/src/brainwiki/config/__init__.py +73 -0
  93. brain_wiki-0.1.0/src/brainwiki/config/_dirs.py +69 -0
  94. brain_wiki-0.1.0/src/brainwiki/config/_manifest.py +347 -0
  95. brain_wiki-0.1.0/src/brainwiki/config/_resolve.py +193 -0
  96. brain_wiki-0.1.0/src/brainwiki/config/_user.py +261 -0
  97. brain_wiki-0.1.0/src/brainwiki/consolidate/__init__.py +18 -0
  98. brain_wiki-0.1.0/src/brainwiki/consolidate/_apply.py +406 -0
  99. brain_wiki-0.1.0/src/brainwiki/consolidate/_packet.py +625 -0
  100. brain_wiki-0.1.0/src/brainwiki/consolidate/_pipeline.py +319 -0
  101. brain_wiki-0.1.0/src/brainwiki/consolidate/_presets.py +230 -0
  102. brain_wiki-0.1.0/src/brainwiki/consolidate/_review.py +162 -0
  103. brain_wiki-0.1.0/src/brainwiki/consolidate/_schema.py +153 -0
  104. brain_wiki-0.1.0/src/brainwiki/consolidate/_validate.py +267 -0
  105. brain_wiki-0.1.0/src/brainwiki/doctor.py +229 -0
  106. brain_wiki-0.1.0/src/brainwiki/engine.py +80 -0
  107. brain_wiki-0.1.0/src/brainwiki/errors.py +89 -0
  108. brain_wiki-0.1.0/src/brainwiki/format/__init__.py +112 -0
  109. brain_wiki-0.1.0/src/brainwiki/format/_agents_md.py +26 -0
  110. brain_wiki-0.1.0/src/brainwiki/format/_claims.py +95 -0
  111. brain_wiki-0.1.0/src/brainwiki/format/_document.py +203 -0
  112. brain_wiki-0.1.0/src/brainwiki/format/_edit.py +94 -0
  113. brain_wiki-0.1.0/src/brainwiki/format/_episode.py +67 -0
  114. brain_wiki-0.1.0/src/brainwiki/format/_fields.py +350 -0
  115. brain_wiki-0.1.0/src/brainwiki/format/_frontmatter.py +175 -0
  116. brain_wiki-0.1.0/src/brainwiki/format/_links.py +72 -0
  117. brain_wiki-0.1.0/src/brainwiki/format/_meta.py +67 -0
  118. brain_wiki-0.1.0/src/brainwiki/format/_normalize.py +70 -0
  119. brain_wiki-0.1.0/src/brainwiki/format/_relations.py +211 -0
  120. brain_wiki-0.1.0/src/brainwiki/format/_rules.py +41 -0
  121. brain_wiki-0.1.0/src/brainwiki/harvest.py +414 -0
  122. brain_wiki-0.1.0/src/brainwiki/hosts/__init__.py +24 -0
  123. brain_wiki-0.1.0/src/brainwiki/hosts/_antigravity.py +163 -0
  124. brain_wiki-0.1.0/src/brainwiki/hosts/_claude_code.py +174 -0
  125. brain_wiki-0.1.0/src/brainwiki/hosts/_codex.py +149 -0
  126. brain_wiki-0.1.0/src/brainwiki/hosts/_connect.py +590 -0
  127. brain_wiki-0.1.0/src/brainwiki/hosts/_detect.py +39 -0
  128. brain_wiki-0.1.0/src/brainwiki/hosts/_instructions.py +220 -0
  129. brain_wiki-0.1.0/src/brainwiki/hosts/_sessions.py +176 -0
  130. brain_wiki-0.1.0/src/brainwiki/ids.py +69 -0
  131. brain_wiki-0.1.0/src/brainwiki/importer/__init__.py +17 -0
  132. brain_wiki-0.1.0/src/brainwiki/importer/_episodes.py +119 -0
  133. brain_wiki-0.1.0/src/brainwiki/importer/_into.py +102 -0
  134. brain_wiki-0.1.0/src/brainwiki/importer/_normalize.py +66 -0
  135. brain_wiki-0.1.0/src/brainwiki/importer/_overlay.py +238 -0
  136. brain_wiki-0.1.0/src/brainwiki/importer/_survey.py +167 -0
  137. brain_wiki-0.1.0/src/brainwiki/index/__init__.py +51 -0
  138. brain_wiki-0.1.0/src/brainwiki/index/_brains.py +129 -0
  139. brain_wiki-0.1.0/src/brainwiki/index/_db.py +131 -0
  140. brain_wiki-0.1.0/src/brainwiki/index/_guards.py +154 -0
  141. brain_wiki-0.1.0/src/brainwiki/index/_neighbors.py +174 -0
  142. brain_wiki-0.1.0/src/brainwiki/index/_orient.py +402 -0
  143. brain_wiki-0.1.0/src/brainwiki/index/_read.py +290 -0
  144. brain_wiki-0.1.0/src/brainwiki/index/_resolver.py +147 -0
  145. brain_wiki-0.1.0/src/brainwiki/index/_scanner.py +668 -0
  146. brain_wiki-0.1.0/src/brainwiki/index/_schema.py +164 -0
  147. brain_wiki-0.1.0/src/brainwiki/index/_search.py +686 -0
  148. brain_wiki-0.1.0/src/brainwiki/index/_topics.py +253 -0
  149. brain_wiki-0.1.0/src/brainwiki/index/_written.py +29 -0
  150. brain_wiki-0.1.0/src/brainwiki/lifecycle.py +158 -0
  151. brain_wiki-0.1.0/src/brainwiki/lint/__init__.py +23 -0
  152. brain_wiki-0.1.0/src/brainwiki/lint/_catalog.py +90 -0
  153. brain_wiki-0.1.0/src/brainwiki/lint/_cross.py +649 -0
  154. brain_wiki-0.1.0/src/brainwiki/lint/_files.py +483 -0
  155. brain_wiki-0.1.0/src/brainwiki/lint/_fixes.py +89 -0
  156. brain_wiki-0.1.0/src/brainwiki/lint/_hook.py +58 -0
  157. brain_wiki-0.1.0/src/brainwiki/lint/_model.py +117 -0
  158. brain_wiki-0.1.0/src/brainwiki/lint/_reports.py +242 -0
  159. brain_wiki-0.1.0/src/brainwiki/lint/_runner.py +172 -0
  160. brain_wiki-0.1.0/src/brainwiki/logs.py +34 -0
  161. brain_wiki-0.1.0/src/brainwiki/mcp/__init__.py +7 -0
  162. brain_wiki-0.1.0/src/brainwiki/mcp/_server.py +917 -0
  163. brain_wiki-0.1.0/src/brainwiki/obsidian.py +98 -0
  164. brain_wiki-0.1.0/src/brainwiki/origin.py +110 -0
  165. brain_wiki-0.1.0/src/brainwiki/runs/__init__.py +21 -0
  166. brain_wiki-0.1.0/src/brainwiki/runs/_git.py +82 -0
  167. brain_wiki-0.1.0/src/brainwiki/runs/_lock.py +42 -0
  168. brain_wiki-0.1.0/src/brainwiki/runs/_record.py +145 -0
  169. brain_wiki-0.1.0/src/brainwiki/runs/_transaction.py +441 -0
  170. brain_wiki-0.1.0/src/brainwiki/runs/_undo.py +101 -0
  171. brain_wiki-0.1.0/src/brainwiki/setup_wizard.py +308 -0
  172. brain_wiki-0.1.0/src/brainwiki/store/__init__.py +7 -0
  173. brain_wiki-0.1.0/src/brainwiki/store/_local.py +153 -0
  174. brain_wiki-0.1.0/src/brainwiki/viz/__init__.py +9 -0
  175. brain_wiki-0.1.0/src/brainwiki/viz/_export.py +414 -0
  176. brain_wiki-0.1.0/src/brainwiki/viz/_lod.py +455 -0
  177. brain_wiki-0.1.0/src/brainwiki/viz/_server.py +327 -0
  178. brain_wiki-0.1.0/src/brainwiki/viz/app/BUILD_INFO.json +5 -0
  179. brain_wiki-0.1.0/src/brainwiki/viz/app/THIRD_PARTY_NOTICES.txt +1519 -0
  180. brain_wiki-0.1.0/src/brainwiki/viz/app/assets/index-gK1pnQdO.js +4496 -0
  181. brain_wiki-0.1.0/src/brainwiki/viz/app/assets/style-Cg8NUCst.css +1 -0
  182. brain_wiki-0.1.0/src/brainwiki/viz/app/index.html +14 -0
  183. brain_wiki-0.1.0/src/brainwiki/write/__init__.py +26 -0
  184. brain_wiki-0.1.0/src/brainwiki/write/_edits.py +769 -0
  185. brain_wiki-0.1.0/src/brainwiki/write/_episode.py +195 -0
  186. brain_wiki-0.1.0/src/brainwiki/write/_move.py +306 -0
  187. brain_wiki-0.1.0/src/brainwiki/write/_profiles.py +80 -0
  188. brain_wiki-0.1.0/src/brainwiki/write/_rules.py +228 -0
  189. brain_wiki-0.1.0/src/brainwiki/write/_secrets.py +108 -0
  190. brain_wiki-0.1.0/tests/conftest.py +38 -0
  191. brain_wiki-0.1.0/tests/fixtures/example-brain/AGENTS.md +3 -0
  192. brain_wiki-0.1.0/tests/fixtures/example-brain/archive/episodes/.keep +0 -0
  193. brain_wiki-0.1.0/tests/fixtures/example-brain/archive/episodes/2026/09/01M2Z44880248H248H248H248H.md +15 -0
  194. brain_wiki-0.1.0/tests/fixtures/example-brain/brain.toml +21 -0
  195. brain_wiki-0.1.0/tests/fixtures/example-brain/inbox/agents/.keep +0 -0
  196. brain_wiki-0.1.0/tests/fixtures/example-brain/inbox/episodes/2026/10/01M4KT3JPSB7BP2SNSCAVC2SFB.md +14 -0
  197. brain_wiki-0.1.0/tests/fixtures/example-brain/log.md +4 -0
  198. brain_wiki-0.1.0/tests/fixtures/example-brain/reports/.keep +0 -0
  199. brain_wiki-0.1.0/tests/fixtures/example-brain/rules.md +2 -0
  200. brain_wiki-0.1.0/tests/fixtures/example-brain/topics/budget/gpu-freeze.md +12 -0
  201. brain_wiki-0.1.0/tests/fixtures/example-brain/topics/budget/index.md +9 -0
  202. brain_wiki-0.1.0/tests/fixtures/example-brain/topics/search/fts5.md +26 -0
  203. brain_wiki-0.1.0/tests/fixtures/example-brain/topics/search/index.md +13 -0
  204. brain_wiki-0.1.0/tests/fixtures/example-brain/topics/search/ripgrep.md +12 -0
  205. brain_wiki-0.1.0/tests/fixtures/example-brain/topics/search/vector-only.md +11 -0
  206. brain_wiki-0.1.0/tests/fixtures/example-brain/topics/storage/index.md +9 -0
  207. brain_wiki-0.1.0/tests/fixtures/example-brain/topics/storage/sqlite-version-policy.md +12 -0
  208. brain_wiki-0.1.0/tests/test_bench.py +145 -0
  209. brain_wiki-0.1.0/tests/test_cli.py +108 -0
  210. brain_wiki-0.1.0/tests/test_consolidate.py +624 -0
  211. brain_wiki-0.1.0/tests/test_discovery.py +415 -0
  212. brain_wiki-0.1.0/tests/test_edits.py +299 -0
  213. brain_wiki-0.1.0/tests/test_format.py +285 -0
  214. brain_wiki-0.1.0/tests/test_foundation.py +228 -0
  215. brain_wiki-0.1.0/tests/test_harvest.py +249 -0
  216. brain_wiki-0.1.0/tests/test_import.py +172 -0
  217. brain_wiki-0.1.0/tests/test_index.py +192 -0
  218. brain_wiki-0.1.0/tests/test_integrations.py +548 -0
  219. brain_wiki-0.1.0/tests/test_lint.py +354 -0
  220. brain_wiki-0.1.0/tests/test_mcp.py +214 -0
  221. brain_wiki-0.1.0/tests/test_plugin.py +197 -0
  222. brain_wiki-0.1.0/tests/test_runs.py +292 -0
  223. brain_wiki-0.1.0/tests/test_secrets.py +33 -0
  224. brain_wiki-0.1.0/tests/test_sessions.py +241 -0
  225. brain_wiki-0.1.0/tests/test_topics.py +162 -0
  226. brain_wiki-0.1.0/tests/test_viz.py +942 -0
  227. brain_wiki-0.1.0/tests/test_write.py +403 -0
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "brain-wiki",
3
+ "owner": {
4
+ "name": "brain-wiki contributors"
5
+ },
6
+ "description": "brain-wiki: a local-first Markdown second brain shared by your AI agents.",
7
+ "version": "0.1.0",
8
+ "plugins": [
9
+ {
10
+ "name": "brain-wiki",
11
+ "source": "./",
12
+ "description": "A local-first second brain for AI agents, kept as plain Markdown that you own.",
13
+ "category": "productivity"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "brain-wiki",
3
+ "displayName": "brain-wiki",
4
+ "version": "0.1.0",
5
+ "description": "A local-first second brain for AI agents, kept as plain Markdown that you own.",
6
+ "author": {
7
+ "name": "brain-wiki contributors"
8
+ },
9
+ "repository": "https://github.com/brain-wiki/brain-wiki",
10
+ "license": "Apache-2.0",
11
+ "keywords": [
12
+ "memory",
13
+ "agents",
14
+ "mcp",
15
+ "markdown",
16
+ "obsidian",
17
+ "knowledge-base"
18
+ ]
19
+ }
@@ -0,0 +1,24 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .venv/
6
+ build/
7
+ dist/
8
+
9
+ # Tooling caches
10
+ .pytest_cache/
11
+ .ruff_cache/
12
+ .mypy_cache/
13
+ .coverage
14
+ htmlcov/
15
+
16
+ # Editors and OS
17
+ .idea/
18
+ .vscode/
19
+ .DS_Store
20
+
21
+ # Local only: drafts, test caches, and the lockfile (dependencies resolve from pyproject.toml)
22
+ .scratch/
23
+ .hypothesis/
24
+ uv.lock
@@ -0,0 +1,16 @@
1
+ {
2
+ "mcpServers": {
3
+ "brain-wiki": {
4
+ "type": "stdio",
5
+ "command": "uvx",
6
+ "args": [
7
+ "--from",
8
+ "brain-wiki==0.1.0",
9
+ "brain",
10
+ "mcp",
11
+ "--host",
12
+ "auto"
13
+ ]
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,7 @@
1
+ - id: brain-lint
2
+ name: brain-wiki lint
3
+ description: Check staged brain files against the brain-wiki format.
4
+ entry: brain lint --staged
5
+ language: python
6
+ pass_filenames: false
7
+ files: '(\.md|brain\.toml)$'
@@ -0,0 +1,125 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2026-10-14)
4
+
5
+ The first release of the 0.1 line. brain-wiki is alpha: expect breaking
6
+ changes before 1.0. Changes since 0.1.0.dev1:
7
+
8
+ - `brain obsidian [BRAIN]` opens the brain's folder as a vault in Obsidian,
9
+ adding it as a new vault the first time through the Obsidian CLI (or, without
10
+ the CLI, opening the vault manager with the step to take).
11
+ - `brain viz [BRAIN]` and `brain obsidian [BRAIN]` open the named brain, the
12
+ only brain, or with several, the one you pick from a list (the usual brain is
13
+ the default).
14
+ - `brain setup` asks first whether to create a new brain or adopt a folder you
15
+ have, names the brain after its folder, and shows the answer Enter picks
16
+ for every question.
17
+
18
+ ## 0.1.0.dev1 (2026-10-14)
19
+
20
+ - `brain setup --guide` prints the setup steps for an AI agent, so any agent
21
+ that can run commands can set brain-wiki up from one prompt, without the
22
+ plugin. Without a terminal, `brain setup` points to it, and an agent that
23
+ finds no brain is told to use the `brain-setup` skill or the guide.
24
+ - Every setup step is now a command, so the guide never edits config files:
25
+ `brain agents [list | grant | revoke]` changes what an app may do as an
26
+ undoable run, and `brain harvest enable | disable | route` configures
27
+ harvest. A refusal names the `brain agents grant` command that allows it.
28
+ `brain brains limit HOST BRAIN...` and `unlimit HOST` set which brains an
29
+ app may use.
30
+ - `brain setup` also asks what each connected app may do, grants the
31
+ `harvest` ability with harvest, and ends with what to try next.
32
+ - The CLI is built on Typer. Action commands are real subcommands with their
33
+ own help (`brain rules add --help`), and `brain --install-completion`
34
+ installs tab completion. `--brain`, `--as`, and `--json` still work before
35
+ or after the command. `brain --version` also prints the file format.
36
+ - Removed commands, and what replaces them: `brain version` → `brain
37
+ --version`; `brain list` → `brain brains` (also with `--as HOST`); `brain
38
+ notes` and `brain recent` → `brain search ""` with filters (e.g. `brain
39
+ search "" --since 7d`; browsing sorts by `recent`); `brain outline TARGET` →
40
+ `brain read TARGET --mode outline`.
41
+ - `brain rule` is now `brain rules`; `rule` still works as a hidden alias.
42
+ - `brain review` also covers rule proposals: `review list` shows them with
43
+ consolidation and edit proposals, marking each one's kind, and `review
44
+ show`, `accept`, and `reject` take a rule proposal's id.
45
+ - `brain import --phase` given with a mode other than `--overlay` is a usage
46
+ error even when it is `--phase 0`.
47
+ - Harvest routes are a fallback: a project's `.brain-wiki.toml` now wins over
48
+ a catch-all route such as `~/**`.
49
+
50
+ Fixes from an audit of every command, each with a regression test:
51
+
52
+ - **Data loss:** undo could delete notes when the first write came before
53
+ any full scan. In a git brain, undo lost files git never tracked (inbox
54
+ episodes, proposals), left deletions staged, and failed for any run but the
55
+ newest. Undo now restores from the run's saved copies in every brain.
56
+ - **Safety:** `brain review accept` trusted the packet inside the proposal
57
+ file, so a forged one could write `rules.md`; it now rebuilds the packet
58
+ from the brain. `--as HOST` is enforced by every write command.
59
+ - `brain import --apply --dry-run` applied the import; a failed `brain
60
+ brains rename` deleted the brain's entry; overlay phases 1–3 never ran in
61
+ a git repository; `--to-episodes` turned frontmatter into an episode.
62
+ - `tags`, `types`, `orphans`, and `unresolved` showed a stale index; `search
63
+ --where` ignored tags, aliases, title, and id; `read --mode raw` was not
64
+ the raw file; `doctor` counted hubs as notes.
65
+ - `brain check` recorded edits that lint rejects; `brain mv` of a topic left
66
+ its `brain.toml` entry behind; topics with `review = "always"` skipped
67
+ review for new notes.
68
+ - `brain connect` broke a project-scope install on a later user-scope
69
+ connect, did not restore config files byte for byte, and crashed on
70
+ malformed JSON.
71
+ - Unexpected errors exit 10 with a log reference instead of a traceback;
72
+ conflicts report `conflict:`, and only stale data reports `stale:`.
73
+
74
+ ## 0.1.0.dev0 (2026-10-14)
75
+
76
+ First release.
77
+
78
+ - **Brain format**: plain Markdown notes with frontmatter, claims with
79
+ provenance, and typed relations (`part_of`, `depends_on`,
80
+ `conflicts_with`, `supersedes`, `related_to`, and their inverses);
81
+ topics as folders, nested to any depth; immutable inbox episodes;
82
+ `rules.md`; a managed `AGENTS.md` block.
83
+ - **Index and retrieval**: SQLite FTS5 index outside the brain, freshness
84
+ checks, guard co-retrieval (superseding and conflicting notes come with
85
+ every hit), search filters, facets, and intents, orientation, and
86
+ Obsidian-style browsing (`brain topics`, `notes`, `links`, `backlinks`,
87
+ `tags`, and more).
88
+ - **Write path**: one episode writer with server-set provenance, secret
89
+ redaction, size caps, and dedupe; episodes dropped in by hand count as
90
+ untrusted; checked direct edits (`brain check`, `brain restore`, a
91
+ per-topic `agent_edits` policy), which agents may make by default; rules
92
+ that need the user's words and confirmation; `brain mv`.
93
+ - **Runs**: every curated change is locked, gated by lint, recorded with
94
+ pre-images, committed to git when the brain is a repository, and
95
+ undoable.
96
+ - **Consolidation**: packets with short handles, a per-op validator, a
97
+ deterministic writer that never deletes text, and review proposals. Your
98
+ agent consolidates in its session over MCP; `brain consolidate --prepare`
99
+ and `--apply` drive it by hand.
100
+ - **Lint and reports**: the BW rule catalog with strict and migrate
101
+ profiles, cached whole-brain lint, safe fixes as one run, staged-file
102
+ lint and a pre-commit hook, and browsable reports.
103
+ - **Agents**: a stdio MCP server with thirteen tools and three prompts;
104
+ `brain connect` for Claude Code, Codex, Antigravity, OpenClaw, and
105
+ Cursor, with instructions placed where each host reads them; session readers and
106
+ harvest for Claude Code, Codex, and Antigravity, with headless presets
107
+ for large backfills; origin lookup; a plugin bundle with three skills;
108
+ `brain setup` and `brain doctor`.
109
+ - **Import**: overlay adoption of Obsidian vaults in phases, copying into
110
+ a brain, documents and agent memory files as episodes.
111
+ - **Visualizer**: `brain viz`, a local read-only 3D map of groups,
112
+ topics, folders, and notes with typed relations and issue highlighting,
113
+ and HTML, JSON, and GraphML export.
114
+ - **Bench**: offline retrieval, lint, and performance suites, and
115
+ model-backed consolidation scenarios through headless presets.
116
+
117
+ Known limitations:
118
+
119
+ - No privacy levels inside a brain: every agent that may use a brain
120
+ reads all of it. Keep separate lives in separate brains
121
+ ([proposal](https://github.com/brain-wiki/brain-wiki/blob/main/docs/proposals/privacy.md)).
122
+ - Maintenance runs when you ask your agent; there is no scheduler
123
+ ([proposal](https://github.com/brain-wiki/brain-wiki/blob/main/docs/proposals/scheduled-maintenance.md)).
124
+ - Chat apps that need a remote MCP server (ChatGPT, claude.ai, the Gemini
125
+ app) are not supported ([proposal](https://github.com/brain-wiki/brain-wiki/blob/main/docs/proposals/remote-mcp.md)).
@@ -0,0 +1,112 @@
1
+ # Contributing to brain-wiki
2
+
3
+ ## Setup
4
+
5
+ ```sh
6
+ uv sync # creates .venv with dev dependencies
7
+ uv run brain --help
8
+ ```
9
+
10
+ ## Checks
11
+
12
+ ```sh
13
+ uv run scripts/check.py # everything CI runs: lint, format, tests, plugin sync, docs brain, visualizer bundle, package contents
14
+ uv run pytest -q # tests only
15
+ uv run ruff format src tests scripts && uv run ruff check src tests scripts # format, then lint
16
+ ```
17
+
18
+ After editing `docs/`, regenerate the docs brain (`docs-brain/`, the docs as a
19
+ brain) with `uv run scripts/build_docs_brain.py`; CI fails when it is stale.
20
+ After changing the version or anything under `src/brainwiki/assets/`, run
21
+ `uv run scripts/sync_versions.py`.
22
+
23
+ ### The visualizer front end
24
+
25
+ `brain viz` serves a prebuilt bundle from `src/brainwiki/viz/app/`, so users
26
+ never need Node. Its source is the
27
+ [brain-wiki-viz](https://github.com/brain-wiki/brain-wiki-viz) repository.
28
+ Clone it next to this one, then:
29
+
30
+ ```sh
31
+ cd ../brain-wiki-viz
32
+ npm ci # Node 20.19+, or 22.12+ on Node 22
33
+ npm run check # type check, unit tests, lockfile check
34
+ git commit … # commit the source first: the build records its commit
35
+ npm run build # writes ../brain-wiki/src/brainwiki/viz/app/
36
+ ```
37
+
38
+ Commit the rebuilt bundle here. `scripts/check.py` checks that the bundle is
39
+ complete and was built from a clean brain-wiki-viz commit
40
+ (`BUILD_INFO.json`); `scripts/check_viz.py --source ../brain-wiki-viz`
41
+ also rebuilds that checkout and fails if the result differs. For live reload,
42
+ run `brain viz --no-open --port 8765` here and `npm run dev` there, then open
43
+ the dev server with the token from `brain viz` (`?t=…`).
44
+
45
+ ## Releasing
46
+
47
+ CI (`.github/workflows/ci.yml`) runs `scripts/check.py` on Linux and macOS
48
+ with Python 3.11 and 3.13, runs brain-wiki-viz's checks at the bundle's
49
+ commit, and checks that the bundle rebuilds from it. A version tag runs
50
+ `.github/workflows/release.yml`: it checks the tag against the version and
51
+ the changelog, runs the checks, builds, publishes to PyPI with trusted
52
+ publishing, and creates the GitHub release from the changelog entry. Its
53
+ MCP Registry job is turned off until the project decides to be listed.
54
+
55
+ 1. Set `version` in `pyproject.toml` to `X.Y.Z`, or a development release
56
+ such as `X.Y.Z.devN`, and date its changelog entry: `## X.Y.Z (YYYY-MM-DD)`.
57
+ A development release goes to PyPI like any other, and pip and uv install
58
+ it while no final release exists. The GitHub release follows the same
59
+ rule: it is marked Latest until a final release exists, and a
60
+ pre-release after that.
61
+ 2. `uv run scripts/sync_versions.py`, then commit.
62
+ 3. `git tag vX.Y.Z && git push origin main vX.Y.Z`.
63
+ 4. Move `main` to the next development version (`X.Y.(Z+1).dev0` after
64
+ `X.Y.Z`, `X.Y.Z.dev(N+1)` after `X.Y.Z.devN`) with a new `(unreleased)`
65
+ entry, run `sync_versions.py`, commit, and push. The plugin files keep
66
+ pointing at the newest dated release, because marketplaces install the
67
+ plugin from `main`.
68
+
69
+ One-time setup: a trusted publisher on PyPI for this repository, workflow
70
+ `release.yml`, environment `pypi` (and that environment in the GitHub
71
+ repository settings); private vulnerability reporting turned on (see
72
+ `SECURITY.md`).
73
+
74
+ ## Where things are
75
+
76
+ | Path | What |
77
+ |---|---|
78
+ | `docs/design/` | The design of what is implemented. Read the relevant document before changing behavior, and update it in the same change. |
79
+ | `docs/proposals/` | Designs not yet built, and the backlog. Building one moves its content into `docs/design/`. |
80
+ | `src/brainwiki/` | The package (layout in `docs/design/13-engineering.md` §2) |
81
+ | `src/brainwiki/assets/` | Prompts the engine uses; the skills' copies are generated from them |
82
+ | `plugin.json`, `mcp.json`, `.mcp.json`, `mcp_config.json`, `rules/`, `skills/`, `.claude-plugin/`, `server.json` | The plugin, served from the repository root. These names, and `hooks/` and `hooks.json`, are reserved by hosts; the bundle ships no hooks. |
83
+ | `src/brainwiki/viz/app/` | The visualizer's built bundle (source: brain-wiki-viz); do not edit by hand |
84
+ | `scripts/sync_versions.py` | Writes the version into every manifest and regenerates skill references (`--check` in CI) |
85
+ | `tests/fixtures/` | Synthetic fixtures only |
86
+
87
+ ## Rules
88
+
89
+ - **No real personal data anywhere**: examples and fixtures use the
90
+ fictional notes app "Lumen" and generic paths.
91
+ - **Test fixtures never contain credentials**, even fake ones in their real
92
+ shape; build such strings at runtime in the test.
93
+ - **Minimal visibility.** Modules inside a package are private
94
+ (`_name.py`); a package's API is what its `__init__.py` re-exports, and
95
+ code outside the package imports only that (tests may reach private
96
+ modules). Inside a module, a name is public only when another module, a
97
+ test, or a script uses it. `scripts/check_visibility.py` (part of
98
+ `scripts/check.py`) enforces both; `docs/design/13-engineering.md` §2 has
99
+ the details.
100
+ - **Writers never reflow text.** Anything that edits a note changes only the
101
+ lines it must; add a test that untouched lines survive byte for byte.
102
+ - **Every curated change goes through `runs.Run`** so it is recorded,
103
+ locked, gated by lint, and undoable.
104
+ - **The CLI starts fast**: subcommand modules are imported lazily, and only
105
+ `brain mcp` imports the MCP SDK (`docs/design/07-interfaces.md` §2.4).
106
+ - One version number, in `pyproject.toml`; run `scripts/sync_versions.py`
107
+ after changing it or any file under `src/brainwiki/assets/`.
108
+
109
+ ## Commits and pull requests
110
+
111
+ Conventional Commits (`feat(lint): …`, `fix(index): …`). The message says
112
+ why the change exists, not what the diff shows.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.5
2
+ Name: brain-wiki
3
+ Version: 0.1.0
4
+ Summary: A local-first second brain for AI agents, kept as plain Markdown that you own.
5
+ Project-URL: Homepage, https://github.com/brain-wiki/brain-wiki
6
+ Project-URL: Documentation, https://github.com/brain-wiki/brain-wiki/tree/main/docs/user
7
+ Project-URL: Repository, https://github.com/brain-wiki/brain-wiki
8
+ Project-URL: Issues, https://github.com/brain-wiki/brain-wiki/issues
9
+ Project-URL: Changelog, https://github.com/brain-wiki/brain-wiki/blob/main/CHANGELOG.md
10
+ Author: brain-wiki contributors
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: agents,knowledge-base,markdown,mcp,memory,obsidian
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: End Users/Desktop
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3 :: Only
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
27
+ Requires-Python: >=3.11
28
+ Requires-Dist: filelock>=3.12
29
+ Requires-Dist: jsonschema>=4.20
30
+ Requires-Dist: mcp<3,>=2.3
31
+ Requires-Dist: pyyaml>=6.0
32
+ Requires-Dist: tomlkit>=0.12
33
+ Requires-Dist: typer<1,>=0.26
34
+ Description-Content-Type: text/markdown
35
+
36
+ <!-- mcp-name: io.github.brain-wiki/brain-wiki -->
37
+
38
+ <p align="center">
39
+ <img src="https://raw.githubusercontent.com/brain-wiki/brain-wiki/main/.github/assets/logo.svg" alt="brain-wiki" width="96" height="96">
40
+ </p>
41
+
42
+ <h1 align="center">brain-wiki</h1>
43
+
44
+ <p align="center"><strong>One long-term memory for all your AI agents, kept as plain Markdown that you own.</strong></p>
45
+
46
+ <p align="center">
47
+ <a href="https://github.com/brain-wiki/brain-wiki/actions/workflows/ci.yml"><img src="https://github.com/brain-wiki/brain-wiki/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
48
+ <a href="https://pypi.org/project/brain-wiki/"><img src="https://img.shields.io/pypi/v/brain-wiki" alt="PyPI"></a>
49
+ <a href="https://pypi.org/project/brain-wiki/"><img src="https://img.shields.io/pypi/pyversions/brain-wiki" alt="Python"></a>
50
+ <a href="https://github.com/brain-wiki/brain-wiki/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License"></a>
51
+ </p>
52
+
53
+ Your agents (Claude Code, Codex, Antigravity, Cursor, OpenClaw, or any MCP
54
+ client) share one brain: a folder of Markdown notes they search before
55
+ answering and keep up to date as they work. It runs on your machine, needs no
56
+ server or API keys, and opens in Obsidian.
57
+
58
+ - **Plain files.** Read, edit, diff, and sync the brain like any folder, or adopt an Obsidian vault as it is.
59
+ - **Knows what changed.** Search returns a note together with the notes that replace or contradict it.
60
+ - **Safe to let agents write.** Changes are checked, logged, and undoable, and committed when the brain is a git repository.
61
+ - **No network calls.** Your own agent does the thinking; brain-wiki stores and checks.
62
+
63
+ ## Quick start
64
+
65
+ Needs Python 3.11+ and [uv](https://docs.astral.sh/uv/).
66
+
67
+ **1. Install.**
68
+
69
+ ```sh
70
+ uv tool install brain-wiki
71
+ ```
72
+
73
+ **2. Set it up.**
74
+
75
+ - **Recommended:** paste this into your agent (Claude Code, Codex,
76
+ Antigravity, Cursor, OpenClaw, ...):
77
+
78
+ > Set up brain-wiki by running `brain setup --guide` and following it.
79
+
80
+ - **Or, in a terminal:** run `brain setup`, which asks the same questions
81
+ step by step.
82
+
83
+ Either way, setup explains each choice (where the brain lives, which agents to
84
+ connect, what each may do) and shows every change before making it.
85
+
86
+ **3. Use it in your agent.**
87
+
88
+ > Remember that I prefer pnpm over npm, and that our team ships on Thursdays.
89
+
90
+ > What did we decide about the database migration last week?
91
+
92
+ > Maya moved to the platform team. Update her note.
93
+
94
+ > Consolidate my brain.
95
+
96
+ **4. See your brain.** `brain viz` opens a local 3D map of your notes, and
97
+ `brain obsidian` opens the brain's folder as a vault in Obsidian. With several
98
+ brains, both ask which one, or name it: `brain viz work`.
99
+
100
+ ## How it works
101
+
102
+ ```text
103
+ agents ──log──► inbox ──consolidate──► notes (topics/*.md) ◄── you, in Obsidian
104
+ ▲ (checked ops) │
105
+ └────────────── search · read ───────────────┘
106
+ ```
107
+
108
+ Agents log what they learn to an inbox. When you ask, your agent folds the
109
+ inbox into topic notes through small operations that brain-wiki checks before
110
+ writing, and `brain undo` reverses any change.
111
+
112
+ ## Status
113
+
114
+ Alpha: expect breaking changes before 1.0. Known limits:
115
+
116
+ - No access scopes inside a brain: every connected agent reads all of it. Keep work and personal notes in separate brains.
117
+ - Maintenance runs when you ask; there is no scheduler.
118
+ - Chat apps that need a remote MCP server (ChatGPT, claude.ai, the Gemini app) are not supported yet.
119
+
120
+ ## Learn more
121
+
122
+ [Getting started](https://github.com/brain-wiki/brain-wiki/blob/main/docs/user/getting-started.md) ·
123
+ [Agents](https://github.com/brain-wiki/brain-wiki/blob/main/docs/user/agents.md) ·
124
+ [Maintenance](https://github.com/brain-wiki/brain-wiki/blob/main/docs/user/maintenance.md) ·
125
+ [Import a vault](https://github.com/brain-wiki/brain-wiki/blob/main/docs/user/import.md) ·
126
+ [Privacy](https://github.com/brain-wiki/brain-wiki/blob/main/docs/user/privacy.md) ·
127
+ [Reference](https://github.com/brain-wiki/brain-wiki/blob/main/docs/user/reference.md) ·
128
+ [Design](https://github.com/brain-wiki/brain-wiki/blob/main/docs/design/README.md) ·
129
+ [Changelog](https://github.com/brain-wiki/brain-wiki/blob/main/CHANGELOG.md)
130
+
131
+ [Contributing](https://github.com/brain-wiki/brain-wiki/blob/main/CONTRIBUTING.md) ·
132
+ [Security](https://github.com/brain-wiki/brain-wiki/blob/main/SECURITY.md) ·
133
+ [Apache 2.0](https://github.com/brain-wiki/brain-wiki/blob/main/LICENSE)
134
+ ([visualizer notices](https://github.com/brain-wiki/brain-wiki/blob/main/src/brainwiki/viz/app/THIRD_PARTY_NOTICES.txt))