brain-framework 12.0.0__tar.gz → 12.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. brain_framework-12.0.2/PKG-INFO +198 -0
  2. brain_framework-12.0.2/README.md +171 -0
  3. {brain_framework-12.0.0 → brain_framework-12.0.2}/pyproject.toml +8 -5
  4. {brain_framework-12.0.0 → brain_framework-12.0.2}/pyproject.toml.orig +35 -34
  5. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/__init__.py +1 -1
  6. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/collect.py +8 -1
  7. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/index.py +1 -1
  8. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/pages.py +5 -3
  9. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/retrieve.py +8 -1
  10. brain_framework-12.0.0/PKG-INFO +0 -159
  11. brain_framework-12.0.0/README.md +0 -132
  12. {brain_framework-12.0.0 → brain_framework-12.0.2}/LICENSE +0 -0
  13. {brain_framework-12.0.0 → brain_framework-12.0.2}/THIRD_PARTY_NOTICES.md +0 -0
  14. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/__main__.py +0 -0
  15. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/cli.py +0 -0
  16. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/config.py +0 -0
  17. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/evaluate.py +0 -0
  18. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/graph.py +0 -0
  19. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/health.py +0 -0
  20. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/links.py +0 -0
  21. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/markdown.py +0 -0
  22. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/mcp.py +0 -0
  23. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/models.py +0 -0
  24. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/ontology.py +0 -0
  25. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/py.typed +0 -0
  26. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/records.py +0 -0
  27. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/storage.py +0 -0
  28. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/update.py +0 -0
  29. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/usage.py +0 -0
  30. {brain_framework-12.0.0 → brain_framework-12.0.2}/src/bf/validate.py +0 -0
@@ -0,0 +1,198 @@
1
+ Metadata-Version: 2.4
2
+ Name: brain-framework
3
+ Version: 12.0.2
4
+ Summary: 🧠 AI Brain Factory for infinite knowledge. Not for 🐙 mindflayers or 🧟 zombies.
5
+ Keywords: ai-agents,knowledge-management,local-first,mcp,second-brain,plain-text
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 :: 4 - Beta
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: mcp>=2.1.1,<3
19
+ Requires-Dist: pydantic>=2.13.5,<3
20
+ Requires-Dist: pyyaml>=6.0.3,<7
21
+ Requires-Dist: typer>=0.27.2,<1
22
+ Requires-Python: >=3.14
23
+ Project-URL: Documentation, https://fmind.github.io/brain-framework/
24
+ Project-URL: Issues, https://github.com/fmind/brain-framework/issues
25
+ Project-URL: Repository, https://github.com/fmind/brain-framework
26
+ Description-Content-Type: text/markdown
27
+
28
+ <p align="center">
29
+ <img
30
+ src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-framework.svg"
31
+ alt="Brain Framework logo: a factory with brain-shaped smoke"
32
+ width="128"
33
+ height="128"
34
+ >
35
+ </p>
36
+
37
+ # Brain Framework 🧠
38
+
39
+ **🧠 AI Brain Factory for infinite knowledge. Not for 🐙 mindflayers or 🧟 zombies.**
40
+
41
+ [![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)
42
+
43
+ Brain Framework is a **brain factory for you and your AI agents**: build a second brain in plain files you own. Save decisions, gather evidence and resume work across sessions. Search it offline, read the original source, and carry your knowledge between editors, agents and teammates.
44
+
45
+ A chat ends. A project pauses. A teammate moves on. The reasoning behind the work shouldn't disappear with them.
46
+
47
+ [Get started](https://fmind.github.io/brain-framework/docs/getting-started/) · [Documentation](https://fmind.github.io/brain-framework/) · [Example brain](https://github.com/fmind/brain-framework/tree/main/examples/brain) · [Connect an agent](https://fmind.github.io/brain-framework/docs/agents/)
48
+
49
+ ## How it works
50
+
51
+ Your brain does more than store facts: it takes in experiences, connects them to what you know and helps you decide what to do next. Brain Framework borrows that vocabulary to organize your work:
52
+
53
+ | In a brain | In Brain Framework | A concrete example |
54
+ | -------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
55
+ | **Senses** notice the world. | **Sensors** collect selected sources. | Bring in a project's Git history or calendar events. |
56
+ | **Memories** keep what happened. | **Memories** retain collected evidence. | Keep the record of a release and its source link. |
57
+ | **Understanding** turns experience into knowledge. | **Concepts** hold reusable notes you or your agent write. | Record what a failed release taught you. |
58
+ | **Attention** gives work a focus. | **Projects** hold goals, decisions and current context. | Explain why the team chose its release strategy. |
59
+ | **Actions** put knowledge to work. | **Actions** keep a task's context, inputs, outputs and next step. | Resume the rollout checklist next session. |
60
+ | **Habits** make reviews repeatable. | **Routines** prepare reviews using deterministic programs. | Gather the week's activity into an action to review. |
61
+
62
+ The everyday loop is **observe → remember → understand → act → review**. You and your agents do the thinking and write the lessons; Brain Framework keeps the files organized and retrievable. It does not learn from conversations automatically.
63
+
64
+ Start with a single project note. Add sensors and routines when you need them.
65
+
66
+ ## Try it
67
+
68
+ Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then run:
69
+
70
+ ```bash
71
+ uv tool install --python 3.14 'brain-framework==12.0.2'
72
+ bf init ~/knowledge # create your brain
73
+ cd ~/knowledge
74
+ bf read # see its home page
75
+ bf search welcome # find your first note
76
+ bf read concepts/welcome.md # read the original
77
+ bf validate # check notes, links and records
78
+ ```
79
+
80
+ Runs on Linux and macOS. uv supplies Python 3.14 if needed. No account, model or server is required. If `bf` is not on PATH, run `uv tool update-shell` and open a new shell.
81
+
82
+ Now give your brain something worth remembering. Write a decision and its reason in `projects/`, then search for it. Edits become searchable automatically. The [getting-started guide](https://fmind.github.io/brain-framework/docs/getting-started/#save-a-decision) walks through your first decision and checks that it stays retrievable.
83
+
84
+ ## What can you do with it?
85
+
86
+ - **Remember why.** Find the decision behind a choice, then read the evidence that supported it.
87
+ - **Resume after a break.** Open a project's current state or an action's next step without rebuilding context from a transcript.
88
+ - **Give the next agent a head start.** Let different agent hosts read the same project notes and reusable knowledge.
89
+ - **Review what changed.** Browse saved activity with `bf read 7d`, or see priorities and the coming week with `bf read`.
90
+ - **Learn from the outcome.** Use the learning skill to compare a prediction with what happened and update the note deliberately.
91
+
92
+ For example, `bf search "release strategy"` finds matching refs. `bf read projects/release.md#decision` reads that decision's exact text. Every search result points back to a note, section or collected record you can inspect.
93
+
94
+ ## Why plain files?
95
+
96
+ Your knowledge should outlive the tool you used to write it.
97
+
98
+ - **Open it anywhere.** Notes are Markdown; collected records are JSON Lines, one item per line.
99
+ - **Keep the history.** Use your editor and Git to review, correct and share knowledge.
100
+ - **Retrieve it offline.** Search and read run locally, without a model or network connection.
101
+ - **Rebuild the index.** Files are authoritative; the SQLite search cache in `.bf/` is disposable.
102
+
103
+ One Python package. One command: `bf`. Your brain is an ordinary directory:
104
+
105
+ ```text
106
+ knowledge/
107
+ ├── bf.yaml # the brain's name and configuration
108
+ ├── projects/ # what you're working on and why
109
+ ├── concepts/ # what you've learned and can reuse
110
+ ├── actions/ # work to start, resume and review
111
+ └── memories/ # evidence gathered from your sources
112
+ ```
113
+
114
+ Optional `sensors/` and `routines/` hold the programs you configure. See the [brain layout](https://fmind.github.io/brain-framework/docs/brain/) for the full file conventions.
115
+
116
+ ## Any source you can script
117
+
118
+ Your brain can draw on the tools where your work already happens. For example, you can write sensors to collect:
119
+
120
+ | Source | What could become a memory |
121
+ | ----------------------- | ----------------------------------------------------------------- |
122
+ | **GitHub** | Issues, pull requests, reviews and release notes. |
123
+ | **Jira** | Work items, their status and the discussion behind a decision. |
124
+ | **Airtable** | Selected records from a project tracker, research catalog or CRM. |
125
+ | **Google Workspace** | Calendar events, Drive folders or selected mail and documents. |
126
+ | **Local files and Git** | Notes, PDFs, Office documents and commit history. |
127
+ | **Your own systems** | Database query results, internal API responses or feed entries. |
128
+
129
+ **The integration surface is a script.** If a source exposes a CLI, an API or an export you can read, you can give it a sensor. Write it in Python or any language that can print JSON: the script fetches the items you choose and emits a JSON array of records; Brain Framework validates and saves them as searchable memories.
130
+
131
+ **Your tools → sensor script → memories → search and read.**
132
+
133
+ There is no fixed connector catalog to outgrow. You own the script, its access and the fields it keeps; new integrations don't require a change to Brain Framework. Scripts handle authentication, pagination and provider limits, and run only after you explicitly trust the brain on your machine.
134
+
135
+ Start from the four [reviewed sensor examples](https://github.com/fmind/brain-framework/tree/main/examples/sensors): **local Git history, local documents, Google Calendar and Drive folders**. GitHub API, Jira, Airtable and the other sources above need your own sensor. The [sensor guide](https://fmind.github.io/brain-framework/docs/sensors/) explains the small JSON contract and how to connect a script.
136
+
137
+ ## Agents
138
+
139
+ Give your agent the same memory you use. Install the skills that match your workflow:
140
+
141
+ | Skill | What it teaches your agent |
142
+ | --------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
143
+ | [bf-use](https://github.com/fmind/brain-framework/blob/main/skills/bf-use/SKILL.md) | Search, read and cite evidence before answering. |
144
+ | [bf-learn](https://github.com/fmind/brain-framework/blob/main/skills/bf-learn/SKILL.md) | Turn reviewed lessons and decisions into lasting notes. |
145
+ | [bf-action](https://github.com/fmind/brain-framework/blob/main/skills/bf-action/SKILL.md) | Start or resume an action with its context and next step. |
146
+ | [bf-maintain](https://github.com/fmind/brain-framework/blob/main/skills/bf-maintain/SKILL.md) | Maintain collection, routines and brain health. |
147
+
148
+ Follow the [skill installation guide](https://github.com/fmind/brain-framework/blob/main/skills/README.md); skills are installed separately from the Python package. Then try: **“Search my brain for why we chose this release strategy. Read the source and cite it.”**
149
+
150
+ Hosts that use the Model Context Protocol (MCP) can run `bf mcp --brain ~/knowledge`. It exposes exactly two read-only tools: `search` and `read`. See [agent workflows](https://fmind.github.io/brain-framework/docs/agents/) and [MCP setup](https://fmind.github.io/brain-framework/docs/mcp/).
151
+
152
+ ## Personal and team brains
153
+
154
+ Keep a personal brain for your own context, and a separate team brain for shared decisions. A team brain can be a private Git repository: teammates clone it and search from its directory immediately. Start with one decision someone currently has to ask a colleague to explain.
155
+
156
+ Declare related brains in `bf.yaml` to search them together. Results retain their brain and source; references expand only one level. A clone never grants permission to run its sensors. See the [team guide](https://fmind.github.io/brain-framework/docs/team/) for shared notes, collection trust and CI collection.
157
+
158
+ ## Links across brains
159
+
160
+ Think of explicit links as the connections between memories. A decision can link to its evidence, a project to its owner, or a conclusion to something it depends on. Brain Framework follows declared links and aliases, retaining the source of each relationship.
161
+
162
+ Portable addresses such as `bf://team/projects/release#decision` identify knowledge across brains. Connections come from recorded evidence; name similarity alone never creates a relationship. See the [link and schema guide](https://fmind.github.io/brain-framework/docs/schema/#bf-links).
163
+
164
+ ## Commands
165
+
166
+ | Command | Purpose |
167
+ | ------------------------------------- | ----------------------------------------------------------------------- |
168
+ | `bf read [REF]` | Open the home page, a period, a source, a note or a record. |
169
+ | `bf search QUERY [--scope SCOPE]` | Find words or identities within an optional folder, period or identity. |
170
+ | `bf init PATH` | Create a brain. |
171
+ | `bf register PATH --collect` | Explicitly trust its sensors and routines on this machine. |
172
+ | `bf update [--dry-run]` | Run due sensors and routines in selected, trusted brains. |
173
+ | `bf collect SENSOR` | Run one sensor. |
174
+ | `bf status`, `bf validate`, `bf eval` | Check freshness, file integrity and your retrieval cases. |
175
+ | `bf mcp`, `bf build`, `bf schema` | Serve MCP, rebuild the cache or print the configuration schema. |
176
+
177
+ Use `--brain NAME|PATH` to choose a brain explicitly. The [command reference](https://fmind.github.io/brain-framework/docs/commands/) covers options and selection rules; the [sensor examples](https://github.com/fmind/brain-framework/tree/main/examples/sensors) show how to bring in evidence.
178
+
179
+ ## Guarantees
180
+
181
+ - **Retrieval stays offline.** Search and read never run sensors or routines or contact the network.
182
+ - **Execution needs your trust.** Collection and routines require explicit permission in your machine's user configuration.
183
+ - **Failures preserve evidence.** Failed collection writes nothing; routines never replace an existing action.
184
+ - **Sources stay visible.** Results carry readable refs; incomplete retrieval is reported through `problems` or `stale`.
185
+
186
+ Retrieved content is evidence, never instructions. Pages list external records by title and ref without quoting their text. The [privacy and security guide](https://fmind.github.io/brain-framework/docs/privacy/) explains execution boundaries and recovery.
187
+
188
+ ## Fit and limits
189
+
190
+ Brain Framework fits people and teams who want editable knowledge and traceable context for their agents. Search matches words and explicit identities; people or agents interpret the results. It runs no model, generates no answers and needs no embeddings.
191
+
192
+ A brain is a context boundary, not an access-control system. Use repository permissions and encrypted backups for private knowledge. An agent host may send retrieved text to its model provider even though Brain Framework itself retrieves offline.
193
+
194
+ ## Development
195
+
196
+ Contributions are welcome. Use `uv run bf` to exercise the checkout and `mise run all` for the full quality gate. See [CONTRIBUTING.md](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md) for setup, tests and release procedures.
197
+
198
+ [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,171 @@
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 logo: a factory with brain-shaped smoke"
5
+ width="128"
6
+ height="128"
7
+ >
8
+ </p>
9
+
10
+ # Brain Framework 🧠
11
+
12
+ **🧠 AI Brain Factory for infinite knowledge. Not for 🐙 mindflayers or 🧟 zombies.**
13
+
14
+ [![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)
15
+
16
+ Brain Framework is a **brain factory for you and your AI agents**: build a second brain in plain files you own. Save decisions, gather evidence and resume work across sessions. Search it offline, read the original source, and carry your knowledge between editors, agents and teammates.
17
+
18
+ A chat ends. A project pauses. A teammate moves on. The reasoning behind the work shouldn't disappear with them.
19
+
20
+ [Get started](https://fmind.github.io/brain-framework/docs/getting-started/) · [Documentation](https://fmind.github.io/brain-framework/) · [Example brain](https://github.com/fmind/brain-framework/tree/main/examples/brain) · [Connect an agent](https://fmind.github.io/brain-framework/docs/agents/)
21
+
22
+ ## How it works
23
+
24
+ Your brain does more than store facts: it takes in experiences, connects them to what you know and helps you decide what to do next. Brain Framework borrows that vocabulary to organize your work:
25
+
26
+ | In a brain | In Brain Framework | A concrete example |
27
+ | -------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
28
+ | **Senses** notice the world. | **Sensors** collect selected sources. | Bring in a project's Git history or calendar events. |
29
+ | **Memories** keep what happened. | **Memories** retain collected evidence. | Keep the record of a release and its source link. |
30
+ | **Understanding** turns experience into knowledge. | **Concepts** hold reusable notes you or your agent write. | Record what a failed release taught you. |
31
+ | **Attention** gives work a focus. | **Projects** hold goals, decisions and current context. | Explain why the team chose its release strategy. |
32
+ | **Actions** put knowledge to work. | **Actions** keep a task's context, inputs, outputs and next step. | Resume the rollout checklist next session. |
33
+ | **Habits** make reviews repeatable. | **Routines** prepare reviews using deterministic programs. | Gather the week's activity into an action to review. |
34
+
35
+ The everyday loop is **observe → remember → understand → act → review**. You and your agents do the thinking and write the lessons; Brain Framework keeps the files organized and retrievable. It does not learn from conversations automatically.
36
+
37
+ Start with a single project note. Add sensors and routines when you need them.
38
+
39
+ ## Try it
40
+
41
+ Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then run:
42
+
43
+ ```bash
44
+ uv tool install --python 3.14 'brain-framework==12.0.2'
45
+ bf init ~/knowledge # create your brain
46
+ cd ~/knowledge
47
+ bf read # see its home page
48
+ bf search welcome # find your first note
49
+ bf read concepts/welcome.md # read the original
50
+ bf validate # check notes, links and records
51
+ ```
52
+
53
+ Runs on Linux and macOS. uv supplies Python 3.14 if needed. No account, model or server is required. If `bf` is not on PATH, run `uv tool update-shell` and open a new shell.
54
+
55
+ Now give your brain something worth remembering. Write a decision and its reason in `projects/`, then search for it. Edits become searchable automatically. The [getting-started guide](https://fmind.github.io/brain-framework/docs/getting-started/#save-a-decision) walks through your first decision and checks that it stays retrievable.
56
+
57
+ ## What can you do with it?
58
+
59
+ - **Remember why.** Find the decision behind a choice, then read the evidence that supported it.
60
+ - **Resume after a break.** Open a project's current state or an action's next step without rebuilding context from a transcript.
61
+ - **Give the next agent a head start.** Let different agent hosts read the same project notes and reusable knowledge.
62
+ - **Review what changed.** Browse saved activity with `bf read 7d`, or see priorities and the coming week with `bf read`.
63
+ - **Learn from the outcome.** Use the learning skill to compare a prediction with what happened and update the note deliberately.
64
+
65
+ For example, `bf search "release strategy"` finds matching refs. `bf read projects/release.md#decision` reads that decision's exact text. Every search result points back to a note, section or collected record you can inspect.
66
+
67
+ ## Why plain files?
68
+
69
+ Your knowledge should outlive the tool you used to write it.
70
+
71
+ - **Open it anywhere.** Notes are Markdown; collected records are JSON Lines, one item per line.
72
+ - **Keep the history.** Use your editor and Git to review, correct and share knowledge.
73
+ - **Retrieve it offline.** Search and read run locally, without a model or network connection.
74
+ - **Rebuild the index.** Files are authoritative; the SQLite search cache in `.bf/` is disposable.
75
+
76
+ One Python package. One command: `bf`. Your brain is an ordinary directory:
77
+
78
+ ```text
79
+ knowledge/
80
+ ├── bf.yaml # the brain's name and configuration
81
+ ├── projects/ # what you're working on and why
82
+ ├── concepts/ # what you've learned and can reuse
83
+ ├── actions/ # work to start, resume and review
84
+ └── memories/ # evidence gathered from your sources
85
+ ```
86
+
87
+ Optional `sensors/` and `routines/` hold the programs you configure. See the [brain layout](https://fmind.github.io/brain-framework/docs/brain/) for the full file conventions.
88
+
89
+ ## Any source you can script
90
+
91
+ Your brain can draw on the tools where your work already happens. For example, you can write sensors to collect:
92
+
93
+ | Source | What could become a memory |
94
+ | ----------------------- | ----------------------------------------------------------------- |
95
+ | **GitHub** | Issues, pull requests, reviews and release notes. |
96
+ | **Jira** | Work items, their status and the discussion behind a decision. |
97
+ | **Airtable** | Selected records from a project tracker, research catalog or CRM. |
98
+ | **Google Workspace** | Calendar events, Drive folders or selected mail and documents. |
99
+ | **Local files and Git** | Notes, PDFs, Office documents and commit history. |
100
+ | **Your own systems** | Database query results, internal API responses or feed entries. |
101
+
102
+ **The integration surface is a script.** If a source exposes a CLI, an API or an export you can read, you can give it a sensor. Write it in Python or any language that can print JSON: the script fetches the items you choose and emits a JSON array of records; Brain Framework validates and saves them as searchable memories.
103
+
104
+ **Your tools → sensor script → memories → search and read.**
105
+
106
+ There is no fixed connector catalog to outgrow. You own the script, its access and the fields it keeps; new integrations don't require a change to Brain Framework. Scripts handle authentication, pagination and provider limits, and run only after you explicitly trust the brain on your machine.
107
+
108
+ Start from the four [reviewed sensor examples](https://github.com/fmind/brain-framework/tree/main/examples/sensors): **local Git history, local documents, Google Calendar and Drive folders**. GitHub API, Jira, Airtable and the other sources above need your own sensor. The [sensor guide](https://fmind.github.io/brain-framework/docs/sensors/) explains the small JSON contract and how to connect a script.
109
+
110
+ ## Agents
111
+
112
+ Give your agent the same memory you use. Install the skills that match your workflow:
113
+
114
+ | Skill | What it teaches your agent |
115
+ | --------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
116
+ | [bf-use](https://github.com/fmind/brain-framework/blob/main/skills/bf-use/SKILL.md) | Search, read and cite evidence before answering. |
117
+ | [bf-learn](https://github.com/fmind/brain-framework/blob/main/skills/bf-learn/SKILL.md) | Turn reviewed lessons and decisions into lasting notes. |
118
+ | [bf-action](https://github.com/fmind/brain-framework/blob/main/skills/bf-action/SKILL.md) | Start or resume an action with its context and next step. |
119
+ | [bf-maintain](https://github.com/fmind/brain-framework/blob/main/skills/bf-maintain/SKILL.md) | Maintain collection, routines and brain health. |
120
+
121
+ Follow the [skill installation guide](https://github.com/fmind/brain-framework/blob/main/skills/README.md); skills are installed separately from the Python package. Then try: **“Search my brain for why we chose this release strategy. Read the source and cite it.”**
122
+
123
+ Hosts that use the Model Context Protocol (MCP) can run `bf mcp --brain ~/knowledge`. It exposes exactly two read-only tools: `search` and `read`. See [agent workflows](https://fmind.github.io/brain-framework/docs/agents/) and [MCP setup](https://fmind.github.io/brain-framework/docs/mcp/).
124
+
125
+ ## Personal and team brains
126
+
127
+ Keep a personal brain for your own context, and a separate team brain for shared decisions. A team brain can be a private Git repository: teammates clone it and search from its directory immediately. Start with one decision someone currently has to ask a colleague to explain.
128
+
129
+ Declare related brains in `bf.yaml` to search them together. Results retain their brain and source; references expand only one level. A clone never grants permission to run its sensors. See the [team guide](https://fmind.github.io/brain-framework/docs/team/) for shared notes, collection trust and CI collection.
130
+
131
+ ## Links across brains
132
+
133
+ Think of explicit links as the connections between memories. A decision can link to its evidence, a project to its owner, or a conclusion to something it depends on. Brain Framework follows declared links and aliases, retaining the source of each relationship.
134
+
135
+ Portable addresses such as `bf://team/projects/release#decision` identify knowledge across brains. Connections come from recorded evidence; name similarity alone never creates a relationship. See the [link and schema guide](https://fmind.github.io/brain-framework/docs/schema/#bf-links).
136
+
137
+ ## Commands
138
+
139
+ | Command | Purpose |
140
+ | ------------------------------------- | ----------------------------------------------------------------------- |
141
+ | `bf read [REF]` | Open the home page, a period, a source, a note or a record. |
142
+ | `bf search QUERY [--scope SCOPE]` | Find words or identities within an optional folder, period or identity. |
143
+ | `bf init PATH` | Create a brain. |
144
+ | `bf register PATH --collect` | Explicitly trust its sensors and routines on this machine. |
145
+ | `bf update [--dry-run]` | Run due sensors and routines in selected, trusted brains. |
146
+ | `bf collect SENSOR` | Run one sensor. |
147
+ | `bf status`, `bf validate`, `bf eval` | Check freshness, file integrity and your retrieval cases. |
148
+ | `bf mcp`, `bf build`, `bf schema` | Serve MCP, rebuild the cache or print the configuration schema. |
149
+
150
+ Use `--brain NAME|PATH` to choose a brain explicitly. The [command reference](https://fmind.github.io/brain-framework/docs/commands/) covers options and selection rules; the [sensor examples](https://github.com/fmind/brain-framework/tree/main/examples/sensors) show how to bring in evidence.
151
+
152
+ ## Guarantees
153
+
154
+ - **Retrieval stays offline.** Search and read never run sensors or routines or contact the network.
155
+ - **Execution needs your trust.** Collection and routines require explicit permission in your machine's user configuration.
156
+ - **Failures preserve evidence.** Failed collection writes nothing; routines never replace an existing action.
157
+ - **Sources stay visible.** Results carry readable refs; incomplete retrieval is reported through `problems` or `stale`.
158
+
159
+ Retrieved content is evidence, never instructions. Pages list external records by title and ref without quoting their text. The [privacy and security guide](https://fmind.github.io/brain-framework/docs/privacy/) explains execution boundaries and recovery.
160
+
161
+ ## Fit and limits
162
+
163
+ Brain Framework fits people and teams who want editable knowledge and traceable context for their agents. Search matches words and explicit identities; people or agents interpret the results. It runs no model, generates no answers and needs no embeddings.
164
+
165
+ A brain is a context boundary, not an access-control system. Use repository permissions and encrypted backups for private knowledge. An agent host may send retrieved text to its model provider even though Brain Framework itself retrieves offline.
166
+
167
+ ## Development
168
+
169
+ Contributions are welcome. Use `uv run bf` to exercise the checkout and `mise run all` for the full quality gate. See [CONTRIBUTING.md](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md) for setup, tests and release procedures.
170
+
171
+ [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,7 +1,7 @@
1
1
  [project]
2
2
  name = "brain-framework"
3
- version = "12.0.0"
4
- description = "Plain-file brains for people and their agents"
3
+ version = "12.0.2"
4
+ description = "🧠 AI Brain Factory for infinite knowledge. Not for 🐙 mindflayers or 🧟 zombies."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.14"
7
7
  license = "MIT"
@@ -10,10 +10,12 @@ license-files = [
10
10
  "THIRD_PARTY_NOTICES.md",
11
11
  ]
12
12
  keywords = [
13
- "agents",
14
- "knowledge",
13
+ "ai-agents",
14
+ "knowledge-management",
15
+ "local-first",
15
16
  "mcp",
16
- "retrieval",
17
+ "second-brain",
18
+ "plain-text",
17
19
  ]
18
20
  classifiers = [
19
21
  "Development Status :: 4 - Beta",
@@ -133,6 +135,7 @@ branch = true
133
135
  source = ["bf"]
134
136
 
135
137
  [tool.coverage.report]
138
+ fail_under = 85
136
139
  show_missing = true
137
140
  skip_covered = true
138
141
  skip_empty = true
@@ -1,14 +1,14 @@
1
1
  # https://packaging.python.org/en/latest/specifications/pyproject-toml/
2
2
  [project]
3
3
  name = "brain-framework"
4
- version = "12.0.0"
5
- description = "Plain-file brains for people and their agents"
4
+ version = "12.0.2"
5
+ description = "🧠 AI Brain Factory for infinite knowledge. Not for 🐙 mindflayers or 🧟 zombies."
6
6
  readme = "README.md"
7
7
  requires-python = ">=3.14"
8
8
  license = "MIT"
9
9
  license-files = ["LICENSE", "THIRD_PARTY_NOTICES.md"]
10
10
  authors = [{ name = "Médéric Hurier" }]
11
- keywords = ["agents", "knowledge", "mcp", "retrieval"]
11
+ keywords = ["ai-agents", "knowledge-management", "local-first", "mcp", "second-brain", "plain-text"]
12
12
  classifiers = [
13
13
  "Development Status :: 4 - Beta",
14
14
  "Environment :: Console",
@@ -65,37 +65,37 @@ quote-style = "double"
65
65
 
66
66
  [tool.ruff.lint]
67
67
  select = [
68
- "A",
69
- "ARG",
70
- "ASYNC",
71
- "B",
72
- "C4",
73
- "E",
74
- "ERA",
75
- "F",
76
- "FA",
77
- "FURB",
78
- "I",
79
- "ISC",
80
- "LOG",
81
- "N",
82
- "PERF",
83
- "PGH",
84
- "PIE",
85
- "PT",
86
- "PTH",
87
- "Q",
88
- "RET",
89
- "RSE",
90
- "RUF",
91
- "S",
92
- "SIM",
93
- "SLF",
94
- "T10",
95
- "T20",
96
- "TID",
97
- "UP",
98
- "W",
68
+ "A", # Avoid shadowing Python builtins.
69
+ "ARG", # Find unused function arguments.
70
+ "ASYNC", # Catch async and cancellation mistakes.
71
+ "B", # Catch likely bugs (flake8-bugbear).
72
+ "C4", # Simplify comprehensions.
73
+ "E", # Enforce pycodestyle errors.
74
+ "ERA", # Remove commented-out code.
75
+ "F", # Find undefined names and unused imports (Pyflakes).
76
+ "FA", # Check future-annotations usage.
77
+ "FURB", # Modernize and simplify Python idioms (refurb).
78
+ "I", # Sort imports (isort).
79
+ "ISC", # Catch accidental implicit string concatenation.
80
+ "LOG", # Check logging API usage.
81
+ "N", # Enforce Python naming conventions.
82
+ "PERF", # Avoid common performance pitfalls.
83
+ "PGH", # Require specific lint and type-checker suppressions.
84
+ "PIE", # Remove unnecessary code constructs.
85
+ "PT", # Keep pytest fixtures and assertions consistent.
86
+ "PTH", # Prefer pathlib for filesystem operations.
87
+ "Q", # Keep string quoting consistent.
88
+ "RET", # Simplify return statements.
89
+ "RSE", # Remove redundant exception syntax.
90
+ "RUF", # Enable Ruff-specific correctness and style checks.
91
+ "S", # Catch common security mistakes (Bandit).
92
+ "SIM", # Simplify control flow and expressions.
93
+ "SLF", # Flag access to private class members.
94
+ "T10", # Remove debugger calls.
95
+ "T20", # Flag accidental print statements.
96
+ "TID", # Keep imports explicit and tidy.
97
+ "UP", # Use syntax supported by the target Python version.
98
+ "W", # Enforce pycodestyle warnings.
99
99
  ]
100
100
  ignore = [
101
101
  "ASYNC240", # Brain Framework performs bounded local filesystem work from async MCP handlers.
@@ -127,6 +127,7 @@ branch = true
127
127
  source = ["bf"]
128
128
 
129
129
  [tool.coverage.report]
130
+ fail_under = 85
130
131
  show_missing = true
131
132
  skip_covered = true
132
133
  skip_empty = true
@@ -2,7 +2,7 @@
2
2
 
3
3
  import os
4
4
 
5
- __version__ = "12.0.0"
5
+ __version__ = "12.0.2"
6
6
 
7
7
 
8
8
  def main() -> None:
@@ -96,7 +96,7 @@ def run(argv: list[str], sensor: Program, store: Store, log: Path) -> bytes:
96
96
  else:
97
97
  executable = found
98
98
  try:
99
- child = subprocess.Popen( # noqa: S603 # nosemgrep: dangerous-subprocess-use-audit
99
+ child = subprocess.Popen( # noqa: S603
100
100
  # Direct argv from the owner's bf.yaml; no shell interprets it.
101
101
  [executable, *argv[1:]],
102
102
  cwd=store.root,
@@ -216,6 +216,13 @@ def _coverage(previous: dict[str, object], start: str, end: str, observed: str)
216
216
  """
217
217
  covered = min(end, observed)
218
218
  before_start, before_end = str(previous.get("start", "")), str(previous.get("end", ""))
219
+ if before_end:
220
+ # Saved state may predate the coverage bound or follow a clock correction. It cannot
221
+ # prove coverage beyond its successful run, nor prevent a current run becoming fresh.
222
+ before_end = min(timestamp(before_end), timestamp(str(previous.get("success") or observed)), observed)
223
+ before_start = timestamp(before_start) if before_start else ""
224
+ if before_start >= before_end:
225
+ before_start = before_end = ""
219
226
  if start >= covered:
220
227
  return ({"start": before_start, "end": before_end} if before_end else {}), False
221
228
  latest = not before_end or covered >= before_end
@@ -332,7 +332,7 @@ def _refresh(store: Store, *, full: bool, wait: float) -> dict[str, object]:
332
332
  )
333
333
  connection.execute("INSERT INTO files VALUES(?,?,?,?,?,?)", (path, *current[path], error))
334
334
  # PRAGMA has no bound-parameter form; SCHEMA is an internal integer constant.
335
- connection.execute(f"PRAGMA user_version={SCHEMA}") # nosemgrep: formatted-sql-query
335
+ connection.execute(f"PRAGMA user_version={SCHEMA}")
336
336
  skipped = connection.execute("SELECT count(*) FROM files WHERE error!=''").fetchone()[0]
337
337
  return {"files": len(current), "changed": len(changed), "removed": len(removed), "problems": skipped}
338
338
 
@@ -229,8 +229,8 @@ def home(stores: list[Store], now: datetime | None = None, *, counted: bool = Tr
229
229
  actions, _ = index.listing(connection, index.ACTION, {}, "i.path DESC", 10)
230
230
  changed, _ = index.listing(
231
231
  connection,
232
- f"i.kind='note' AND i.time!='' AND ({index.TIME})>=:since",
233
- {"since": week},
232
+ f"i.kind='note' AND i.time!='' AND ({index.TIME})>=:since AND ({index.TIME})<:until",
233
+ {"since": week, "until": stamp},
234
234
  "time DESC",
235
235
  SECTION,
236
236
  )
@@ -560,9 +560,11 @@ def identity(stores: list[Store], value: str, *, counted: bool = True) -> dict[s
560
560
  parts, extra = _brains(stores, build, strict=False, counted=counted)
561
561
  backlinks = _merge(parts)
562
562
  claims = [claim for _, part in parts for claim in cast("list[dict[str, object]]", part["claims"])]
563
+ issues = [*problems, *cast("list", extra.get("problems", []))]
563
564
  if not backlinks and not claims:
565
+ if issues or extra.get("stale"):
566
+ raise Error("identity read is incomplete; run bf status before concluding it is absent")
564
567
  return None
565
- issues = [*problems, *cast("list", extra.get("problems", []))]
566
568
  return {
567
569
  "page": value,
568
570
  "backlinks": backlinks,
@@ -176,7 +176,12 @@ def read(stores: list[Store], ref: str = "", brain: str = "", *, counted: bool =
176
176
  selected = _brain(selected, parsed.brain)
177
177
  path = parsed.path if parsed else ref
178
178
  if not (parsed and parsed.fragment):
179
- view = pages.page(selected, path, counted=counted)
179
+ try:
180
+ view = pages.page(selected, path, counted=counted)
181
+ except Error as error:
182
+ if problems and str(error).startswith("page not found"):
183
+ raise Error("read is incomplete; run bf status before concluding a reference is absent") from error
184
+ raise
180
185
  if view is not None:
181
186
  return bounded({**view, "notice": NOTICE, **_problems(problems, view)})
182
187
  if re.fullmatch(r"actions/[^/#]+", path.rstrip("/")) and not authored(path):
@@ -188,6 +193,8 @@ def read(stores: list[Store], ref: str = "", brain: str = "", *, counted: bool =
188
193
  view = pages.identity(everywhere, ref, counted=counted)
189
194
  if view is not None:
190
195
  return bounded({**view, "notice": NOTICE, **_problems(problems, view)})
196
+ if problems:
197
+ raise Error("read is incomplete; run bf status before concluding a reference is absent")
191
198
  raise Error("reference not found; use bf search to locate it, or bf read to browse pages")
192
199
  if len(found) > 1:
193
200
  raise Error("reference exists in several brains; use a brain-qualified bf:// address")
@@ -1,159 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: brain-framework
3
- Version: 12.0.0
4
- Summary: Plain-file brains for people and their agents
5
- Keywords: agents,knowledge,mcp,retrieval
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 :: 4 - Beta
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: mcp>=2.1.1,<3
19
- Requires-Dist: pydantic>=2.13.5,<3
20
- Requires-Dist: pyyaml>=6.0.3,<7
21
- Requires-Dist: typer>=0.27.2,<1
22
- Requires-Python: >=3.14
23
- Project-URL: Documentation, https://fmind.github.io/brain-framework/
24
- Project-URL: Issues, https://github.com/fmind/brain-framework/issues
25
- Project-URL: Repository, https://github.com/fmind/brain-framework
26
- Description-Content-Type: text/markdown
27
-
28
- # Brain Framework
29
-
30
- **Plain-file brains for people and their agents.**
31
-
32
- Brain Framework helps people and their agents build brains: ordinary directories of knowledge and work they can inspect, edit and keep. Write project decisions in Markdown, collect supporting evidence into JSON Lines, and search both offline. Every result points to the note, section or record behind it.
33
-
34
- Your next agent session can pick up the same project notes. A teammate can find the reason behind a decision without reconstructing a chat thread. You can inspect the evidence, correct the note and keep using your own editor, Git and agent host.
35
-
36
- Brain Framework is one Python package and one command; it needs no model, hosted database or background server. It supplies retrievable context and resumable actions; you or your agent use ordinary system tools to do the work.
37
-
38
- ## Try it
39
-
40
- ```bash
41
- uv tool install --python 3.14 'brain-framework==12.0.0'
42
- bf init ~/knowledge # creates a brain; no global configuration
43
- cd ~/knowledge # keep this walkthrough in that brain
44
- bf read # the home page: projects, actions, activity, the coming week
45
- bf search welcome # find the note created by init
46
- bf read concepts/welcome.md # read its exact contents
47
- bf validate # check notes, links and records
48
- ```
49
-
50
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/) first; it supplies Python 3.14 if needed. Brain Framework runs on Linux and macOS.
51
-
52
- Start with one project note. Save decisions, their reasons and the next action; search notices edits automatically. Add a sensor when you need recurring evidence from Git, mail, a calendar or another source. The [getting-started guide](https://fmind.github.io/brain-framework/docs/getting-started/) walks through a searchable decision, and the [example brain](https://github.com/fmind/brain-framework/tree/main/examples/brain) demonstrates collection without credentials.
53
-
54
- ## Why plain files?
55
-
56
- - **Readable evidence.** Open every answer's source in an editor; use Git to review how a decision changed.
57
- - **Continuity across agents.** The CLI and two read-only MCP tools expose the same knowledge to different hosts.
58
- - **Local control.** Retrieval works offline, and you choose the accounts and folders sensors may read.
59
- - **A small maintenance surface.** Notes and records are durable; the SQLite cache can be rebuilt from them.
60
-
61
- ## What can you do with it?
62
-
63
- | Question | Useful context |
64
- | ---------------------------------- | -------------------------------------------------------------------------------------- |
65
- | "Why did we choose this?" | A dated decision, its reason and a ref to supporting evidence. |
66
- | "Where should I resume?" | The project's current state and next task, or an action with its files and next step. |
67
- | "What changed this week?" | A page of saved notes and collected events, with each source's share and coverage. |
68
- | "What should the next agent know?" | A short project note and reusable concept knowledge available to every connected host. |
69
-
70
- The everyday loop is **read or search → read the evidence → do the work → update the note**. Brain Framework does not save conversations or learn decisions automatically: people and agents maintain notes, optional sensors capture selected sources, and optional routines prepare reviews for them.
71
-
72
- For consequential work, the agent skills add an optional decision loop over the same files:
73
-
74
- - **Resume without a transcript.** Each action keeps a small context (at most 300 words, six refs and 4 KiB) and the exact next step.
75
- - **Keep beliefs explainable.** Decision notes record the alternative and the expected outcome, retain a capture of the evidence they relied on, and link the decision they supersede.
76
- - **Notice what a change affects.** Declared `depends-on` links show which conclusions to review when evidence changes, within two hops and ten dependents.
77
- - **Learn deliberately.** Intentions, open questions, predictions compared with outcomes and draft procedures stay in reviewed Markdown until someone checks them.
78
-
79
- See [agent workflows](https://fmind.github.io/brain-framework/docs/agents/) and the [runnable example](https://github.com/fmind/brain-framework/tree/main/examples/brain#review-a-decision).
80
-
81
- ## How it works
82
-
83
- Sensors gather observations, memories preserve their evidence, concepts distill reusable understanding, projects provide context, and actions hold one session of work each. Routines are deterministic programs that turn pages into actions to review, such as a weekly review. A project can contain several goals. Collected memories can be incomplete or wrong; people and agents decide what to trust and promote into knowledge.
84
-
85
- | Piece | What it is |
86
- | --------------------------- | ---------------------------------------------------------------------------------------- |
87
- | `projects/`, `concepts/` | Markdown you and your agents write: one note per project, reusable concepts in OKF v0.2. |
88
- | `actions/YYYY-MM-DD_slug/` | One session of work: `ACTION.md`, `inputs/`, `outputs/`, resumed by name. |
89
- | `memories/<source>/*.jsonl` | Collected items, one line per item, upserted by id into monthly files. |
90
- | `sensors/` + `bf.yaml` | Sensors: any executable that prints a JSON array of records. |
91
- | `routines/` + `bf.yaml` | Routines: deterministic programs whose Markdown becomes the day's action. |
92
- | `.bf/` | A disposable SQLite search cache that refreshes itself when files change. |
93
- | `~/.config/bf/config.yaml` | Optional machine registrations and explicit sensor execution trust. |
94
-
95
- Commands select a root through `--brain NAME|PATH`, then `BF_BRAIN`, then the enclosing brain. Reads and searches also include its direct `brains:` references from `bf.yaml`, resolving paths relative to that file. No global registration is required; an optional registry supplies names and the fallback outside any brain.
96
-
97
- Two commands retrieve everything. `bf read` without a ref shows the home page: active and blocked projects with those due for review first, recent actions and notes, activity per source and the coming week. It also reads pages such as `projects`, `today`, `7d`, `2026-09` or `memories/gmail`, and any note, section, record or identity such as `repo:github.com/owner/name` with what links to it. `bf search` finds refs by words or an explicit identity, optionally within one `--scope`: a folder, a period or an identity. Notes receive a ranking boost because they distill the answer; records supply the evidence. Read returned refs such as `projects/x.md#decision` or `gmail:<id>` to inspect the source. Replies report incomplete results under `problems` or `stale`; an incomplete empty answer never proves absence.
98
-
99
- `bf update` runs every due sensor, then every due routine, in the selected brains you trust on this machine and refreshes the cache. Run it from a native timer. A failing sensor or routine never blocks the others; `bf status` distinguishes active collection from disabled or historical evidence, with freshness, change counts and private error logs.
100
-
101
- Each part has one job. Your editor writes Markdown, provider CLIs handle authentication, sensors print JSON, Brain Framework searches files, and your agent interprets results. JSON output composes with shell tools; Git reviews changes and systemd or launchd schedules collection. You can replace a part without replacing your knowledge.
102
-
103
- ## Commands
104
-
105
- | Command | Purpose |
106
- | ---------------------------------------- | -------------------------------------------------------------------------------- |
107
- | `init PATH`, `register PATH [--collect]` | Create a brain, or explicitly register machine discovery and collection trust. |
108
- | `read [REF]` | The home page, a page, a note, a section, a record or an identity. |
109
- | `search QUERY [--scope SCOPE]` | Search words or identities, optionally within a folder, a period or an identity. |
110
- | `update [--dry-run]`, `collect SENSOR` | Run due sensors and routines, or one sensor now for a backfill or debugging. |
111
- | `status [--check]`, `validate`, `eval` | Freshness, errors and usage; broken links; retrieval cases. |
112
- | `mcp`, `build`, `schema` | Read-only MCP server, full cache rebuild, `bf.yaml` JSON Schema. |
113
-
114
- ## Links across brains
115
-
116
- Give an authored entity note a stable identity such as `entity: bf://team/projects/archive`, retain verified alternate identities in `aliases`, and declare relationships in `bf.yaml`. A link such as `[Archive](bf://team/projects/archive?rel=depends-on)` records a directed claim with its containing section as evidence. `bf read bf://team/projects/archive` returns the note with its backlinks across the selected brains, grouped by relationship, and the claims made about it. Read the returned evidence before using it.
117
-
118
- Fragments address sections, explicit heading anchors survive title changes, and authorship/ownership use named relationships. Files remain authoritative and SQLite remains disposable. See the [link contract](https://fmind.github.io/brain-framework/docs/schema/#bf-links) for syntax, provenance and cross-brain boundaries.
119
-
120
- Collected records use the same vocabulary: `bf.yaml` declares each common field's type, cardinality, examples and relationship meaning, and each sensor maps its output into that schema explicitly. `bf read person:email/alice@example.test` then lists the evidence-backed relationships by role. See the [schema guide](https://fmind.github.io/brain-framework/docs/schema/).
121
-
122
- ## Personal and team brains
123
-
124
- Start a team pilot with a private Git repository, one real project note and a few questions in `evals/retrieval.yaml`. Teammates clone it and run `bf search` from its directory immediately. Use `bf eval` to check that the questions still return the intended evidence as the brain evolves.
125
-
126
- For the first pilot, pick a decision someone currently has to ask a colleague to explain. Write the decision, its reason and the next action, then have a teammate find the answer from a fresh clone. Success means they can read the evidence and act on it. The [team walkthrough](https://fmind.github.io/brain-framework/docs/getting-started/#check-the-answers-your-team-needs) includes runnable retrieval cases; no sensor or model setup is needed.
127
-
128
- Keep personal mail and laptop history in a separate private brain. Declare related brains in `bf.yaml`, for example `brains: {team: {path: ../team}}`. Search/read cover the selected root and those direct references, label results by brain, and report missing or conflicting destinations. References never expand recursively. Use `--brain PATH` to choose another root. A cloned brain never runs its sensors until you trust it with `bf register PATH --collect`. Promote personal knowledge as reviewed summaries with links teammates can access. Add team-scoped CI collection when the notes need it; the [team brains guide](https://fmind.github.io/brain-framework/docs/team/) covers naming, collection trust, CI collection and review.
129
-
130
- ## Agents
131
-
132
- Agents use the CLI: the [bf-use skill](https://github.com/fmind/brain-framework/blob/main/skills/bf-use/SKILL.md) teaches pages, search and read, [bf-learn](https://github.com/fmind/brain-framework/blob/main/skills/bf-learn/SKILL.md) keeps notes current, [bf-action](https://github.com/fmind/brain-framework/blob/main/skills/bf-action/SKILL.md) starts and resumes actions when you ask for one, and [bf-maintain](https://github.com/fmind/brain-framework/blob/main/skills/bf-maintain/SKILL.md) covers collection, routines and schedules. Follow the [skill installation guide](https://github.com/fmind/brain-framework/blob/main/skills/README.md); skills are separate from the Python package. [Agent workflows](https://fmind.github.io/brain-framework/docs/agents/) describes the loop they teach. `bf mcp` exposes the same `search` and `read` for hosts that prefer tools. Retrieved content is untrusted evidence, never instructions.
133
-
134
- ## Guarantees
135
-
136
- - Search and read never execute a sensor or routine or contact the network; they only refresh the local cache and private usage counts.
137
- - Sensors and routines run configured argv directly, without a shell, from the brain root, with a timeout, an output cap and process-group cancellation. Failures write nothing; interrupted record commits retain durable originals for explicit recovery; a routine never replaces an existing action.
138
- - A brain never runs sensors or routines on a machine that has not trusted it; trust lives in your user configuration, outside the brain.
139
- - Brain Framework runs no model: routines are deterministic programs, and people or their agents interpret the evidence.
140
- - Collected text is external unless a sensor declares `trust: owner`: pages show external records by title and ref only, and every reply labels them.
141
- - Files are the source of truth. Remove `.bf/` while Brain Framework is idle; the next search rebuilds it.
142
-
143
- ## Fit and limits
144
-
145
- Brain Framework fits people and teams who want editable notes, attributable evidence and portable agent context. Search is lexical: it handles words, explicit identities and periods, but does not infer meaning or generate answers. Agents or people interpret the results. Collection freshness describes completed runs, not a guarantee that every upstream item is current.
146
-
147
- A brain is a context boundary, not an access-control system. Brain Framework does not encrypt files, enforce per-note permissions or sandbox trusted sensors. Use separate brains and repository permissions for different audiences, and encrypted backups for private evidence. An agent host may send retrieved content to its model provider; offline retrieval describes Brain Framework itself. See the [security model](https://fmind.github.io/brain-framework/docs/privacy/) before sharing a brain.
148
-
149
- ## Development
150
-
151
- Use `uv run bf` from the checkout to exercise changes. Run the complete gate before contributing:
152
-
153
- ```bash
154
- mise run all
155
- ```
156
-
157
- The gate formats, lints, type-checks, scans, runs hermetic tests with an 85% branch-coverage floor, builds the documentation and installs both distributions. See [AGENTS.md](https://github.com/fmind/brain-framework/blob/main/AGENTS.md), [contributing](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md), the [documentation](https://fmind.github.io/brain-framework/docs/), the [sensor examples](https://github.com/fmind/brain-framework/tree/main/examples/sensors) and the [runnable example brain](https://github.com/fmind/brain-framework/tree/main/examples/brain).
158
-
159
- MIT. Runtime dependency licenses are recorded in [THIRD_PARTY_NOTICES.md](https://github.com/fmind/brain-framework/blob/main/THIRD_PARTY_NOTICES.md).
@@ -1,132 +0,0 @@
1
- # Brain Framework
2
-
3
- **Plain-file brains for people and their agents.**
4
-
5
- Brain Framework helps people and their agents build brains: ordinary directories of knowledge and work they can inspect, edit and keep. Write project decisions in Markdown, collect supporting evidence into JSON Lines, and search both offline. Every result points to the note, section or record behind it.
6
-
7
- Your next agent session can pick up the same project notes. A teammate can find the reason behind a decision without reconstructing a chat thread. You can inspect the evidence, correct the note and keep using your own editor, Git and agent host.
8
-
9
- Brain Framework is one Python package and one command; it needs no model, hosted database or background server. It supplies retrievable context and resumable actions; you or your agent use ordinary system tools to do the work.
10
-
11
- ## Try it
12
-
13
- ```bash
14
- uv tool install --python 3.14 'brain-framework==12.0.0'
15
- bf init ~/knowledge # creates a brain; no global configuration
16
- cd ~/knowledge # keep this walkthrough in that brain
17
- bf read # the home page: projects, actions, activity, the coming week
18
- bf search welcome # find the note created by init
19
- bf read concepts/welcome.md # read its exact contents
20
- bf validate # check notes, links and records
21
- ```
22
-
23
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/) first; it supplies Python 3.14 if needed. Brain Framework runs on Linux and macOS.
24
-
25
- Start with one project note. Save decisions, their reasons and the next action; search notices edits automatically. Add a sensor when you need recurring evidence from Git, mail, a calendar or another source. The [getting-started guide](https://fmind.github.io/brain-framework/docs/getting-started/) walks through a searchable decision, and the [example brain](https://github.com/fmind/brain-framework/tree/main/examples/brain) demonstrates collection without credentials.
26
-
27
- ## Why plain files?
28
-
29
- - **Readable evidence.** Open every answer's source in an editor; use Git to review how a decision changed.
30
- - **Continuity across agents.** The CLI and two read-only MCP tools expose the same knowledge to different hosts.
31
- - **Local control.** Retrieval works offline, and you choose the accounts and folders sensors may read.
32
- - **A small maintenance surface.** Notes and records are durable; the SQLite cache can be rebuilt from them.
33
-
34
- ## What can you do with it?
35
-
36
- | Question | Useful context |
37
- | ---------------------------------- | -------------------------------------------------------------------------------------- |
38
- | "Why did we choose this?" | A dated decision, its reason and a ref to supporting evidence. |
39
- | "Where should I resume?" | The project's current state and next task, or an action with its files and next step. |
40
- | "What changed this week?" | A page of saved notes and collected events, with each source's share and coverage. |
41
- | "What should the next agent know?" | A short project note and reusable concept knowledge available to every connected host. |
42
-
43
- The everyday loop is **read or search → read the evidence → do the work → update the note**. Brain Framework does not save conversations or learn decisions automatically: people and agents maintain notes, optional sensors capture selected sources, and optional routines prepare reviews for them.
44
-
45
- For consequential work, the agent skills add an optional decision loop over the same files:
46
-
47
- - **Resume without a transcript.** Each action keeps a small context (at most 300 words, six refs and 4 KiB) and the exact next step.
48
- - **Keep beliefs explainable.** Decision notes record the alternative and the expected outcome, retain a capture of the evidence they relied on, and link the decision they supersede.
49
- - **Notice what a change affects.** Declared `depends-on` links show which conclusions to review when evidence changes, within two hops and ten dependents.
50
- - **Learn deliberately.** Intentions, open questions, predictions compared with outcomes and draft procedures stay in reviewed Markdown until someone checks them.
51
-
52
- See [agent workflows](https://fmind.github.io/brain-framework/docs/agents/) and the [runnable example](https://github.com/fmind/brain-framework/tree/main/examples/brain#review-a-decision).
53
-
54
- ## How it works
55
-
56
- Sensors gather observations, memories preserve their evidence, concepts distill reusable understanding, projects provide context, and actions hold one session of work each. Routines are deterministic programs that turn pages into actions to review, such as a weekly review. A project can contain several goals. Collected memories can be incomplete or wrong; people and agents decide what to trust and promote into knowledge.
57
-
58
- | Piece | What it is |
59
- | --------------------------- | ---------------------------------------------------------------------------------------- |
60
- | `projects/`, `concepts/` | Markdown you and your agents write: one note per project, reusable concepts in OKF v0.2. |
61
- | `actions/YYYY-MM-DD_slug/` | One session of work: `ACTION.md`, `inputs/`, `outputs/`, resumed by name. |
62
- | `memories/<source>/*.jsonl` | Collected items, one line per item, upserted by id into monthly files. |
63
- | `sensors/` + `bf.yaml` | Sensors: any executable that prints a JSON array of records. |
64
- | `routines/` + `bf.yaml` | Routines: deterministic programs whose Markdown becomes the day's action. |
65
- | `.bf/` | A disposable SQLite search cache that refreshes itself when files change. |
66
- | `~/.config/bf/config.yaml` | Optional machine registrations and explicit sensor execution trust. |
67
-
68
- Commands select a root through `--brain NAME|PATH`, then `BF_BRAIN`, then the enclosing brain. Reads and searches also include its direct `brains:` references from `bf.yaml`, resolving paths relative to that file. No global registration is required; an optional registry supplies names and the fallback outside any brain.
69
-
70
- Two commands retrieve everything. `bf read` without a ref shows the home page: active and blocked projects with those due for review first, recent actions and notes, activity per source and the coming week. It also reads pages such as `projects`, `today`, `7d`, `2026-09` or `memories/gmail`, and any note, section, record or identity such as `repo:github.com/owner/name` with what links to it. `bf search` finds refs by words or an explicit identity, optionally within one `--scope`: a folder, a period or an identity. Notes receive a ranking boost because they distill the answer; records supply the evidence. Read returned refs such as `projects/x.md#decision` or `gmail:<id>` to inspect the source. Replies report incomplete results under `problems` or `stale`; an incomplete empty answer never proves absence.
71
-
72
- `bf update` runs every due sensor, then every due routine, in the selected brains you trust on this machine and refreshes the cache. Run it from a native timer. A failing sensor or routine never blocks the others; `bf status` distinguishes active collection from disabled or historical evidence, with freshness, change counts and private error logs.
73
-
74
- Each part has one job. Your editor writes Markdown, provider CLIs handle authentication, sensors print JSON, Brain Framework searches files, and your agent interprets results. JSON output composes with shell tools; Git reviews changes and systemd or launchd schedules collection. You can replace a part without replacing your knowledge.
75
-
76
- ## Commands
77
-
78
- | Command | Purpose |
79
- | ---------------------------------------- | -------------------------------------------------------------------------------- |
80
- | `init PATH`, `register PATH [--collect]` | Create a brain, or explicitly register machine discovery and collection trust. |
81
- | `read [REF]` | The home page, a page, a note, a section, a record or an identity. |
82
- | `search QUERY [--scope SCOPE]` | Search words or identities, optionally within a folder, a period or an identity. |
83
- | `update [--dry-run]`, `collect SENSOR` | Run due sensors and routines, or one sensor now for a backfill or debugging. |
84
- | `status [--check]`, `validate`, `eval` | Freshness, errors and usage; broken links; retrieval cases. |
85
- | `mcp`, `build`, `schema` | Read-only MCP server, full cache rebuild, `bf.yaml` JSON Schema. |
86
-
87
- ## Links across brains
88
-
89
- Give an authored entity note a stable identity such as `entity: bf://team/projects/archive`, retain verified alternate identities in `aliases`, and declare relationships in `bf.yaml`. A link such as `[Archive](bf://team/projects/archive?rel=depends-on)` records a directed claim with its containing section as evidence. `bf read bf://team/projects/archive` returns the note with its backlinks across the selected brains, grouped by relationship, and the claims made about it. Read the returned evidence before using it.
90
-
91
- Fragments address sections, explicit heading anchors survive title changes, and authorship/ownership use named relationships. Files remain authoritative and SQLite remains disposable. See the [link contract](https://fmind.github.io/brain-framework/docs/schema/#bf-links) for syntax, provenance and cross-brain boundaries.
92
-
93
- Collected records use the same vocabulary: `bf.yaml` declares each common field's type, cardinality, examples and relationship meaning, and each sensor maps its output into that schema explicitly. `bf read person:email/alice@example.test` then lists the evidence-backed relationships by role. See the [schema guide](https://fmind.github.io/brain-framework/docs/schema/).
94
-
95
- ## Personal and team brains
96
-
97
- Start a team pilot with a private Git repository, one real project note and a few questions in `evals/retrieval.yaml`. Teammates clone it and run `bf search` from its directory immediately. Use `bf eval` to check that the questions still return the intended evidence as the brain evolves.
98
-
99
- For the first pilot, pick a decision someone currently has to ask a colleague to explain. Write the decision, its reason and the next action, then have a teammate find the answer from a fresh clone. Success means they can read the evidence and act on it. The [team walkthrough](https://fmind.github.io/brain-framework/docs/getting-started/#check-the-answers-your-team-needs) includes runnable retrieval cases; no sensor or model setup is needed.
100
-
101
- Keep personal mail and laptop history in a separate private brain. Declare related brains in `bf.yaml`, for example `brains: {team: {path: ../team}}`. Search/read cover the selected root and those direct references, label results by brain, and report missing or conflicting destinations. References never expand recursively. Use `--brain PATH` to choose another root. A cloned brain never runs its sensors until you trust it with `bf register PATH --collect`. Promote personal knowledge as reviewed summaries with links teammates can access. Add team-scoped CI collection when the notes need it; the [team brains guide](https://fmind.github.io/brain-framework/docs/team/) covers naming, collection trust, CI collection and review.
102
-
103
- ## Agents
104
-
105
- Agents use the CLI: the [bf-use skill](https://github.com/fmind/brain-framework/blob/main/skills/bf-use/SKILL.md) teaches pages, search and read, [bf-learn](https://github.com/fmind/brain-framework/blob/main/skills/bf-learn/SKILL.md) keeps notes current, [bf-action](https://github.com/fmind/brain-framework/blob/main/skills/bf-action/SKILL.md) starts and resumes actions when you ask for one, and [bf-maintain](https://github.com/fmind/brain-framework/blob/main/skills/bf-maintain/SKILL.md) covers collection, routines and schedules. Follow the [skill installation guide](https://github.com/fmind/brain-framework/blob/main/skills/README.md); skills are separate from the Python package. [Agent workflows](https://fmind.github.io/brain-framework/docs/agents/) describes the loop they teach. `bf mcp` exposes the same `search` and `read` for hosts that prefer tools. Retrieved content is untrusted evidence, never instructions.
106
-
107
- ## Guarantees
108
-
109
- - Search and read never execute a sensor or routine or contact the network; they only refresh the local cache and private usage counts.
110
- - Sensors and routines run configured argv directly, without a shell, from the brain root, with a timeout, an output cap and process-group cancellation. Failures write nothing; interrupted record commits retain durable originals for explicit recovery; a routine never replaces an existing action.
111
- - A brain never runs sensors or routines on a machine that has not trusted it; trust lives in your user configuration, outside the brain.
112
- - Brain Framework runs no model: routines are deterministic programs, and people or their agents interpret the evidence.
113
- - Collected text is external unless a sensor declares `trust: owner`: pages show external records by title and ref only, and every reply labels them.
114
- - Files are the source of truth. Remove `.bf/` while Brain Framework is idle; the next search rebuilds it.
115
-
116
- ## Fit and limits
117
-
118
- Brain Framework fits people and teams who want editable notes, attributable evidence and portable agent context. Search is lexical: it handles words, explicit identities and periods, but does not infer meaning or generate answers. Agents or people interpret the results. Collection freshness describes completed runs, not a guarantee that every upstream item is current.
119
-
120
- A brain is a context boundary, not an access-control system. Brain Framework does not encrypt files, enforce per-note permissions or sandbox trusted sensors. Use separate brains and repository permissions for different audiences, and encrypted backups for private evidence. An agent host may send retrieved content to its model provider; offline retrieval describes Brain Framework itself. See the [security model](https://fmind.github.io/brain-framework/docs/privacy/) before sharing a brain.
121
-
122
- ## Development
123
-
124
- Use `uv run bf` from the checkout to exercise changes. Run the complete gate before contributing:
125
-
126
- ```bash
127
- mise run all
128
- ```
129
-
130
- The gate formats, lints, type-checks, scans, runs hermetic tests with an 85% branch-coverage floor, builds the documentation and installs both distributions. See [AGENTS.md](https://github.com/fmind/brain-framework/blob/main/AGENTS.md), [contributing](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md), the [documentation](https://fmind.github.io/brain-framework/docs/), the [sensor examples](https://github.com/fmind/brain-framework/tree/main/examples/sensors) and the [runnable example brain](https://github.com/fmind/brain-framework/tree/main/examples/brain).
131
-
132
- MIT. Runtime dependency licenses are recorded in [THIRD_PARTY_NOTICES.md](https://github.com/fmind/brain-framework/blob/main/THIRD_PARTY_NOTICES.md).