brain-framework 20.0.2__tar.gz → 21.0.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 (76) hide show
  1. brain_framework-21.0.0/PKG-INFO +269 -0
  2. brain_framework-21.0.0/README.md +239 -0
  3. {brain_framework-20.0.2 → brain_framework-21.0.0}/pyproject.toml +1 -1
  4. {brain_framework-20.0.2 → brain_framework-21.0.0}/pyproject.toml.orig +1 -1
  5. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/__init__.py +1 -1
  6. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/assistants.py +167 -52
  7. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/channels.py +4 -2
  8. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/cli.py +160 -21
  9. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/collect.py +93 -35
  10. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/health.py +2 -0
  11. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/history.py +2 -0
  12. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/mcp.py +2 -1
  13. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/models.py +103 -39
  14. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/pages.py +31 -10
  15. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/records.py +133 -0
  16. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/replies.py +26 -0
  17. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/retrieve.py +41 -6
  18. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/runtime.py +85 -14
  19. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/schemas.py +5 -2
  20. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-action/SKILL.md +5 -5
  21. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-action/references/handoff.md +1 -1
  22. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-maintain/SKILL.md +4 -3
  23. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-maintain/references/integrations.md +8 -5
  24. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-setup/SKILL.md +2 -2
  25. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-setup/references/discovery.md +3 -3
  26. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/SKILL.md +6 -6
  27. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/references/learn.md +1 -1
  28. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/storage.py +11 -0
  29. brain_framework-21.0.0/src/bf/usage.py +346 -0
  30. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/validate.py +10 -33
  31. brain_framework-20.0.2/PKG-INFO +0 -276
  32. brain_framework-20.0.2/README.md +0 -246
  33. brain_framework-20.0.2/src/bf/usage.py +0 -133
  34. {brain_framework-20.0.2 → brain_framework-21.0.0}/LICENSE +0 -0
  35. {brain_framework-20.0.2 → brain_framework-21.0.0}/THIRD_PARTY_NOTICES.md +0 -0
  36. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/__main__.py +0 -0
  37. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/config.py +0 -0
  38. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/evaluate.py +0 -0
  39. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/graph.py +0 -0
  40. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/index.py +0 -0
  41. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/install.py +0 -0
  42. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/links.py +0 -0
  43. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/markdown.py +0 -0
  44. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/messages.py +0 -0
  45. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/ontology.py +0 -0
  46. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/py.typed +0 -0
  47. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/README.md +0 -0
  48. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-action/references/actions.md +0 -0
  49. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-action/references/context.md +0 -0
  50. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-action/scripts/check-handoff.py +0 -0
  51. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-action/scripts/new-action.py +0 -0
  52. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-action/templates/action.md +0 -0
  53. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-maintain/references/conflicts.md +0 -0
  54. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-maintain/references/operations.md +0 -0
  55. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-setup/references/import.md +0 -0
  56. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-setup/references/scan.md +0 -0
  57. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-setup/scripts/inventory.py +0 -0
  58. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/references/consolidate.md +0 -0
  59. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/references/decisions.md +0 -0
  60. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/references/evidence.md +0 -0
  61. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/references/links.md +0 -0
  62. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/references/retrieval.md +0 -0
  63. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/references/review.md +0 -0
  64. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/references/share.md +0 -0
  65. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/scripts/evidence.py +0 -0
  66. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/scripts/guarded-write.py +0 -0
  67. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/templates/concept.md +0 -0
  68. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/skills/bf-use/templates/project.md +0 -0
  69. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/starter/AGENTS.md +0 -0
  70. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/starter/concepts/index.md +0 -0
  71. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/starter/concepts/welcome.md +0 -0
  72. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/starter/evals/retrieval.yaml +0 -0
  73. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/starter/gitignore +0 -0
  74. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/update.py +0 -0
  75. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/watch.py +0 -0
  76. {brain_framework-20.0.2 → brain_framework-21.0.0}/src/bf/watch_settings.py +0 -0
@@ -0,0 +1,269 @@
1
+ Metadata-Version: 2.4
2
+ Name: brain-framework
3
+ Version: 21.0.0
4
+ Summary: 🧠 Brain Framework: from information to informed actions.
5
+ Keywords: ai,ai-agents,agent-memory,context-engineering,knowledge-management,local-first,mcp,model-context-protocol,python,second-brain
6
+ Author: Médéric Hurier
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ License-File: THIRD_PARTY_NOTICES.md
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Typing :: Typed
17
+ Requires-Dist: markdown-it-py>=4.2.0,<5
18
+ Requires-Dist: pydantic>=2.13.5,<3
19
+ Requires-Dist: pyyaml>=6.0.3,<7
20
+ Requires-Dist: rich>=15.0.0,<16
21
+ Requires-Dist: typer>=0.27.2,<1
22
+ Requires-Dist: mcp>=2.1.1,<3 ; extra == 'mcp'
23
+ Requires-Python: >=3.14
24
+ Project-URL: Changelog, https://fmind.github.io/brain-framework/changelog/
25
+ Project-URL: Documentation, https://fmind.github.io/brain-framework/
26
+ Project-URL: Issues, https://github.com/fmind/brain-framework/issues
27
+ Project-URL: Repository, https://github.com/fmind/brain-framework
28
+ Provides-Extra: mcp
29
+ Description-Content-Type: text/markdown
30
+
31
+ <p align="center">
32
+ <img
33
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-framework.svg"
34
+ alt="Brain Framework: a robot head whose shell opens on a brain, above twin aperture eyes"
35
+ width="256"
36
+ height="256"
37
+ >
38
+ </p>
39
+
40
+ # Brain Framework 🧠
41
+
42
+ **🧠 Brain Framework: from information to informed actions.**
43
+
44
+ A second brain for you, your team and your AI agents, on your own computer. Gather what matters from every tool you work with, connect it into one knowledge graph and open your agent there, so it acts with everything you know instead of starting from scratch.
45
+
46
+ [![CI](https://github.com/fmind/brain-framework/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fmind/brain-framework/actions/workflows/ci.yml) [![PyPI](https://img.shields.io/pypi/v/brain-framework?color=174EA6)](https://pypi.org/project/brain-framework/) [![Python](https://img.shields.io/pypi/pyversions/brain-framework)](https://pypi.org/project/brain-framework/) [![License: MIT](https://img.shields.io/badge/license-MIT-174EA6)](https://github.com/fmind/brain-framework/blob/main/LICENSE)
47
+
48
+ [Try it](https://github.com/fmind/brain-framework#try-it) · [How it works](https://github.com/fmind/brain-framework#how-it-works) · [Agents](https://github.com/fmind/brain-framework#open-your-agent-in-your-brain) · [Your tools](https://github.com/fmind/brain-framework#bring-your-tools) · [Good to know](https://github.com/fmind/brain-framework#good-to-know) · [Documentation](https://fmind.github.io/brain-framework/)
49
+
50
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
51
+ <img
52
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg"
53
+ alt="The Brain Framework loop: sensors gather evidence from your tools into a brain folder; bf.yaml declares the ontology, sensors, routines, assistants, channels and watch settings; memories, projects, concepts and actions form a knowledge graph; agents read that context, act through the same CLIs, APIs, MCP servers and browsers, and write outcomes back."
54
+ width="960"
55
+ >
56
+ </a>
57
+
58
+ ## Stop starting from scratch
59
+
60
+ Open an agent anywhere on your computer and it knows nothing: not your projects, not last week's decisions, not what changed overnight. It asks you to paste context, queries the same APIs again and forgets its conclusion when the session ends.
61
+
62
+ Brain Framework (BF) changes the starting point. Create a brain, a plain folder, and let small programs called sensors fill it with evidence from your tools. Open your agent there: it searches your projects, decisions and collected records, cites where each fact comes from, acts through the tools you already use and writes the outcome back for the next session.
63
+
64
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/blank-vs-brain.svg">
65
+ <img
66
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/blank-vs-brain.svg"
67
+ alt="Two fictional sessions ask whether the new website can launch. Opened anywhere, the agent asks you to paste Jira, GitHub and Google Cloud. Opened in a brain, it reads project:new-website and answers: not yet, Jira still blocks launch on accessibility review, citing each record, then notes the launch hold in the project note."
68
+ width="960"
69
+ >
70
+ </a>
71
+
72
+ Once you write or adapt a sensor for each source, questions that took a tour of your tools become one prompt:
73
+
74
+ | Ask your agent | Gathered from |
75
+ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
76
+ | “Can the new website launch?” | The brief in Google Drive, the review in Jira, the pull request in GitHub and the deployment in Google Cloud. |
77
+ | “Prepare my two o'clock meeting.” | The Calendar event, the last meeting notes, the attendees' recent mail and chat threads. |
78
+ | “Where did we leave the migration?” | The last action's next step, the spec and the latest commits. |
79
+ | “What changed in my stack this week?” | Release notes, security advisories, Dependabot alerts and model deprecation pages. |
80
+
81
+ ## Try it
82
+
83
+ You need Linux or macOS and [uv](https://docs.astral.sh/uv/getting-started/installation/). No model or provider account is required.
84
+
85
+ ```bash
86
+ uv tool install --python 3.14 brain-framework
87
+ bf init ~/brain
88
+ cd ~/brain
89
+ ```
90
+
91
+ Save a decision as `projects/new-website.md`:
92
+
93
+ ```markdown
94
+ ---
95
+ type: project
96
+ status: draft
97
+ updated: 2026-11-01
98
+ summary: Launch a product website that helps visitors understand the product.
99
+ ---
100
+
101
+ # New website
102
+
103
+ ## Decision
104
+
105
+ Start with a single product page because visitors need a clear explanation before signing up.
106
+
107
+ ## Next actions
108
+
109
+ - [ ] Draft the product page.
110
+ ```
111
+
112
+ Find its reason, then read the exact section:
113
+
114
+ ```bash
115
+ bf search "visitors clear explanation"
116
+ bf read projects/new-website.md#decision
117
+ ```
118
+
119
+ Search prints compact JSON on one line; selected fields:
120
+
121
+ ```json
122
+ {
123
+ "items": [
124
+ {
125
+ "ref": "projects/new-website.md#decision",
126
+ "title": "New website — Decision",
127
+ "excerpt": "Start with a single product page because visitors need a clear explanation before signing up."
128
+ }
129
+ ]
130
+ }
131
+ ```
132
+
133
+ [Getting started](https://fmind.github.io/brain-framework/docs/getting-started/) continues with validation and a first collected source. The [four-tool walkthrough](https://fmind.github.io/brain-framework/docs/context-hub/) runs the whole loop on fictional Workspace, Jira, GitHub and Gcloud records.
134
+
135
+ ## How it works
136
+
137
+ A brain is a detective's case file in plain files: evidence bags labeled with where and when each item was collected, case notes with the current theory and next step, and string from each conclusion to its evidence. Five steps run in a loop: **gather → normalize → organize and connect → act → learn.**
138
+
139
+ | Folder | Holds | Example |
140
+ | ----------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- |
141
+ | `memories/` | One JSON file per collected item: what a source said, its URL and its time. | The Jira launch review, as collected on Tuesday. |
142
+ | `sensors/` | Programs you review that print JSON records from a tool. | A script that lists the Jira issues of your projects. |
143
+ | `projects/` | One Markdown note per project: goal, current state, decisions and tasks. | “Start with a single product page because visitors need…” |
144
+ | `concepts/` | Knowledge you will reuse elsewhere, with its evidence and limits. | “Explain the product before asking for signup.” |
145
+ | `actions/` | One work session: objective, inputs, outputs, outcome and next step. | `actions/2026-09-27_website-review/ACTION.md`, resumed the next day. |
146
+ | `routines/` | Deterministic programs you review, run on demand or on a schedule. | A weekly review that lists projects to revisit. |
147
+
148
+ Notes are Markdown with YAML metadata, records are JSON, and `bf validate` checks both. The search cache in `.bf/` is disposable and rebuilds itself from the files. Assistants, channels and retrieval checks have their own folders: see the [directory reference](https://fmind.github.io/brain-framework/docs/brain/#directory-reference).
149
+
150
+ `bf.yaml` declares what the brain knows how to name, collect and check:
151
+
152
+ ```yaml
153
+ # https://fmind.github.io/brain-framework/docs/configuration/
154
+ version: 8
155
+ name: brain
156
+ fields: # the ontology: shared fields and typed relations
157
+ project: { type: identity, cardinality: one, relation: true, description: Project the source names. }
158
+ kind: { type: string, cardinality: one, description: Common kind of item. }
159
+ status: { type: string, cardinality: one, description: The item's state in its own tool. }
160
+ sensors: # what to collect, how often, mapped into the ontology
161
+ jira:
162
+ command: [sensors/jira.py]
163
+ mode: snapshot
164
+ refresh: 3600
165
+ fields:
166
+ project: { path: /attributes/workstream }
167
+ kind: { value: issue }
168
+ status: { path: /attributes/status }
169
+ routines: # deterministic reviews and checks
170
+ weekly-review:
171
+ command: [routines/weekly-review.py, "{{brain}}", "{{end}}"]
172
+ refresh: 604800
173
+ output: action
174
+ watch: # keep sources fresh and alert on failure
175
+ interval: 300
176
+ notifications: failure
177
+ ```
178
+
179
+ BF runs each program without a shell, bounds its time and output, validates what it prints and keeps its stderr in `logs/`. A failed run preserves the evidence already saved. See [sensors](https://fmind.github.io/brain-framework/docs/sensors/), [routines](https://fmind.github.io/brain-framework/docs/routines/) and [assistants and channels](https://fmind.github.io/brain-framework/docs/prompts/).
180
+
181
+ ### One vocabulary, set at collection
182
+
183
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/one-vocabulary.svg">
184
+ <img
185
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/one-vocabulary.svg"
186
+ alt="Workspace, Jira, GitHub and Google Cloud name the project project, workstream, repository_project and service_project. bf.yaml maps them once, at collection, to shared fields, so every record points to project:new-website and one read assembles all four."
187
+ width="960"
188
+ >
189
+ </a>
190
+
191
+ Each tool names things its own way. BF translates once, at the door: each sensor maps its provider's fields into the shared `fields:` of `bf.yaml`, and BF validates every value before saving the record. Because `project` is a relation, records from all four tools point to the same identity, `project:new-website`. People and repositories work the same way. Mappings are explicit: BF never decides that two similar names are the same subject. See [shared fields and sensor mappings](https://fmind.github.io/brain-framework/docs/schema/#shared-fields-and-sensor-mappings).
192
+
193
+ ### A knowledge graph across sources
194
+
195
+ Grep finds words, not connections. BF indexes every explicit connection (Markdown links, declared identities and relation fields) into a knowledge graph, so one read assembles a subject across sources:
196
+
197
+ ```bash
198
+ bf read project:new-website
199
+ ```
200
+
201
+ The reply holds the project note and its backlinks, grouped by relation: the Jira review `In review`, the GitHub pull request `merged`, the Gcloud deployment `healthy` and the Workspace brief `approved`. Each claim keeps the note section or record that asserted it, so an answer can always cite its evidence. See [links and relations](https://fmind.github.io/brain-framework/docs/links/#name-a-relation).
202
+
203
+ ### Act, then learn
204
+
205
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/evidence-review.svg">
206
+ <img
207
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/evidence-review.svg"
208
+ alt="Four steps: a sensor collects the Jira review In review and you record that launch is on hold; the review moves to Done and bf collect jira updates the record; bf read flags the project with review true, reason newer_evidence and newer jira:review; you update the conclusion and the flag clears."
209
+ width="960"
210
+ >
211
+ </a>
212
+
213
+ People and agents do the work through the CLIs, APIs and MCP servers they already use. An action keeps each session's objective, inputs, outputs and next step, so the next session resumes instead of starting over. When a linked record changes after a project's last edit, `bf read` flags the project for review and names the record to read first, so a decision does not silently outlive its evidence. Try it in the [four-tool walkthrough](https://fmind.github.io/brain-framework/docs/context-hub/#follow-a-change).
214
+
215
+ ## Open your agent in your brain
216
+
217
+ Use the brain with [Claude Code](https://code.claude.com/docs/en/overview), [Codex](https://openai.com/codex/), [GitHub Copilot](https://github.com/features/copilot) or any agent that can run a command. Start it in `~/brain` and ask:
218
+
219
+ > Use the bf CLI. Find why we chose a single product page. Read the source, cite its ref and tell me the project's next action.
220
+
221
+ It should cite `projects/new-website.md#decision` and name “Draft the product page.” For ongoing use, install the packaged skills into your host's skills folder, such as `~/.claude/skills` for Claude Code:
222
+
223
+ ```bash
224
+ bf skills ~/.agents/skills
225
+ ```
226
+
227
+ | Skill | Teaches your agent to… |
228
+ | ------------- | ------------------------------------------------------------------------------- |
229
+ | `bf-use` | Find evidence, cite it, and keep projects and concepts current. |
230
+ | `bf-action` | Start, resume and hand off a tracked work session: `/bf-action website-review`. |
231
+ | `bf-setup` | Install BF, create a brain, connect the agent and choose sources worth adding. |
232
+ | `bf-maintain` | Run sensors, routines and assistants, check the brain and upgrade it safely. |
233
+
234
+ Working in a code repository instead? The [session hook](https://github.com/fmind/brain-framework/tree/main/examples/hooks) prints the project that declares the repository and its next task. Hosts that prefer tools can call `search` and `read` through [MCP](https://fmind.github.io/brain-framework/docs/mcp/). See the [agent guide](https://fmind.github.io/brain-framework/docs/agents/).
235
+
236
+ ## Bring your tools
237
+
238
+ A sensor is a small program that prints JSON: wrap a CLI such as `gh`, `gws` or `gcloud`, call an API, drive a browser, query a database or parse an export. Start with a reviewed sensor, copy it into your brain's `sensors/` and adapt it:
239
+
240
+ | Source | Starting point |
241
+ | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
242
+ | Local files, highlights and Git | [Document](https://github.com/fmind/brain-framework/blob/main/examples/sensors/local-documents.py), [highlight](https://github.com/fmind/brain-framework/blob/main/examples/sensors/highlights.py) and [Git history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/git-history.py) sensors. |
243
+ | Google Calendar, Gmail and Drive | [Calendar](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-calendar.py), [Gmail headers](https://github.com/fmind/brain-framework/blob/main/examples/sensors/gmail-headers.py) and [Drive folder](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-drive-folders.py) sensors using [`gws`](https://github.com/googleworkspace/cli). |
244
+ | GitHub, Jira, Confluence and Google Cloud | The [GitHub history sensor](https://github.com/fmind/brain-framework/blob/main/examples/sensors/github-history.md), or your own using [`acli`](https://developer.atlassian.com/cloud/acli/), [`gcloud`](https://cloud.google.com/sdk/gcloud) or their APIs. |
245
+ | Anything you can script | An API, a database query, a browser session or an export: [any source you can script](https://fmind.github.io/brain-framework/docs/sensors/#any-source-you-can-script) becomes a sensor. |
246
+
247
+ The author's own brain runs more than 80 sensors and holds about 50,000 records (counted on 2026-10-16): mail, calendar, documents, chat, commits and pull requests, past agent sessions, release notes and advisories, mentions and site traffic. These are personal sensors, not bundled connectors; the `bf-setup` skill helps your agent connect a new source.
248
+
249
+ After reviewing your sensors, run `bf watch` to keep them refreshed and see failures as they happen, in a terminal or as a [systemd or launchd service](https://fmind.github.io/brain-framework/docs/schedule/):
250
+
251
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg">
252
+ <img
253
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg"
254
+ alt="Watch dashboard for the fictional offline demo: five sensors sorted by state, with a failed sensor's details beside their last success, next due time, item count and record changes."
255
+ width="960"
256
+ >
257
+ </a>
258
+
259
+ The dashboard shows the [offline watch demo](https://github.com/fmind/brain-framework/tree/main/examples/watch), which needs no provider account.
260
+
261
+ ## Good to know
262
+
263
+ 1. **Your data stays on your computer.** A brain is a folder on your disk. BF has no account, server or telemetry, and search and read work offline. Sensors collect while your machine is on.
264
+ 1. **Your agent does the reasoning.** BF never runs a model: it collects, validates, searches and connects, and its [assistants](https://fmind.github.io/brain-framework/docs/prompts/) launch your agent harness. What your agent reads reaches that harness's provider; see [privacy and security](https://fmind.github.io/brain-framework/docs/privacy/) for a fully local setup.
265
+ 1. **Git gives history and sharing.** Notes and programs are plain files: commit them for history, rollback and review. By default, collected records stay out of Git. A team brain is a private repository with one clone per teammate, and a personal brain can include it in its searches. See [team setup](https://fmind.github.io/brain-framework/docs/team/).
266
+ 1. **It takes some setup.** Each source needs its access, such as `gh auth login` or `gcloud` authentication, then a sensor you review. Sensors, routines and the ontology are files you can read, edit or ask your agent to adapt.
267
+ 1. **It finds what was said and linked, not what was meant.** Search matches words and explicit identities, without embeddings, and incomplete results say so. Collect again when you need newer evidence. See [what BF does not do](https://fmind.github.io/brain-framework/docs/concepts/#what-bf-does-not-do).
268
+
269
+ [Browse the commands](https://fmind.github.io/brain-framework/docs/commands/) · [Report an issue](https://github.com/fmind/brain-framework/issues) · [Contribute](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md) · [MIT licensed](https://github.com/fmind/brain-framework/blob/main/LICENSE) · [Third-party notices](https://github.com/fmind/brain-framework/blob/main/THIRD_PARTY_NOTICES.md)
@@ -0,0 +1,239 @@
1
+ <p align="center">
2
+ <img
3
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-framework.svg"
4
+ alt="Brain Framework: a robot head whose shell opens on a brain, above twin aperture eyes"
5
+ width="256"
6
+ height="256"
7
+ >
8
+ </p>
9
+
10
+ # Brain Framework 🧠
11
+
12
+ **🧠 Brain Framework: from information to informed actions.**
13
+
14
+ A second brain for you, your team and your AI agents, on your own computer. Gather what matters from every tool you work with, connect it into one knowledge graph and open your agent there, so it acts with everything you know instead of starting from scratch.
15
+
16
+ [![CI](https://github.com/fmind/brain-framework/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fmind/brain-framework/actions/workflows/ci.yml) [![PyPI](https://img.shields.io/pypi/v/brain-framework?color=174EA6)](https://pypi.org/project/brain-framework/) [![Python](https://img.shields.io/pypi/pyversions/brain-framework)](https://pypi.org/project/brain-framework/) [![License: MIT](https://img.shields.io/badge/license-MIT-174EA6)](https://github.com/fmind/brain-framework/blob/main/LICENSE)
17
+
18
+ [Try it](https://github.com/fmind/brain-framework#try-it) · [How it works](https://github.com/fmind/brain-framework#how-it-works) · [Agents](https://github.com/fmind/brain-framework#open-your-agent-in-your-brain) · [Your tools](https://github.com/fmind/brain-framework#bring-your-tools) · [Good to know](https://github.com/fmind/brain-framework#good-to-know) · [Documentation](https://fmind.github.io/brain-framework/)
19
+
20
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
21
+ <img
22
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg"
23
+ alt="The Brain Framework loop: sensors gather evidence from your tools into a brain folder; bf.yaml declares the ontology, sensors, routines, assistants, channels and watch settings; memories, projects, concepts and actions form a knowledge graph; agents read that context, act through the same CLIs, APIs, MCP servers and browsers, and write outcomes back."
24
+ width="960"
25
+ >
26
+ </a>
27
+
28
+ ## Stop starting from scratch
29
+
30
+ Open an agent anywhere on your computer and it knows nothing: not your projects, not last week's decisions, not what changed overnight. It asks you to paste context, queries the same APIs again and forgets its conclusion when the session ends.
31
+
32
+ Brain Framework (BF) changes the starting point. Create a brain, a plain folder, and let small programs called sensors fill it with evidence from your tools. Open your agent there: it searches your projects, decisions and collected records, cites where each fact comes from, acts through the tools you already use and writes the outcome back for the next session.
33
+
34
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/blank-vs-brain.svg">
35
+ <img
36
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/blank-vs-brain.svg"
37
+ alt="Two fictional sessions ask whether the new website can launch. Opened anywhere, the agent asks you to paste Jira, GitHub and Google Cloud. Opened in a brain, it reads project:new-website and answers: not yet, Jira still blocks launch on accessibility review, citing each record, then notes the launch hold in the project note."
38
+ width="960"
39
+ >
40
+ </a>
41
+
42
+ Once you write or adapt a sensor for each source, questions that took a tour of your tools become one prompt:
43
+
44
+ | Ask your agent | Gathered from |
45
+ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
46
+ | “Can the new website launch?” | The brief in Google Drive, the review in Jira, the pull request in GitHub and the deployment in Google Cloud. |
47
+ | “Prepare my two o'clock meeting.” | The Calendar event, the last meeting notes, the attendees' recent mail and chat threads. |
48
+ | “Where did we leave the migration?” | The last action's next step, the spec and the latest commits. |
49
+ | “What changed in my stack this week?” | Release notes, security advisories, Dependabot alerts and model deprecation pages. |
50
+
51
+ ## Try it
52
+
53
+ You need Linux or macOS and [uv](https://docs.astral.sh/uv/getting-started/installation/). No model or provider account is required.
54
+
55
+ ```bash
56
+ uv tool install --python 3.14 brain-framework
57
+ bf init ~/brain
58
+ cd ~/brain
59
+ ```
60
+
61
+ Save a decision as `projects/new-website.md`:
62
+
63
+ ```markdown
64
+ ---
65
+ type: project
66
+ status: draft
67
+ updated: 2026-11-01
68
+ summary: Launch a product website that helps visitors understand the product.
69
+ ---
70
+
71
+ # New website
72
+
73
+ ## Decision
74
+
75
+ Start with a single product page because visitors need a clear explanation before signing up.
76
+
77
+ ## Next actions
78
+
79
+ - [ ] Draft the product page.
80
+ ```
81
+
82
+ Find its reason, then read the exact section:
83
+
84
+ ```bash
85
+ bf search "visitors clear explanation"
86
+ bf read projects/new-website.md#decision
87
+ ```
88
+
89
+ Search prints compact JSON on one line; selected fields:
90
+
91
+ ```json
92
+ {
93
+ "items": [
94
+ {
95
+ "ref": "projects/new-website.md#decision",
96
+ "title": "New website — Decision",
97
+ "excerpt": "Start with a single product page because visitors need a clear explanation before signing up."
98
+ }
99
+ ]
100
+ }
101
+ ```
102
+
103
+ [Getting started](https://fmind.github.io/brain-framework/docs/getting-started/) continues with validation and a first collected source. The [four-tool walkthrough](https://fmind.github.io/brain-framework/docs/context-hub/) runs the whole loop on fictional Workspace, Jira, GitHub and Gcloud records.
104
+
105
+ ## How it works
106
+
107
+ A brain is a detective's case file in plain files: evidence bags labeled with where and when each item was collected, case notes with the current theory and next step, and string from each conclusion to its evidence. Five steps run in a loop: **gather → normalize → organize and connect → act → learn.**
108
+
109
+ | Folder | Holds | Example |
110
+ | ----------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- |
111
+ | `memories/` | One JSON file per collected item: what a source said, its URL and its time. | The Jira launch review, as collected on Tuesday. |
112
+ | `sensors/` | Programs you review that print JSON records from a tool. | A script that lists the Jira issues of your projects. |
113
+ | `projects/` | One Markdown note per project: goal, current state, decisions and tasks. | “Start with a single product page because visitors need…” |
114
+ | `concepts/` | Knowledge you will reuse elsewhere, with its evidence and limits. | “Explain the product before asking for signup.” |
115
+ | `actions/` | One work session: objective, inputs, outputs, outcome and next step. | `actions/2026-09-27_website-review/ACTION.md`, resumed the next day. |
116
+ | `routines/` | Deterministic programs you review, run on demand or on a schedule. | A weekly review that lists projects to revisit. |
117
+
118
+ Notes are Markdown with YAML metadata, records are JSON, and `bf validate` checks both. The search cache in `.bf/` is disposable and rebuilds itself from the files. Assistants, channels and retrieval checks have their own folders: see the [directory reference](https://fmind.github.io/brain-framework/docs/brain/#directory-reference).
119
+
120
+ `bf.yaml` declares what the brain knows how to name, collect and check:
121
+
122
+ ```yaml
123
+ # https://fmind.github.io/brain-framework/docs/configuration/
124
+ version: 8
125
+ name: brain
126
+ fields: # the ontology: shared fields and typed relations
127
+ project: { type: identity, cardinality: one, relation: true, description: Project the source names. }
128
+ kind: { type: string, cardinality: one, description: Common kind of item. }
129
+ status: { type: string, cardinality: one, description: The item's state in its own tool. }
130
+ sensors: # what to collect, how often, mapped into the ontology
131
+ jira:
132
+ command: [sensors/jira.py]
133
+ mode: snapshot
134
+ refresh: 3600
135
+ fields:
136
+ project: { path: /attributes/workstream }
137
+ kind: { value: issue }
138
+ status: { path: /attributes/status }
139
+ routines: # deterministic reviews and checks
140
+ weekly-review:
141
+ command: [routines/weekly-review.py, "{{brain}}", "{{end}}"]
142
+ refresh: 604800
143
+ output: action
144
+ watch: # keep sources fresh and alert on failure
145
+ interval: 300
146
+ notifications: failure
147
+ ```
148
+
149
+ BF runs each program without a shell, bounds its time and output, validates what it prints and keeps its stderr in `logs/`. A failed run preserves the evidence already saved. See [sensors](https://fmind.github.io/brain-framework/docs/sensors/), [routines](https://fmind.github.io/brain-framework/docs/routines/) and [assistants and channels](https://fmind.github.io/brain-framework/docs/prompts/).
150
+
151
+ ### One vocabulary, set at collection
152
+
153
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/one-vocabulary.svg">
154
+ <img
155
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/one-vocabulary.svg"
156
+ alt="Workspace, Jira, GitHub and Google Cloud name the project project, workstream, repository_project and service_project. bf.yaml maps them once, at collection, to shared fields, so every record points to project:new-website and one read assembles all four."
157
+ width="960"
158
+ >
159
+ </a>
160
+
161
+ Each tool names things its own way. BF translates once, at the door: each sensor maps its provider's fields into the shared `fields:` of `bf.yaml`, and BF validates every value before saving the record. Because `project` is a relation, records from all four tools point to the same identity, `project:new-website`. People and repositories work the same way. Mappings are explicit: BF never decides that two similar names are the same subject. See [shared fields and sensor mappings](https://fmind.github.io/brain-framework/docs/schema/#shared-fields-and-sensor-mappings).
162
+
163
+ ### A knowledge graph across sources
164
+
165
+ Grep finds words, not connections. BF indexes every explicit connection (Markdown links, declared identities and relation fields) into a knowledge graph, so one read assembles a subject across sources:
166
+
167
+ ```bash
168
+ bf read project:new-website
169
+ ```
170
+
171
+ The reply holds the project note and its backlinks, grouped by relation: the Jira review `In review`, the GitHub pull request `merged`, the Gcloud deployment `healthy` and the Workspace brief `approved`. Each claim keeps the note section or record that asserted it, so an answer can always cite its evidence. See [links and relations](https://fmind.github.io/brain-framework/docs/links/#name-a-relation).
172
+
173
+ ### Act, then learn
174
+
175
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/evidence-review.svg">
176
+ <img
177
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/evidence-review.svg"
178
+ alt="Four steps: a sensor collects the Jira review In review and you record that launch is on hold; the review moves to Done and bf collect jira updates the record; bf read flags the project with review true, reason newer_evidence and newer jira:review; you update the conclusion and the flag clears."
179
+ width="960"
180
+ >
181
+ </a>
182
+
183
+ People and agents do the work through the CLIs, APIs and MCP servers they already use. An action keeps each session's objective, inputs, outputs and next step, so the next session resumes instead of starting over. When a linked record changes after a project's last edit, `bf read` flags the project for review and names the record to read first, so a decision does not silently outlive its evidence. Try it in the [four-tool walkthrough](https://fmind.github.io/brain-framework/docs/context-hub/#follow-a-change).
184
+
185
+ ## Open your agent in your brain
186
+
187
+ Use the brain with [Claude Code](https://code.claude.com/docs/en/overview), [Codex](https://openai.com/codex/), [GitHub Copilot](https://github.com/features/copilot) or any agent that can run a command. Start it in `~/brain` and ask:
188
+
189
+ > Use the bf CLI. Find why we chose a single product page. Read the source, cite its ref and tell me the project's next action.
190
+
191
+ It should cite `projects/new-website.md#decision` and name “Draft the product page.” For ongoing use, install the packaged skills into your host's skills folder, such as `~/.claude/skills` for Claude Code:
192
+
193
+ ```bash
194
+ bf skills ~/.agents/skills
195
+ ```
196
+
197
+ | Skill | Teaches your agent to… |
198
+ | ------------- | ------------------------------------------------------------------------------- |
199
+ | `bf-use` | Find evidence, cite it, and keep projects and concepts current. |
200
+ | `bf-action` | Start, resume and hand off a tracked work session: `/bf-action website-review`. |
201
+ | `bf-setup` | Install BF, create a brain, connect the agent and choose sources worth adding. |
202
+ | `bf-maintain` | Run sensors, routines and assistants, check the brain and upgrade it safely. |
203
+
204
+ Working in a code repository instead? The [session hook](https://github.com/fmind/brain-framework/tree/main/examples/hooks) prints the project that declares the repository and its next task. Hosts that prefer tools can call `search` and `read` through [MCP](https://fmind.github.io/brain-framework/docs/mcp/). See the [agent guide](https://fmind.github.io/brain-framework/docs/agents/).
205
+
206
+ ## Bring your tools
207
+
208
+ A sensor is a small program that prints JSON: wrap a CLI such as `gh`, `gws` or `gcloud`, call an API, drive a browser, query a database or parse an export. Start with a reviewed sensor, copy it into your brain's `sensors/` and adapt it:
209
+
210
+ | Source | Starting point |
211
+ | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
212
+ | Local files, highlights and Git | [Document](https://github.com/fmind/brain-framework/blob/main/examples/sensors/local-documents.py), [highlight](https://github.com/fmind/brain-framework/blob/main/examples/sensors/highlights.py) and [Git history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/git-history.py) sensors. |
213
+ | Google Calendar, Gmail and Drive | [Calendar](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-calendar.py), [Gmail headers](https://github.com/fmind/brain-framework/blob/main/examples/sensors/gmail-headers.py) and [Drive folder](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-drive-folders.py) sensors using [`gws`](https://github.com/googleworkspace/cli). |
214
+ | GitHub, Jira, Confluence and Google Cloud | The [GitHub history sensor](https://github.com/fmind/brain-framework/blob/main/examples/sensors/github-history.md), or your own using [`acli`](https://developer.atlassian.com/cloud/acli/), [`gcloud`](https://cloud.google.com/sdk/gcloud) or their APIs. |
215
+ | Anything you can script | An API, a database query, a browser session or an export: [any source you can script](https://fmind.github.io/brain-framework/docs/sensors/#any-source-you-can-script) becomes a sensor. |
216
+
217
+ The author's own brain runs more than 80 sensors and holds about 50,000 records (counted on 2026-10-16): mail, calendar, documents, chat, commits and pull requests, past agent sessions, release notes and advisories, mentions and site traffic. These are personal sensors, not bundled connectors; the `bf-setup` skill helps your agent connect a new source.
218
+
219
+ After reviewing your sensors, run `bf watch` to keep them refreshed and see failures as they happen, in a terminal or as a [systemd or launchd service](https://fmind.github.io/brain-framework/docs/schedule/):
220
+
221
+ <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg">
222
+ <img
223
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg"
224
+ alt="Watch dashboard for the fictional offline demo: five sensors sorted by state, with a failed sensor's details beside their last success, next due time, item count and record changes."
225
+ width="960"
226
+ >
227
+ </a>
228
+
229
+ The dashboard shows the [offline watch demo](https://github.com/fmind/brain-framework/tree/main/examples/watch), which needs no provider account.
230
+
231
+ ## Good to know
232
+
233
+ 1. **Your data stays on your computer.** A brain is a folder on your disk. BF has no account, server or telemetry, and search and read work offline. Sensors collect while your machine is on.
234
+ 1. **Your agent does the reasoning.** BF never runs a model: it collects, validates, searches and connects, and its [assistants](https://fmind.github.io/brain-framework/docs/prompts/) launch your agent harness. What your agent reads reaches that harness's provider; see [privacy and security](https://fmind.github.io/brain-framework/docs/privacy/) for a fully local setup.
235
+ 1. **Git gives history and sharing.** Notes and programs are plain files: commit them for history, rollback and review. By default, collected records stay out of Git. A team brain is a private repository with one clone per teammate, and a personal brain can include it in its searches. See [team setup](https://fmind.github.io/brain-framework/docs/team/).
236
+ 1. **It takes some setup.** Each source needs its access, such as `gh auth login` or `gcloud` authentication, then a sensor you review. Sensors, routines and the ontology are files you can read, edit or ask your agent to adapt.
237
+ 1. **It finds what was said and linked, not what was meant.** Search matches words and explicit identities, without embeddings, and incomplete results say so. Collect again when you need newer evidence. See [what BF does not do](https://fmind.github.io/brain-framework/docs/concepts/#what-bf-does-not-do).
238
+
239
+ [Browse the commands](https://fmind.github.io/brain-framework/docs/commands/) · [Report an issue](https://github.com/fmind/brain-framework/issues) · [Contribute](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md) · [MIT licensed](https://github.com/fmind/brain-framework/blob/main/LICENSE) · [Third-party notices](https://github.com/fmind/brain-framework/blob/main/THIRD_PARTY_NOTICES.md)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "brain-framework"
3
- version = "20.0.2"
3
+ version = "21.0.0"
4
4
  description = "🧠 Brain Framework: from information to informed actions."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.14"
@@ -1,7 +1,7 @@
1
1
  # https://packaging.python.org/en/latest/specifications/pyproject-toml/
2
2
  [project]
3
3
  name = "brain-framework"
4
- version = "20.0.2"
4
+ version = "21.0.0"
5
5
  description = "🧠 Brain Framework: from information to informed actions."
6
6
  readme = "README.md"
7
7
  requires-python = ">=3.14"
@@ -2,7 +2,7 @@
2
2
 
3
3
  import os
4
4
 
5
- __version__ = "20.0.2"
5
+ __version__ = "21.0.0"
6
6
 
7
7
 
8
8
  def main() -> None: