brain-framework 22.0.0__tar.gz → 24.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. {brain_framework-22.0.0 → brain_framework-24.0.0}/PKG-INFO +33 -33
  2. {brain_framework-22.0.0 → brain_framework-24.0.0}/README.md +32 -32
  3. {brain_framework-22.0.0 → brain_framework-24.0.0}/pyproject.toml +7 -3
  4. {brain_framework-22.0.0 → brain_framework-24.0.0}/pyproject.toml.orig +8 -3
  5. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/__init__.py +1 -1
  6. brain_framework-24.0.0/src/bf/cli.py +973 -0
  7. brain_framework-24.0.0/src/bf/collect.py +483 -0
  8. brain_framework-24.0.0/src/bf/config.py +460 -0
  9. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/evaluate.py +6 -11
  10. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/graph.py +50 -86
  11. brain_framework-24.0.0/src/bf/guide.py +75 -0
  12. brain_framework-24.0.0/src/bf/guides/authoring.md +58 -0
  13. brain_framework-24.0.0/src/bf/guides/events.md +60 -0
  14. brain_framework-24.0.0/src/bf/guides/getting-started.md +73 -0
  15. brain_framework-24.0.0/src/bf/guides/index.md +37 -0
  16. brain_framework-24.0.0/src/bf/guides/jobs.md +60 -0
  17. brain_framework-24.0.0/src/bf/guides/operations.md +65 -0
  18. brain_framework-24.0.0/src/bf/guides/reference.md +69 -0
  19. brain_framework-24.0.0/src/bf/guides/retrieval.md +60 -0
  20. brain_framework-24.0.0/src/bf/health.py +399 -0
  21. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/index.py +40 -78
  22. brain_framework-24.0.0/src/bf/install.py +314 -0
  23. brain_framework-24.0.0/src/bf/jobs.py +1085 -0
  24. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/links.py +36 -28
  25. brain_framework-24.0.0/src/bf/map.py +217 -0
  26. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/markdown.py +6 -1
  27. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/mcp.py +11 -12
  28. brain_framework-24.0.0/src/bf/models.py +1175 -0
  29. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/ontology.py +40 -126
  30. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/pages.py +243 -693
  31. brain_framework-24.0.0/src/bf/replies.py +576 -0
  32. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/retrieve.py +185 -330
  33. brain_framework-24.0.0/src/bf/runtime.py +776 -0
  34. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/schemas.py +8 -8
  35. brain_framework-24.0.0/src/bf/skills/bf/SKILL.md +35 -0
  36. brain_framework-24.0.0/src/bf/starter/AGENTS.md +21 -0
  37. brain_framework-24.0.0/src/bf/starter/gitignore +7 -0
  38. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/storage.py +50 -153
  39. brain_framework-24.0.0/src/bf/update.py +226 -0
  40. brain_framework-24.0.0/src/bf/usage.py +326 -0
  41. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/validate.py +180 -153
  42. brain_framework-24.0.0/src/bf/watch.py +823 -0
  43. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/watch_settings.py +1 -1
  44. brain_framework-22.0.0/src/bf/assistants.py +0 -1394
  45. brain_framework-22.0.0/src/bf/channels.py +0 -230
  46. brain_framework-22.0.0/src/bf/cli.py +0 -1532
  47. brain_framework-22.0.0/src/bf/collect.py +0 -1211
  48. brain_framework-22.0.0/src/bf/config.py +0 -550
  49. brain_framework-22.0.0/src/bf/health.py +0 -606
  50. brain_framework-22.0.0/src/bf/history.py +0 -168
  51. brain_framework-22.0.0/src/bf/install.py +0 -229
  52. brain_framework-22.0.0/src/bf/messages.py +0 -55
  53. brain_framework-22.0.0/src/bf/models.py +0 -1803
  54. brain_framework-22.0.0/src/bf/replies.py +0 -834
  55. brain_framework-22.0.0/src/bf/runtime.py +0 -1300
  56. brain_framework-22.0.0/src/bf/skills/README.md +0 -37
  57. brain_framework-22.0.0/src/bf/skills/bf-action/SKILL.md +0 -52
  58. brain_framework-22.0.0/src/bf/skills/bf-action/references/actions.md +0 -29
  59. brain_framework-22.0.0/src/bf/skills/bf-action/references/context.md +0 -21
  60. brain_framework-22.0.0/src/bf/skills/bf-action/references/handoff.md +0 -36
  61. brain_framework-22.0.0/src/bf/skills/bf-action/scripts/check-handoff.py +0 -133
  62. brain_framework-22.0.0/src/bf/skills/bf-action/templates/action.md +0 -37
  63. brain_framework-22.0.0/src/bf/skills/bf-maintain/SKILL.md +0 -46
  64. brain_framework-22.0.0/src/bf/skills/bf-maintain/references/conflicts.md +0 -10
  65. brain_framework-22.0.0/src/bf/skills/bf-maintain/references/integrations.md +0 -94
  66. brain_framework-22.0.0/src/bf/skills/bf-maintain/references/operations.md +0 -42
  67. brain_framework-22.0.0/src/bf/skills/bf-setup/SKILL.md +0 -55
  68. brain_framework-22.0.0/src/bf/skills/bf-setup/references/discovery.md +0 -15
  69. brain_framework-22.0.0/src/bf/skills/bf-setup/references/import.md +0 -20
  70. brain_framework-22.0.0/src/bf/skills/bf-setup/references/scan.md +0 -19
  71. brain_framework-22.0.0/src/bf/skills/bf-setup/scripts/inventory.py +0 -182
  72. brain_framework-22.0.0/src/bf/skills/bf-use/SKILL.md +0 -53
  73. brain_framework-22.0.0/src/bf/skills/bf-use/references/evidence.md +0 -32
  74. brain_framework-22.0.0/src/bf/skills/bf-use/references/learn.md +0 -43
  75. brain_framework-22.0.0/src/bf/skills/bf-use/references/links.md +0 -28
  76. brain_framework-22.0.0/src/bf/skills/bf-use/references/retrieval.md +0 -26
  77. brain_framework-22.0.0/src/bf/skills/bf-use/scripts/evidence.py +0 -348
  78. brain_framework-22.0.0/src/bf/skills/bf-use/scripts/guarded-write.py +0 -359
  79. brain_framework-22.0.0/src/bf/skills/bf-use/templates/concept.md +0 -16
  80. brain_framework-22.0.0/src/bf/skills/bf-use/templates/project.md +0 -29
  81. brain_framework-22.0.0/src/bf/starter/AGENTS.md +0 -23
  82. brain_framework-22.0.0/src/bf/starter/gitignore +0 -8
  83. brain_framework-22.0.0/src/bf/update.py +0 -338
  84. brain_framework-22.0.0/src/bf/usage.py +0 -346
  85. brain_framework-22.0.0/src/bf/watch.py +0 -1066
  86. {brain_framework-22.0.0 → brain_framework-24.0.0}/LICENSE +0 -0
  87. {brain_framework-22.0.0 → brain_framework-24.0.0}/THIRD_PARTY_NOTICES.md +0 -0
  88. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/__main__.py +0 -0
  89. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/py.typed +0 -0
  90. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/records.py +0 -0
  91. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/starter/concepts/index.md +0 -0
  92. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/starter/concepts/welcome.md +0 -0
  93. {brain_framework-22.0.0 → brain_framework-24.0.0}/src/bf/starter/evals/retrieval.yaml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brain-framework
