brain-framework 21.4.1__tar.gz → 22.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.
- brain_framework-22.0.0/PKG-INFO +187 -0
- brain_framework-22.0.0/README.md +153 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/THIRD_PARTY_NOTICES.md +11 -11
- {brain_framework-21.4.1 → brain_framework-22.0.0}/pyproject.toml +3 -3
- {brain_framework-21.4.1 → brain_framework-22.0.0}/pyproject.toml.orig +3 -5
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/__init__.py +10 -1
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/assistants.py +295 -80
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/cli.py +401 -100
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/collect.py +166 -37
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/graph.py +22 -6
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/health.py +65 -25
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/history.py +3 -1
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/index.py +46 -7
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/install.py +100 -7
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/links.py +2 -2
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/markdown.py +2 -1
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/mcp.py +4 -4
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/models.py +256 -72
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/ontology.py +9 -1
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/pages.py +272 -14
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/replies.py +81 -49
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/retrieve.py +9 -10
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/runtime.py +405 -63
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/schemas.py +2 -3
- brain_framework-22.0.0/src/bf/skills/README.md +37 -0
- brain_framework-22.0.0/src/bf/skills/bf-action/SKILL.md +52 -0
- brain_framework-22.0.0/src/bf/skills/bf-action/references/actions.md +29 -0
- brain_framework-22.0.0/src/bf/skills/bf-action/references/context.md +21 -0
- brain_framework-22.0.0/src/bf/skills/bf-action/references/handoff.md +36 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/skills/bf-action/scripts/check-handoff.py +9 -5
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/skills/bf-action/templates/action.md +1 -1
- brain_framework-22.0.0/src/bf/skills/bf-maintain/SKILL.md +46 -0
- brain_framework-22.0.0/src/bf/skills/bf-maintain/references/conflicts.md +10 -0
- brain_framework-22.0.0/src/bf/skills/bf-maintain/references/integrations.md +94 -0
- brain_framework-22.0.0/src/bf/skills/bf-maintain/references/operations.md +42 -0
- brain_framework-22.0.0/src/bf/skills/bf-setup/SKILL.md +55 -0
- brain_framework-22.0.0/src/bf/skills/bf-setup/references/discovery.md +15 -0
- brain_framework-22.0.0/src/bf/skills/bf-setup/references/import.md +20 -0
- brain_framework-22.0.0/src/bf/skills/bf-setup/references/scan.md +19 -0
- brain_framework-22.0.0/src/bf/skills/bf-use/SKILL.md +53 -0
- brain_framework-22.0.0/src/bf/skills/bf-use/references/evidence.md +32 -0
- brain_framework-22.0.0/src/bf/skills/bf-use/references/learn.md +43 -0
- brain_framework-22.0.0/src/bf/skills/bf-use/references/links.md +28 -0
- brain_framework-22.0.0/src/bf/skills/bf-use/references/retrieval.md +26 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/skills/bf-use/scripts/evidence.py +6 -1
- brain_framework-22.0.0/src/bf/starter/AGENTS.md +23 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/update.py +78 -19
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/usage.py +1 -1
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/validate.py +61 -15
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/watch.py +30 -9
- brain_framework-21.4.1/PKG-INFO +0 -310
- brain_framework-21.4.1/README.md +0 -276
- brain_framework-21.4.1/src/bf/skills/README.md +0 -59
- brain_framework-21.4.1/src/bf/skills/bf-action/SKILL.md +0 -53
- brain_framework-21.4.1/src/bf/skills/bf-action/references/actions.md +0 -27
- brain_framework-21.4.1/src/bf/skills/bf-action/references/context.md +0 -21
- brain_framework-21.4.1/src/bf/skills/bf-action/references/handoff.md +0 -42
- brain_framework-21.4.1/src/bf/skills/bf-action/scripts/new-action.py +0 -148
- brain_framework-21.4.1/src/bf/skills/bf-maintain/SKILL.md +0 -58
- brain_framework-21.4.1/src/bf/skills/bf-maintain/references/conflicts.md +0 -14
- brain_framework-21.4.1/src/bf/skills/bf-maintain/references/integrations.md +0 -92
- brain_framework-21.4.1/src/bf/skills/bf-maintain/references/operations.md +0 -67
- brain_framework-21.4.1/src/bf/skills/bf-setup/SKILL.md +0 -64
- brain_framework-21.4.1/src/bf/skills/bf-setup/references/discovery.md +0 -32
- brain_framework-21.4.1/src/bf/skills/bf-setup/references/import.md +0 -36
- brain_framework-21.4.1/src/bf/skills/bf-setup/references/scan.md +0 -27
- brain_framework-21.4.1/src/bf/skills/bf-use/SKILL.md +0 -74
- brain_framework-21.4.1/src/bf/skills/bf-use/references/consolidate.md +0 -9
- brain_framework-21.4.1/src/bf/skills/bf-use/references/decisions.md +0 -31
- brain_framework-21.4.1/src/bf/skills/bf-use/references/evidence.md +0 -50
- brain_framework-21.4.1/src/bf/skills/bf-use/references/learn.md +0 -39
- brain_framework-21.4.1/src/bf/skills/bf-use/references/links.md +0 -59
- brain_framework-21.4.1/src/bf/skills/bf-use/references/retrieval.md +0 -39
- brain_framework-21.4.1/src/bf/skills/bf-use/references/review.md +0 -10
- brain_framework-21.4.1/src/bf/skills/bf-use/references/share.md +0 -12
- brain_framework-21.4.1/src/bf/starter/AGENTS.md +0 -23
- {brain_framework-21.4.1 → brain_framework-22.0.0}/LICENSE +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/__main__.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/channels.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/config.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/evaluate.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/messages.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/py.typed +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/records.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/skills/bf-setup/scripts/inventory.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/skills/bf-use/scripts/guarded-write.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/skills/bf-use/templates/concept.md +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/skills/bf-use/templates/project.md +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/starter/concepts/index.md +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/starter/concepts/welcome.md +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/starter/evals/retrieval.yaml +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/starter/gitignore +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/storage.py +0 -0
- {brain_framework-21.4.1 → brain_framework-22.0.0}/src/bf/watch_settings.py +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: brain-framework
|
|
3
|
+
Version: 22.0.0
|
|
4
|
+
Summary: Brain Framework is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an ontology you declare, lets any agent harness search and read offline, and wakes your harness when declarative when: rules or reviewed gates spot new evidence.
|
|
5
|
+
Keywords: ai,ai-agents,agent-memory,agent-skills,agents-md,context-engineering,knowledge-graph,knowledge-management,local-first,mcp,model-context-protocol,ontology,personal-knowledge-management,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: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Classifier: Topic :: Text Processing :: Indexing
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Dist: markdown-it-py>=4.2.0,<5
|
|
21
|
+
Requires-Dist: pydantic>=2.13.5,<3
|
|
22
|
+
Requires-Dist: pyyaml>=6.0.3,<7
|
|
23
|
+
Requires-Dist: rich>=15.0.0,<16
|
|
24
|
+
Requires-Dist: typer>=0.27.2
|
|
25
|
+
Requires-Dist: mcp>=2.1.1,<3 ; extra == 'mcp'
|
|
26
|
+
Requires-Python: >=3.14
|
|
27
|
+
Project-URL: Changelog, https://fmind.github.io/brain-framework/changelog/
|
|
28
|
+
Project-URL: Documentation, https://fmind.github.io/brain-framework/
|
|
29
|
+
Project-URL: Issues, https://github.com/fmind/brain-framework/issues
|
|
30
|
+
Project-URL: Repository, https://github.com/fmind/brain-framework
|
|
31
|
+
Project-URL: Security, https://github.com/fmind/brain-framework/security/policy
|
|
32
|
+
Provides-Extra: mcp
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img
|
|
37
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-framework.svg"
|
|
38
|
+
alt="Brain Framework: a robot head whose shell opens on a brain, above twin aperture eyes"
|
|
39
|
+
width="256"
|
|
40
|
+
height="256"
|
|
41
|
+
>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
# Brain Framework 🧠
|
|
45
|
+
|
|
46
|
+
**🧠 Brain Framework: from information to informed actions.**
|
|
47
|
+
|
|
48
|
+
Brain Framework (BF) is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an explicit ontology, lets any agent harness search and read offline, and wakes your harness when declarative `when:` rules or reviewed gates spot new evidence.
|
|
49
|
+
|
|
50
|
+
- **Plain files you own, open to any agent.** Markdown notes (`projects/`, `concepts/`, `actions/`) and JSON records (`memories/`), reached through the `bf` CLI, [MCP](https://fmind.github.io/brain-framework/docs/mcp/), [Agent Skills](https://agentskills.io/specification) and `AGENTS.md`.
|
|
51
|
+
- **Explicit graph and provenance.** `bf.yaml` maps provider fields into shared relations once at collection. Every claim keeps its source record, and `newer_evidence` flags notes when upstream evidence changes.
|
|
52
|
+
- **Controlled autonomy.** Built-in `when:` gates (`sources`, `review`, `actions`, `attention`) wake your harness offline with zero wasted model runs, and `propose: true` lets read-only assistants draft validated `ACTION.md` proposals.
|
|
53
|
+
|
|
54
|
+
[](https://github.com/fmind/brain-framework/actions/workflows/ci.yml) [](https://pypi.org/project/brain-framework/) [](https://pypi.org/project/brain-framework/) [](https://github.com/fmind/brain-framework/blob/main/LICENSE)
|
|
55
|
+
|
|
56
|
+
[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) · [Proactive agents](https://github.com/fmind/brain-framework#let-your-agent-come-to-you) · [Boundaries](https://github.com/fmind/brain-framework#good-to-know) · [Documentation](https://fmind.github.io/brain-framework/)
|
|
57
|
+
|
|
58
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
|
|
59
|
+
<img
|
|
60
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg"
|
|
61
|
+
alt="The Brain Framework loop: sensors gather evidence 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 context, act and compile outcomes back."
|
|
62
|
+
width="960"
|
|
63
|
+
>
|
|
64
|
+
</a>
|
|
65
|
+
|
|
66
|
+
## Try it
|
|
67
|
+
|
|
68
|
+
Requires Linux or macOS and [uv](https://docs.astral.sh/uv/getting-started/installation/) — no model or cloud account needed:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv tool install --python 3.14 brain-framework
|
|
72
|
+
bf init ~/brain && cd ~/brain
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Save `projects/new-website.md`:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
---
|
|
79
|
+
type: project
|
|
80
|
+
status: draft
|
|
81
|
+
updated: 2026-11-01
|
|
82
|
+
summary: Launch a product website that helps visitors understand the product.
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
# New website
|
|
86
|
+
|
|
87
|
+
## Decision
|
|
88
|
+
|
|
89
|
+
Start with a single product page because visitors need a clear explanation before signing up.
|
|
90
|
+
|
|
91
|
+
## Next actions
|
|
92
|
+
|
|
93
|
+
- [ ] Draft the product page.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Search and read the exact section:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bf search "visitors clear explanation"
|
|
100
|
+
bf read projects/new-website.md#decision
|
|
101
|
+
bf validate && bf eval
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Continue with [Getting started](https://fmind.github.io/brain-framework/docs/getting-started/) or the [four-tool walkthrough](https://fmind.github.io/brain-framework/docs/context-hub/) across Workspace, Jira, GitHub and Google Cloud fixtures.
|
|
105
|
+
|
|
106
|
+
## How it works
|
|
107
|
+
|
|
108
|
+
Five steps run in one loop: **gather → normalize → organize and connect → act → learn.**
|
|
109
|
+
|
|
110
|
+
| Folder | Role |
|
|
111
|
+
| ----------- | ----------------------------------------------------------------------------- |
|
|
112
|
+
| `memories/` | Collected JSON records keyed by SHA-256 of `id`, with provenance and `fields` |
|
|
113
|
+
| `projects/` | Project state (`Now`), decisions (`Decision`) and open tasks (`Next actions`) |
|
|
114
|
+
| `concepts/` | Durable reusable patterns and reference syntheses |
|
|
115
|
+
| `actions/` | Tracked work sessions (`draft` open, `stable` settled, `deprecated` retired) |
|
|
116
|
+
| `sensors/` | Stdlib scripts (built on `_sensor.py`) printing JSON or JSONL from your tools |
|
|
117
|
+
| `routines/` | Deterministic scripts (built on `_bf.py`) run on intervals, `at` or Git hooks |
|
|
118
|
+
|
|
119
|
+
`bf.yaml` declares shared [fields and mappings](https://fmind.github.io/brain-framework/docs/schema/#shared-fields-and-sensor-mappings), [sensors](https://fmind.github.io/brain-framework/docs/sensors/), [routines](https://fmind.github.io/brain-framework/docs/routines/) and [assistants](https://fmind.github.io/brain-framework/docs/prompts/). A disposable SQLite cache in `.bf/` powers offline BM25 search, graph backlinks (`bf read project:new-website`), triage (`bf read review`) and JSONL exports (`bf export --kind items`). See the [directory reference](https://fmind.github.io/brain-framework/docs/brain/#directory-reference).
|
|
120
|
+
|
|
121
|
+
## Open your agent in your brain
|
|
122
|
+
|
|
123
|
+
Install the packaged skills for [Claude Code](https://code.claude.com/docs/en/overview), [Codex](https://openai.com/codex/), [GitHub Copilot](https://github.com/features/copilot) or any [Agent Skills](https://agentskills.io/specification) host:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
bf skills ~/.agents/skills # global host discovery (~/.claude/skills for Claude Code)
|
|
127
|
+
bf skills skills --link # inside a brain: links .agents/skills and .claude/skills
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- **`bf-use`**: orient with `bf read review`, verify and cite `SOURCE:ID` refs, update owning notes and compile new evidence into `projects/` and `concepts/`.
|
|
131
|
+
- **`bf-action`**: start, resume, hand off and settle tracked work sessions (`bf action new`, `bf action status`).
|
|
132
|
+
- **`bf-setup`**: create a brain, connect CLI or [MCP](https://fmind.github.io/brain-framework/docs/mcp/) access, discover sources and import vaults.
|
|
133
|
+
- **`bf-maintain`**: add sensors/routines/assistants, run `bf watch`, recover queues and resolve Git conflicts.
|
|
134
|
+
|
|
135
|
+
See [agent workflows](https://fmind.github.io/brain-framework/docs/agents/) and optional repository [hooks](https://github.com/fmind/brain-framework/tree/main/examples/hooks).
|
|
136
|
+
|
|
137
|
+
## Bring your tools
|
|
138
|
+
|
|
139
|
+
Copy a reviewed stdlib sensor into `sensors/` alongside [`_sensor.py`](https://github.com/fmind/brain-framework/blob/main/examples/sensors/_sensor.py): [local documents](https://github.com/fmind/brain-framework/blob/main/examples/sensors/local-documents.py), [highlights](https://github.com/fmind/brain-framework/blob/main/examples/sensors/highlights.py), [Git history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/git-history.py), [GitHub history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/github-history.md), [Google 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), [Drive folders](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-drive-folders.py), or [any source you can script](https://fmind.github.io/brain-framework/docs/sensors/#any-source-you-can-script). Keep them fresh in a terminal or [background service](https://fmind.github.io/brain-framework/docs/schedule/) with `bf watch` ([offline demo](https://github.com/fmind/brain-framework/tree/main/examples/watch)):
|
|
140
|
+
|
|
141
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg">
|
|
142
|
+
<img
|
|
143
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg"
|
|
144
|
+
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."
|
|
145
|
+
width="960"
|
|
146
|
+
>
|
|
147
|
+
</a>
|
|
148
|
+
|
|
149
|
+
## Let your agent come to you
|
|
150
|
+
|
|
151
|
+
An [assistant](https://fmind.github.io/brain-framework/docs/prompts/) watches your brain offline and invokes your harness only when `when:` matches:
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
assistants:
|
|
155
|
+
triage:
|
|
156
|
+
prompt: prompts/triage.md
|
|
157
|
+
command:
|
|
158
|
+
[
|
|
159
|
+
claude,
|
|
160
|
+
--print,
|
|
161
|
+
--output-format,
|
|
162
|
+
json,
|
|
163
|
+
--json-schema,
|
|
164
|
+
"{{schema}}",
|
|
165
|
+
--tools,
|
|
166
|
+
"Read,Grep,Glob,Bash",
|
|
167
|
+
--allowedTools,
|
|
168
|
+
"Bash(bf read *),Bash(bf search *)",
|
|
169
|
+
--permission-mode,
|
|
170
|
+
dontAsk,
|
|
171
|
+
]
|
|
172
|
+
reply: { path: /structured_output }
|
|
173
|
+
propose: true
|
|
174
|
+
post: desktop
|
|
175
|
+
schedules:
|
|
176
|
+
mail: { every: 600, when: { sources: [mail] } }
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`when:` checks SQLite with zero subprocesses, passes new events to your harness, posts replies to your [channel](https://fmind.github.io/brain-framework/docs/channels/) and saves validated `draft` `ACTION.md` proposals when `propose: true`. See [safe prompts](https://fmind.github.io/brain-framework/docs/prompts/#keep-prompts-safe) and [propose, then act](https://fmind.github.io/brain-framework/docs/prompts/#propose-then-act).
|
|
180
|
+
|
|
181
|
+
## Good to know
|
|
182
|
+
|
|
183
|
+
1. **Local-first and private.** No BF server, account or telemetry; retrieval is 100% offline ([privacy and security](https://fmind.github.io/brain-framework/docs/privacy/)).
|
|
184
|
+
1. **Harnesses reason; BF verifies.** BF runs no LLM and ships no provider SDKs or embeddings (`bf export --kind items` feeds external retrievers; [what BF does not do](https://fmind.github.io/brain-framework/docs/concepts/#what-bf-does-not-do)).
|
|
185
|
+
1. **Git-native collaboration.** Version notes and programs in Git and federate [team brains](https://fmind.github.io/brain-framework/docs/team/) with `brains:`; major releases batch breaking changes cleanly ([versioning](https://fmind.github.io/brain-framework/docs/upgrades/#versioning-and-stability)).
|
|
186
|
+
|
|
187
|
+
[Commands](https://fmind.github.io/brain-framework/docs/commands/) · [Issues](https://github.com/fmind/brain-framework/issues) · [Contribute](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md) · [Governance](https://github.com/fmind/brain-framework/blob/main/GOVERNANCE.md) · [MIT License](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,153 @@
|
|
|
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
|
+
Brain Framework (BF) is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an explicit ontology, lets any agent harness search and read offline, and wakes your harness when declarative `when:` rules or reviewed gates spot new evidence.
|
|
15
|
+
|
|
16
|
+
- **Plain files you own, open to any agent.** Markdown notes (`projects/`, `concepts/`, `actions/`) and JSON records (`memories/`), reached through the `bf` CLI, [MCP](https://fmind.github.io/brain-framework/docs/mcp/), [Agent Skills](https://agentskills.io/specification) and `AGENTS.md`.
|
|
17
|
+
- **Explicit graph and provenance.** `bf.yaml` maps provider fields into shared relations once at collection. Every claim keeps its source record, and `newer_evidence` flags notes when upstream evidence changes.
|
|
18
|
+
- **Controlled autonomy.** Built-in `when:` gates (`sources`, `review`, `actions`, `attention`) wake your harness offline with zero wasted model runs, and `propose: true` lets read-only assistants draft validated `ACTION.md` proposals.
|
|
19
|
+
|
|
20
|
+
[](https://github.com/fmind/brain-framework/actions/workflows/ci.yml) [](https://pypi.org/project/brain-framework/) [](https://pypi.org/project/brain-framework/) [](https://github.com/fmind/brain-framework/blob/main/LICENSE)
|
|
21
|
+
|
|
22
|
+
[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) · [Proactive agents](https://github.com/fmind/brain-framework#let-your-agent-come-to-you) · [Boundaries](https://github.com/fmind/brain-framework#good-to-know) · [Documentation](https://fmind.github.io/brain-framework/)
|
|
23
|
+
|
|
24
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
|
|
25
|
+
<img
|
|
26
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg"
|
|
27
|
+
alt="The Brain Framework loop: sensors gather evidence 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 context, act and compile outcomes back."
|
|
28
|
+
width="960"
|
|
29
|
+
>
|
|
30
|
+
</a>
|
|
31
|
+
|
|
32
|
+
## Try it
|
|
33
|
+
|
|
34
|
+
Requires Linux or macOS and [uv](https://docs.astral.sh/uv/getting-started/installation/) — no model or cloud account needed:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
uv tool install --python 3.14 brain-framework
|
|
38
|
+
bf init ~/brain && cd ~/brain
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Save `projects/new-website.md`:
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
---
|
|
45
|
+
type: project
|
|
46
|
+
status: draft
|
|
47
|
+
updated: 2026-11-01
|
|
48
|
+
summary: Launch a product website that helps visitors understand the product.
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
# New website
|
|
52
|
+
|
|
53
|
+
## Decision
|
|
54
|
+
|
|
55
|
+
Start with a single product page because visitors need a clear explanation before signing up.
|
|
56
|
+
|
|
57
|
+
## Next actions
|
|
58
|
+
|
|
59
|
+
- [ ] Draft the product page.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Search and read the exact section:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
bf search "visitors clear explanation"
|
|
66
|
+
bf read projects/new-website.md#decision
|
|
67
|
+
bf validate && bf eval
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Continue with [Getting started](https://fmind.github.io/brain-framework/docs/getting-started/) or the [four-tool walkthrough](https://fmind.github.io/brain-framework/docs/context-hub/) across Workspace, Jira, GitHub and Google Cloud fixtures.
|
|
71
|
+
|
|
72
|
+
## How it works
|
|
73
|
+
|
|
74
|
+
Five steps run in one loop: **gather → normalize → organize and connect → act → learn.**
|
|
75
|
+
|
|
76
|
+
| Folder | Role |
|
|
77
|
+
| ----------- | ----------------------------------------------------------------------------- |
|
|
78
|
+
| `memories/` | Collected JSON records keyed by SHA-256 of `id`, with provenance and `fields` |
|
|
79
|
+
| `projects/` | Project state (`Now`), decisions (`Decision`) and open tasks (`Next actions`) |
|
|
80
|
+
| `concepts/` | Durable reusable patterns and reference syntheses |
|
|
81
|
+
| `actions/` | Tracked work sessions (`draft` open, `stable` settled, `deprecated` retired) |
|
|
82
|
+
| `sensors/` | Stdlib scripts (built on `_sensor.py`) printing JSON or JSONL from your tools |
|
|
83
|
+
| `routines/` | Deterministic scripts (built on `_bf.py`) run on intervals, `at` or Git hooks |
|
|
84
|
+
|
|
85
|
+
`bf.yaml` declares shared [fields and mappings](https://fmind.github.io/brain-framework/docs/schema/#shared-fields-and-sensor-mappings), [sensors](https://fmind.github.io/brain-framework/docs/sensors/), [routines](https://fmind.github.io/brain-framework/docs/routines/) and [assistants](https://fmind.github.io/brain-framework/docs/prompts/). A disposable SQLite cache in `.bf/` powers offline BM25 search, graph backlinks (`bf read project:new-website`), triage (`bf read review`) and JSONL exports (`bf export --kind items`). See the [directory reference](https://fmind.github.io/brain-framework/docs/brain/#directory-reference).
|
|
86
|
+
|
|
87
|
+
## Open your agent in your brain
|
|
88
|
+
|
|
89
|
+
Install the packaged skills for [Claude Code](https://code.claude.com/docs/en/overview), [Codex](https://openai.com/codex/), [GitHub Copilot](https://github.com/features/copilot) or any [Agent Skills](https://agentskills.io/specification) host:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
bf skills ~/.agents/skills # global host discovery (~/.claude/skills for Claude Code)
|
|
93
|
+
bf skills skills --link # inside a brain: links .agents/skills and .claude/skills
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
- **`bf-use`**: orient with `bf read review`, verify and cite `SOURCE:ID` refs, update owning notes and compile new evidence into `projects/` and `concepts/`.
|
|
97
|
+
- **`bf-action`**: start, resume, hand off and settle tracked work sessions (`bf action new`, `bf action status`).
|
|
98
|
+
- **`bf-setup`**: create a brain, connect CLI or [MCP](https://fmind.github.io/brain-framework/docs/mcp/) access, discover sources and import vaults.
|
|
99
|
+
- **`bf-maintain`**: add sensors/routines/assistants, run `bf watch`, recover queues and resolve Git conflicts.
|
|
100
|
+
|
|
101
|
+
See [agent workflows](https://fmind.github.io/brain-framework/docs/agents/) and optional repository [hooks](https://github.com/fmind/brain-framework/tree/main/examples/hooks).
|
|
102
|
+
|
|
103
|
+
## Bring your tools
|
|
104
|
+
|
|
105
|
+
Copy a reviewed stdlib sensor into `sensors/` alongside [`_sensor.py`](https://github.com/fmind/brain-framework/blob/main/examples/sensors/_sensor.py): [local documents](https://github.com/fmind/brain-framework/blob/main/examples/sensors/local-documents.py), [highlights](https://github.com/fmind/brain-framework/blob/main/examples/sensors/highlights.py), [Git history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/git-history.py), [GitHub history](https://github.com/fmind/brain-framework/blob/main/examples/sensors/github-history.md), [Google 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), [Drive folders](https://github.com/fmind/brain-framework/blob/main/examples/sensors/google-drive-folders.py), or [any source you can script](https://fmind.github.io/brain-framework/docs/sensors/#any-source-you-can-script). Keep them fresh in a terminal or [background service](https://fmind.github.io/brain-framework/docs/schedule/) with `bf watch` ([offline demo](https://github.com/fmind/brain-framework/tree/main/examples/watch)):
|
|
106
|
+
|
|
107
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg">
|
|
108
|
+
<img
|
|
109
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg"
|
|
110
|
+
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."
|
|
111
|
+
width="960"
|
|
112
|
+
>
|
|
113
|
+
</a>
|
|
114
|
+
|
|
115
|
+
## Let your agent come to you
|
|
116
|
+
|
|
117
|
+
An [assistant](https://fmind.github.io/brain-framework/docs/prompts/) watches your brain offline and invokes your harness only when `when:` matches:
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
assistants:
|
|
121
|
+
triage:
|
|
122
|
+
prompt: prompts/triage.md
|
|
123
|
+
command:
|
|
124
|
+
[
|
|
125
|
+
claude,
|
|
126
|
+
--print,
|
|
127
|
+
--output-format,
|
|
128
|
+
json,
|
|
129
|
+
--json-schema,
|
|
130
|
+
"{{schema}}",
|
|
131
|
+
--tools,
|
|
132
|
+
"Read,Grep,Glob,Bash",
|
|
133
|
+
--allowedTools,
|
|
134
|
+
"Bash(bf read *),Bash(bf search *)",
|
|
135
|
+
--permission-mode,
|
|
136
|
+
dontAsk,
|
|
137
|
+
]
|
|
138
|
+
reply: { path: /structured_output }
|
|
139
|
+
propose: true
|
|
140
|
+
post: desktop
|
|
141
|
+
schedules:
|
|
142
|
+
mail: { every: 600, when: { sources: [mail] } }
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`when:` checks SQLite with zero subprocesses, passes new events to your harness, posts replies to your [channel](https://fmind.github.io/brain-framework/docs/channels/) and saves validated `draft` `ACTION.md` proposals when `propose: true`. See [safe prompts](https://fmind.github.io/brain-framework/docs/prompts/#keep-prompts-safe) and [propose, then act](https://fmind.github.io/brain-framework/docs/prompts/#propose-then-act).
|
|
146
|
+
|
|
147
|
+
## Good to know
|
|
148
|
+
|
|
149
|
+
1. **Local-first and private.** No BF server, account or telemetry; retrieval is 100% offline ([privacy and security](https://fmind.github.io/brain-framework/docs/privacy/)).
|
|
150
|
+
1. **Harnesses reason; BF verifies.** BF runs no LLM and ships no provider SDKs or embeddings (`bf export --kind items` feeds external retrievers; [what BF does not do](https://fmind.github.io/brain-framework/docs/concepts/#what-bf-does-not-do)).
|
|
151
|
+
1. **Git-native collaboration.** Version notes and programs in Git and federate [team brains](https://fmind.github.io/brain-framework/docs/team/) with `brains:`; major releases batch breaking changes cleanly ([versioning](https://fmind.github.io/brain-framework/docs/upgrades/#versioning-and-stability)).
|
|
152
|
+
|
|
153
|
+
[Commands](https://fmind.github.io/brain-framework/docs/commands/) · [Issues](https://github.com/fmind/brain-framework/issues) · [Contribute](https://github.com/fmind/brain-framework/blob/main/CONTRIBUTING.md) · [Governance](https://github.com/fmind/brain-framework/blob/main/GOVERNANCE.md) · [MIT License](https://github.com/fmind/brain-framework/blob/main/LICENSE) · [Third-party notices](https://github.com/fmind/brain-framework/blob/main/THIRD_PARTY_NOTICES.md)
|
|
@@ -4,15 +4,15 @@ Brain Framework depends on the following non-development Python distributions on
|
|
|
4
4
|
|
|
5
5
|
License expressions come from the installed distribution metadata. Legal text is copied from the corresponding installed wheel files and formatted only as Markdown text blocks. The Brain Framework project itself is licensed separately in `LICENSE`.
|
|
6
6
|
|
|
7
|
-
## annotated-doc 0.0.
|
|
7
|
+
## annotated-doc 0.0.6
|
|
8
8
|
|
|
9
9
|
Source: <https://github.com/fastapi/annotated-doc>
|
|
10
10
|
|
|
11
11
|
License: `MIT`
|
|
12
12
|
|
|
13
|
-
Evidence: `annotated_doc-0.0.
|
|
13
|
+
Evidence: `annotated_doc-0.0.6.dist-info/licenses/LICENSE`
|
|
14
14
|
|
|
15
|
-
### annotated_doc-0.0.
|
|
15
|
+
### annotated_doc-0.0.6.dist-info/licenses/LICENSE
|
|
16
16
|
|
|
17
17
|
```text
|
|
18
18
|
The MIT License (MIT)
|
|
@@ -682,15 +682,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
682
682
|
THE SOFTWARE.
|
|
683
683
|
```
|
|
684
684
|
|
|
685
|
-
## markdown-it-py 4.
|
|
685
|
+
## markdown-it-py 4.3.0
|
|
686
686
|
|
|
687
687
|
Source: <https://github.com/executablebooks/markdown-it-py>
|
|
688
688
|
|
|
689
689
|
License: `MIT`
|
|
690
690
|
|
|
691
|
-
Evidence: `markdown_it_py-4.
|
|
691
|
+
Evidence: `markdown_it_py-4.3.0.dist-info/licenses/LICENSE`
|
|
692
692
|
|
|
693
|
-
### markdown_it_py-4.
|
|
693
|
+
### markdown_it_py-4.3.0.dist-info/licenses/LICENSE
|
|
694
694
|
|
|
695
695
|
```text
|
|
696
696
|
MIT License
|
|
@@ -716,9 +716,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
716
716
|
SOFTWARE.
|
|
717
717
|
```
|
|
718
718
|
|
|
719
|
-
Evidence: `markdown_it_py-4.
|
|
719
|
+
Evidence: `markdown_it_py-4.3.0.dist-info/licenses/LICENSE.markdown-it`
|
|
720
720
|
|
|
721
|
-
### markdown_it_py-4.
|
|
721
|
+
### markdown_it_py-4.3.0.dist-info/licenses/LICENSE.markdown-it
|
|
722
722
|
|
|
723
723
|
```text
|
|
724
724
|
Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin.
|
|
@@ -1749,7 +1749,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
1749
1749
|
THE SOFTWARE.
|
|
1750
1750
|
```
|
|
1751
1751
|
|
|
1752
|
-
## typer 0.
|
|
1752
|
+
## typer 0.29.0
|
|
1753
1753
|
|
|
1754
1754
|
Source: <https://github.com/fastapi/typer>
|
|
1755
1755
|
|
|
@@ -1757,9 +1757,9 @@ License: `MIT`
|
|
|
1757
1757
|
|
|
1758
1758
|
The distribution vendors code adapted from Click in `typer/_click/`; its bundled `BSD-3-Clause` license is included below.
|
|
1759
1759
|
|
|
1760
|
-
Evidence: `typer-0.
|
|
1760
|
+
Evidence: `typer-0.29.0.dist-info/licenses/LICENSE`
|
|
1761
1761
|
|
|
1762
|
-
### typer-0.
|
|
1762
|
+
### typer-0.29.0.dist-info/licenses/LICENSE
|
|
1763
1763
|
|
|
1764
1764
|
```text
|
|
1765
1765
|
The MIT License (MIT)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "brain-framework"
|
|
3
|
-
version = "
|
|
4
|
-
description = "Brain Framework is a local-first brain for you and your AI agents. It
|
|
3
|
+
version = "22.0.0"
|
|
4
|
+
description = "Brain Framework is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an ontology you declare, lets any agent harness search and read offline, and wakes your harness when declarative when: rules or reviewed gates spot new evidence."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.14"
|
|
7
7
|
license = "MIT"
|
|
@@ -43,7 +43,7 @@ dependencies = [
|
|
|
43
43
|
"pydantic>=2.13.5,<3",
|
|
44
44
|
"pyyaml>=6.0.3,<7",
|
|
45
45
|
"rich>=15.0.0,<16",
|
|
46
|
-
"typer>=0.27.2
|
|
46
|
+
"typer>=0.27.2",
|
|
47
47
|
]
|
|
48
48
|
|
|
49
49
|
[[project.authors]]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# https://packaging.python.org/en/latest/specifications/pyproject-toml/
|
|
2
2
|
[project]
|
|
3
3
|
name = "brain-framework"
|
|
4
|
-
version = "
|
|
5
|
-
description = "Brain Framework is a local-first brain for you and your AI agents. It
|
|
4
|
+
version = "22.0.0"
|
|
5
|
+
description = "Brain Framework is a local-first brain for you and your AI agents. It collects evidence from your tools into plain files you own, connects them through an ontology you declare, lets any agent harness search and read offline, and wakes your harness when declarative when: rules or reviewed gates spot new evidence."
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
requires-python = ">=3.14"
|
|
8
8
|
license = "MIT"
|
|
@@ -42,9 +42,7 @@ dependencies = [
|
|
|
42
42
|
"pydantic>=2.13.5,<3",
|
|
43
43
|
"pyyaml>=6.0.3,<7",
|
|
44
44
|
"rich>=15.0.0,<16",
|
|
45
|
-
|
|
46
|
-
# raise the cap together with that call.
|
|
47
|
-
"typer>=0.27.2,<0.29",
|
|
45
|
+
"typer>=0.27.2",
|
|
48
46
|
]
|
|
49
47
|
|
|
50
48
|
[project.optional-dependencies]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""🧠 Brain Framework: from information to informed actions."""
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
import sys
|
|
4
5
|
|
|
5
|
-
__version__ = "
|
|
6
|
+
__version__ = "22.0.0"
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
def main() -> None:
|
|
@@ -10,6 +11,14 @@ def main() -> None:
|
|
|
10
11
|
# Locks and process groups use POSIX primitives; fail clearly before importing them elsewhere.
|
|
11
12
|
if os.name != "posix":
|
|
12
13
|
raise SystemExit("bf: Brain Framework requires Linux or macOS")
|
|
14
|
+
if sys.argv[1:] == ["--version"] and sys.stdout is not None:
|
|
15
|
+
try:
|
|
16
|
+
sys.stdout.buffer.write(f"{__version__}\n".encode())
|
|
17
|
+
sys.stdout.flush()
|
|
18
|
+
except OSError:
|
|
19
|
+
pass
|
|
20
|
+
else:
|
|
21
|
+
return
|
|
13
22
|
from bf.cli import main as run
|
|
14
23
|
|
|
15
24
|
run()
|