3
- Version: 22.0.0
3
+ Version: 24.0.0
4
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
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
6
  Author: Médéric Hurier
@@ -45,11 +45,11 @@ Description-Content-Type: text/markdown
45
45
 
46
46
  **🧠 Brain Framework: from information to informed actions.**
47
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.
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 triggers or reviewed gates spot new evidence.
49
49
 
50
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.
51
+ - **Explicit graph and provenance.** `bf.yaml` `map:` rules or scripts map 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.** Scheduled or event-triggered jobs (`jobs:`) with reviewed `gate:` scripts wake your harness only when needed and deliver answers via `bf post` or validated `ACTION.md` drafts.
53
53
 
54
54
  [![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)
55
55
 
@@ -58,7 +58,7 @@ Brain Framework (BF) is a local-first brain for you and your AI agents. It colle
58
58
  <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
59
59
  <img
60
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."
61
+ alt="The Brain Framework loop: jobs gather evidence into a brain folder; bf.yaml declares the ontology, jobs and watch settings; memories, projects, concepts and actions form a knowledge graph; agents read context, act and compile outcomes back."
62
62
  width="960"
63
63
  >
64
64
  </a>
@@ -107,36 +107,38 @@ Continue with [Getting started](https://fmind.github.io/brain-framework/docs/get
107
107
 
108
108
  Five steps run in one loop: **gather → normalize → organize and connect → act → learn.**
109
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 |
110
+ | Folder | Role |
111
+ | ----------- | ------------------------------------------------------------------------------------------------------- |
112
+ | `memories/` | Collected JSON records keyed by SHA-256 of `id`, with provenance, `@type`, `relations` and `attributes` |
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/` | Standalone scripts printing JSON/JSONL or raw exports shaped by `bf.yaml` `map:` |
117
+ | `routines/` | Deterministic scripts (like `weekly-review.py`) run on intervals, `at`, events or Git hooks |
118
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).
119
+ `bf.yaml` declares shared [fields and mappings](https://fmind.github.io/brain-framework/docs/schema/#shared-fields-and-sensor-mappings) and unified [`jobs:`](https://fmind.github.io/brain-framework/docs/prompts/) covering [sensors](https://fmind.github.io/brain-framework/docs/sensors/), [routines](https://fmind.github.io/brain-framework/docs/routines/) and [channels](https://fmind.github.io/brain-framework/docs/channels/). 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
120
 
121
121
  ## Open your agent in your brain
122
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:
123
+ Install the packaged `/bf` skill 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
124
 
125
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
126
+ bf skill install --global # ~/.agents/skills/bf (and links ~/.claude/skills/bf if present)
127
+ bf skill install # inside a brain: skills/bf, linked to .agents/skills/bf and .claude/skills/bf
128
128
  ```
129
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.
130
+ The `/bf` router connects your harness to built-in offline documentation via `bf guide`:
131
+
132
+ - **`bf guide retrieval`**: orient with `bf read review`, verify and cite `SOURCE:ID` refs and export graph claims.
133
+ - **`bf guide authoring`**: update owning `projects/` and `concepts/`, manage tracked `actions/` (`bf action new`, `bf action status`) and connect entities.
134
+ - **`bf guide getting-started` / `bf guide operations`**: initialize or register brains, run [MCP](https://fmind.github.io/brain-framework/docs/mcp/), validate, evaluate and troubleshoot.
135
+ - **`bf guide jobs` / `bf guide events`**: configure `jobs:`, `map:`, `bf watch` triggers, recover queues and use Git hooks.
134
136
 
135
137
  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
138
 
137
139
  ## Bring your tools
138
140
 
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)):
141
+ Copy a standalone stdlib script into `sensors/` (or pair any JSON/JSONL CLI with `bf.yaml` `map:`): [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
142
 
141
143
  <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg">
142
144
  <img
@@ -148,20 +150,18 @@ Copy a reviewed stdlib sensor into `sensors/` alongside [`_sensor.py`](https://g
148
150
 
149
151
  ## Let your agent come to you
150
152
 
151
- An [assistant](https://fmind.github.io/brain-framework/docs/prompts/) watches your brain offline and invokes your harness only when `when:` matches:
153
+ A [prompt job](https://fmind.github.io/brain-framework/docs/prompts/) watches your brain offline and invokes your harness only when an event or `gate:` triggers it:
152
154
 
153
155
  ```yaml
154
- assistants:
156
+ jobs:
155
157
  triage:
156
158
  prompt: prompts/triage.md
157
- command:
159
+ harness:
158
160
  [
159
161
  claude,
160
162
  --print,
161
163
  --output-format,
162
164
  json,
163
- --json-schema,
164
- "{{schema}}",
165
165
  --tools,
166
166
  "Read,Grep,Glob,Bash",
167
167
  --allowedTools,
@@ -169,19 +169,19 @@ assistants:
169
169
  --permission-mode,
170
170
  dontAsk,
171
171
  ]
172
- reply: { path: /structured_output }
173
- propose: true
172
+ extract: /result
173
+ emit: message
174
174
  post: desktop
175
- schedules:
176
- mail: { every: 600, when: { sources: [mail] } }
175
+ on:
176
+ - { every: 600, event: { kind: record, source: mail } }
177
177
  ```
178
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).
179
+ Event rules and `gate:` scripts skip quiet intervals without starting a model, `extract:` unwraps harness JSON, and `post:` delivers answers through your [channel](https://fmind.github.io/brain-framework/docs/channels/) (while `emit: action` writes validated `draft` `ACTION.md` notes). 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
180
 
181
181
  ## Good to know
182
182
 
183
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
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)).
185
+ 1. **Git-native collaboration.** Version notes, ontology, programs and evals in Git while keeping local memories and `.bf/` caches out of shared history; major releases batch breaking changes cleanly ([versioning](https://fmind.github.io/brain-framework/docs/upgrades/#versioning-and-stability)).
186
186
 
187
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)
@@ -11,11 +11,11 @@
11
11
 
12
12
  **🧠 Brain Framework: from information to informed actions.**
13
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.
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 triggers or reviewed gates spot new evidence.
15
15
 
16
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.
17
+ - **Explicit graph and provenance.** `bf.yaml` `map:` rules or scripts map 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.** Scheduled or event-triggered jobs (`jobs:`) with reviewed `gate:` scripts wake your harness only when needed and deliver answers via `bf post` or validated `ACTION.md` drafts.
19
19
 
20
20
  [![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)
21
21
 
@@ -24,7 +24,7 @@ Brain Framework (BF) is a local-first brain for you and your AI agents. It colle
24
24
  <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
25
25
  <img
26
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."
27
+ alt="The Brain Framework loop: jobs gather evidence into a brain folder; bf.yaml declares the ontology, jobs and watch settings; memories, projects, concepts and actions form a knowledge graph; agents read context, act and compile outcomes back."
28
28
  width="960"
29
29
  >
30
30
  </a>
@@ -73,36 +73,38 @@ Continue with [Getting started](https://fmind.github.io/brain-framework/docs/get
73
73
 
74
74
  Five steps run in one loop: **gather → normalize → organize and connect → act → learn.**
75
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 |
76
+ | Folder | Role |
77
+ | ----------- | ------------------------------------------------------------------------------------------------------- |
78
+ | `memories/` | Collected JSON records keyed by SHA-256 of `id`, with provenance, `@type`, `relations` and `attributes` |
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/` | Standalone scripts printing JSON/JSONL or raw exports shaped by `bf.yaml` `map:` |
83
+ | `routines/` | Deterministic scripts (like `weekly-review.py`) run on intervals, `at`, events or Git hooks |
84
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).
85
+ `bf.yaml` declares shared [fields and mappings](https://fmind.github.io/brain-framework/docs/schema/#shared-fields-and-sensor-mappings) and unified [`jobs:`](https://fmind.github.io/brain-framework/docs/prompts/) covering [sensors](https://fmind.github.io/brain-framework/docs/sensors/), [routines](https://fmind.github.io/brain-framework/docs/routines/) and [channels](https://fmind.github.io/brain-framework/docs/channels/). 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
86
 
87
87
  ## Open your agent in your brain
88
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:
89
+ Install the packaged `/bf` skill 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
90
 
91
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
92
+ bf skill install --global # ~/.agents/skills/bf (and links ~/.claude/skills/bf if present)
93
+ bf skill install # inside a brain: skills/bf, linked to .agents/skills/bf and .claude/skills/bf
94
94
  ```
95
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.
96
+ The `/bf` router connects your harness to built-in offline documentation via `bf guide`:
97
+
98
+ - **`bf guide retrieval`**: orient with `bf read review`, verify and cite `SOURCE:ID` refs and export graph claims.
99
+ - **`bf guide authoring`**: update owning `projects/` and `concepts/`, manage tracked `actions/` (`bf action new`, `bf action status`) and connect entities.
100
+ - **`bf guide getting-started` / `bf guide operations`**: initialize or register brains, run [MCP](https://fmind.github.io/brain-framework/docs/mcp/), validate, evaluate and troubleshoot.
101
+ - **`bf guide jobs` / `bf guide events`**: configure `jobs:`, `map:`, `bf watch` triggers, recover queues and use Git hooks.
100
102
 
101
103
  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
104
 
103
105
  ## Bring your tools
104
106
 
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)):
107
+ Copy a standalone stdlib script into `sensors/` (or pair any JSON/JSONL CLI with `bf.yaml` `map:`): [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
108
 
107
109
  <a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/watch.svg">
108
110
  <img
@@ -114,20 +116,18 @@ Copy a reviewed stdlib sensor into `sensors/` alongside [`_sensor.py`](https://g
114
116
 
115
117
  ## Let your agent come to you
116
118
 
117
- An [assistant](https://fmind.github.io/brain-framework/docs/prompts/) watches your brain offline and invokes your harness only when `when:` matches:
119
+ A [prompt job](https://fmind.github.io/brain-framework/docs/prompts/) watches your brain offline and invokes your harness only when an event or `gate:` triggers it:
118
120
 
119
121
  ```yaml
120
- assistants:
122
+ jobs:
121
123
  triage:
122
124
  prompt: prompts/triage.md
123
- command:
125
+ harness:
124
126
  [
125
127
  claude,
126
128
  --print,
127
129
  --output-format,
128
130
  json,
129
- --json-schema,
130
- "{{schema}}",
131
131
  --tools,
132
132
  "Read,Grep,Glob,Bash",
133
133
  --allowedTools,
@@ -135,19 +135,19 @@ assistants:
135
135
  --permission-mode,
136
136
  dontAsk,
137
137
  ]
138
- reply: { path: /structured_output }
139
- propose: true
138
+ extract: /result
139
+ emit: message
140
140
  post: desktop
141
- schedules:
142
- mail: { every: 600, when: { sources: [mail] } }
141
+ on:
142
+ - { every: 600, event: { kind: record, source: mail } }
143
143
  ```
144
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).
145
+ Event rules and `gate:` scripts skip quiet intervals without starting a model, `extract:` unwraps harness JSON, and `post:` delivers answers through your [channel](https://fmind.github.io/brain-framework/docs/channels/) (while `emit: action` writes validated `draft` `ACTION.md` notes). 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
146
 
147
147
  ## Good to know
148
148
 
149
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
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)).
151
+ 1. **Git-native collaboration.** Version notes, ontology, programs and evals in Git while keeping local memories and `.bf/` caches out of shared history; major releases batch breaking changes cleanly ([versioning](https://fmind.github.io/brain-framework/docs/upgrades/#versioning-and-stability)).
152
152
 
153
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)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "brain-framework"
3
- version = "22.0.0"
3
+ version = "24.0.0"
4
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"
@@ -78,7 +78,6 @@ src = [
78
78
  extend-exclude = ["*.md"]
79
79
 
80
80
  [tool.ruff.per-file-target-version]
81
- "src/bf/skills/*/scripts/*.py" = "py311"
82
81
  "examples/**/*.py" = "py311"
83
82
 
84
83
  [tool.ruff.format]
@@ -131,7 +130,11 @@ ignore = [
131
130
  ]
132
131
 
133
132
  [tool.ruff.lint.per-file-ignores]
134
- "examples/hooks/**" = ["BLE001"]
133
+ "examples/channels/**" = ["S603"]
134
+ "examples/hooks/**" = [
135
+ "BLE001",
136
+ "S607",
137
+ ]
135
138
  "examples/sensors/**" = [
136
139
  "S603",
137
140
  "S607",
@@ -162,6 +165,7 @@ patch = ["subprocess"]
162
165
 
163
166
  [tool.coverage.report]
164
167
  fail_under = 95
168
+ precision = 2
165
169
  show_missing = true
166
170
  skip_covered = true
167
171
  skip_empty = true
@@ -1,7 +1,7 @@
1
1
  # https://packaging.python.org/en/latest/specifications/pyproject-toml/
2
2
  [project]
3
3
  name = "brain-framework"
4
- version = "22.0.0"
4
+ version = "24.0.0"
5
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"
@@ -90,8 +90,8 @@ dev = [
90
90
  line-length = 120
91
91
  src = ["src", "tests"]
92
92
  extend-exclude = ["*.md"] # dprint owns Markdown, including its Python code blocks.
93
- # Skill scripts and copied examples run with the host's python3, not the package interpreter.
94
- per-file-target-version = { "src/bf/skills/*/scripts/*.py" = "py311", "examples/**/*.py" = "py311" }
93
+ # Copied examples run with the host's python3, not the package interpreter.
94
+ per-file-target-version = { "examples/**/*.py" = "py311" }
95
95
 
96
96
  [tool.ruff.format]
97
97
  docstring-code-format = true
@@ -143,8 +143,12 @@ ignore = [
143
143
  ]
144
144
 
145
145
  [tool.ruff.lint.per-file-ignores]
146
+ "examples/channels/**" = [
147
+ "S603", # Channel adapters invoke notifier CLIs with literal argv lists and no shell.
148
+ ]
146
149
  "examples/hooks/**" = [
147
150
  "BLE001", # Silent hooks must exit 0 with no output on any unexpected error.
151
+ "S607", # Hooks resolve `git` by bare name on PATH with literal arguments.
148
152
  ]
149
153
  "examples/sensors/**" = [
150
154
  "S603", # Adapters invoke provider CLIs with literal argv lists; no shell is involved.
@@ -181,6 +185,7 @@ patch = ["subprocess"]
181
185
 
182
186
  [tool.coverage.report]
183
187
  fail_under = 95
188
+ precision = 2
184
189
  show_missing = true
185
190
  skip_covered = true
186
191
  skip_empty = true
@@ -3,7 +3,7 @@
3
3
  import os
4
4
  import sys
5
5
 
6
- __version__ = "22.0.0"
6
+ __version__ = "24.0.0"
7
7
 
8
8
 
9
9
  def main() -> None: