brain-framework 26.0.0__tar.gz → 27.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 (39) hide show
  1. {brain_framework-26.0.0 → brain_framework-27.0.0}/PKG-INFO +13 -12
  2. {brain_framework-26.0.0 → brain_framework-27.0.0}/README.md +8 -8
  3. {brain_framework-26.0.0 → brain_framework-27.0.0}/THIRD_PARTY_NOTICES.md +550 -20
  4. {brain_framework-26.0.0 → brain_framework-27.0.0}/pyproject.toml +4 -4
  5. {brain_framework-26.0.0 → brain_framework-27.0.0}/pyproject.toml.orig +4 -4
  6. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/__init__.py +1 -1
  7. brain_framework-27.0.0/src/bf/cli.py +202 -0
  8. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/config.py +75 -78
  9. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/engine.py +123 -137
  10. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/guides/authoring.md +3 -4
  11. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/guides/getting-started.md +6 -8
  12. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/guides/index.md +6 -6
  13. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/guides/operations.md +16 -19
  14. brain_framework-27.0.0/src/bf/guides/reference.md +60 -0
  15. brain_framework-27.0.0/src/bf/guides/retrieval.md +51 -0
  16. brain_framework-27.0.0/src/bf/jobs.py +523 -0
  17. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/markdown.py +40 -54
  18. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/mcp.py +63 -27
  19. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/models.py +35 -17
  20. brain_framework-27.0.0/src/bf/query.py +459 -0
  21. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/records.py +54 -49
  22. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/schemas.py +50 -72
  23. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/skills/bf/SKILL.md +11 -11
  24. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/starter/AGENTS.md +4 -4
  25. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/starter/docs/index.md +3 -4
  26. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/starter/evals/smoke.yaml +1 -1
  27. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/storage.py +103 -42
  28. brain_framework-27.0.0/src/bf/watch.py +522 -0
  29. brain_framework-26.0.0/src/bf/cli.py +0 -255
  30. brain_framework-26.0.0/src/bf/guides/reference.md +0 -64
  31. brain_framework-26.0.0/src/bf/guides/retrieval.md +0 -62
  32. brain_framework-26.0.0/src/bf/jobs.py +0 -606
  33. brain_framework-26.0.0/src/bf/query.py +0 -411
  34. brain_framework-26.0.0/src/bf/watch.py +0 -258
  35. {brain_framework-26.0.0 → brain_framework-27.0.0}/LICENSE +0 -0
  36. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/__main__.py +0 -0
  37. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/py.typed +0 -0
  38. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/starter/concepts/welcome.md +0 -0
  39. {brain_framework-26.0.0 → brain_framework-27.0.0}/src/bf/starter/gitignore +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brain-framework
3
- Version: 26.0.0
4
- Summary: Brain Framework is a local-first brain for you and your AI agents. It compiles OKF Markdown notes into JSON records, validates notes, records, logs, and evals against JSON Schemas, orchestrates jobs and MCP servers, and queries offline with rg, jq, and DuckDB.
5
- Keywords: ai,ai-agents,agent-memory,agent-skills,agents-md,context-engineering,duckdb,json,json-schema,knowledge-graph,knowledge-management,local-first,mcp,model-context-protocol,personal-knowledge-management,python,second-brain
3
+ Version: 27.0.0
4
+ Summary: Brain Framework is a local-first brain for you and your AI agents. It compiles OKF Markdown notes into JSON records, validates notes, records, and evals against JSON Schemas, orchestrates jobs, channels, and services, and queries offline with rg and jq.
5
+ Keywords: ai,ai-agents,agent-memory,agent-skills,agents-md,context-engineering,json,json-schema,knowledge-graph,knowledge-management,local-first,mcp,model-context-protocol,personal-knowledge-management,python,second-brain
6
6
  Author: Médéric Hurier
7
7
  License-Expression: MIT
8
8
  License-File: LICENSE
@@ -17,12 +17,13 @@ Classifier: Programming Language :: Python :: 3.14
17
17
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
18
  Classifier: Topic :: Text Processing :: Indexing
19
19
  Classifier: Typing :: Typed
20
- Requires-Dist: durationpy>=0.11,<1
20
+ Requires-Dist: croniter>=6.0.0,<8
21
21
  Requires-Dist: jsonschema>=4.26.0,<5
22
22
  Requires-Dist: markdown>=3.11,<4
23
23
  Requires-Dist: mcp>=2.1.1,<3
24
24
  Requires-Dist: pyyaml>=6.0.3,<7
25
25
  Requires-Dist: rich>=15.0.0,<16
26
+ Requires-Dist: structlog>=25.0.0,<27
26
27
  Requires-Dist: watchfiles>=1.1.0,<2
27
28
  Requires-Python: >=3.14
28
29
  Project-URL: Changelog, https://fmind.github.io/brain-framework/changelog/
@@ -40,17 +41,17 @@ Description-Content-Type: text/markdown
40
41
  />
41
42
  </p>
42
43
 
43
- Brain Framework (`bf`) turns a flat folder of human-authored Markdown notes and collected JSON records into a schema-validated, pure-JSON knowledge store (`memories/**/*.json`) that humans and AI agents query offline with `rg`, `jq`, and `duckdb` (`bf query`, `bf read`, or `bf mcp`).
44
+ Brain Framework (`bf`) turns a flat folder of human-authored Markdown notes and collected JSON records into a schema-validated, pure-JSON knowledge store (`memories/**/*.json`) that humans and AI agents query offline with `rg` and `jq` (`bf query`, `bf read`, or `bf mcp`).
44
45
 
45
- - **Three formats, one job each.** **YAML for config** (`bf.yaml`, `evals/*.yaml`, note frontmatter), **JSON for records** (`memories/**/*.json` and `logs/*.json`, enforced by `schemas/*.json`), and **Markdown for humans** (`projects/`, `concepts/`, and `actions/` parsed with [Python-Markdown](https://python-markdown.github.io/) `attr_list` metadata, plus plain Markdown inputs under `prompts/`).
46
+ - **Three formats, one job each.** **YAML for config** (`bf.yaml`, `evals/*.yaml`, note frontmatter), **JSON for records** (`memories/**/*.json`, enforced by `schemas/*.json`, plus `structlog` JSON lines in `logs/*.log`), and **Markdown for humans** (`projects/`, `concepts/`, and `actions/` parsed with [Python-Markdown](https://python-markdown.github.io/) `attr_list` metadata, plus plain Markdown inputs under `prompts/`).
46
47
  - **Agents always query JSON.** `bf build` compiles Markdown notes, headings, keyed `attr_list` metadata (`attrs`), links, and open tasks into `memories/{concepts,projects,actions}/*.json`; `bf ingest` writes validated sensor records into `memories/<source>/*.json`.
47
- - **Minimal, standard-driven core.** Under 4,500 lines of Python delegating retrieval to `rg`, `jq`, and sandboxed `duckdb`, cross-references to relative Markdown paths and standard `bf://` URLs, and orchestration (`defaults`, `jobs`, `channels`, `servers`, `watch`, `mcp`) to `bf.yaml` — with zero custom databases, built-in LLMs, or provider SDKs.
48
+ - **Minimal, standard-driven core.** Under 4,500 lines of Python delegating retrieval to `rg` and `jq`, cross-references to relative Markdown paths and standard `bf://` URLs, and orchestration (`timezone`, `env`, `jobs`, `channels`, `services`, `watch`) to `bf.yaml` — with zero custom databases, built-in LLMs, or provider SDKs.
48
49
 
49
50
  [![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)
50
51
 
51
52
  ## Try it
52
53
 
53
- Requires Linux or macOS and [uv](https://docs.astral.sh/uv/getting-started/installation/) — no model or cloud account needed:
54
+ Requires Linux or macOS, [uv](https://docs.astral.sh/uv/getting-started/installation/), [ripgrep](https://github.com/BurntSushi/ripgrep) (`rg`), and [jq](https://jqlang.org/) — no model or cloud account needed:
54
55
 
55
56
  ```bash
56
57
  uv tool install --python 3.14 brain-framework
@@ -75,13 +76,13 @@ Explore the [four-tool walkthrough](https://github.com/fmind/brain-framework/blo
75
76
  </a>
76
77
 
77
78
  - **Notes, `attr_list`, & `bf://` URLs ([Authoring](https://fmind.github.io/brain-framework/authoring/)):** Separate volatile TODOs (`projects/`), durable knowledge (`concepts/`), and dated workspaces (`actions/*/ACTION.md`). Attach metadata on headings (`## MCP {#mcp creator=Anthropic}`) and blocks (`{: #summary confidence=high}`), and cross-reference notes or sibling brains with `bf://` URLs.
78
- - **User schemas, jobs, & live watch ([Operations](https://fmind.github.io/brain-framework/operations/)):** Ship user-owned JSON Schemas in `schemas/`, copy stdlib sensors from [examples/sensors](https://github.com/fmind/brain-framework/tree/main/examples/sensors), and orchestrate schedules, JSON event triggers, channels, daemons, and Rich TUI monitoring via `bf.yaml` (`defaults`, `jobs`, `channels`, `servers`, `watch`).
79
- - **Standard JSON retrieval & MCP ([Retrieval](https://fmind.github.io/brain-framework/retrieval/)):** Resolve `bf://` anchors and `#<jq_filter>` fragments with `bf read`, search and join `memories/**/*.json` via `bf query` (`rg`, `jq`, `duckdb`), run deterministic `bf eval` checks, or expose read-only tools via `bf mcp`.
80
- - **Integrity & freshness ([Reference](https://fmind.github.io/brain-framework/reference/)):** `bf validate` checks every schema, link, `#anchor`, and cross-brain `bf://` reference; `bf review` surfaces `newer_evidence`, overdue `stale_after` notes, and open `draft` actions.
79
+ - **User schemas, jobs, & live watch ([Operations](https://fmind.github.io/brain-framework/operations/)):** Ship user-owned JSON Schemas in `schemas/`, copy stdlib sensors from [examples/sensors](https://github.com/fmind/brain-framework/tree/main/examples/sensors), and orchestrate cron/duration schedules, `structlog` JSON logs, event triggers, channels, services, and Rich TUI monitoring via `bf.yaml` (`jobs`, `channels`, `services`, `watch`).
80
+ - **Standard JSON retrieval & MCP ([Retrieval](https://fmind.github.io/brain-framework/retrieval/)):** Resolve `bf://` URLs and `#anchor` sections with `bf read`, search and filter `memories/**/*.json` via `bf query` (`rg`, `jq`), run deterministic `bf eval` checks, or expose read-only tools via `bf mcp`.
81
+ - **Integrity & freshness ([Reference](https://fmind.github.io/brain-framework/reference/)):** `bf validate` checks every schema, compiled-note sync, link, `#anchor`, and cross-brain `bf://` reference; `bf review` surfaces `newer_evidence`, overdue `stale_after` notes, and open `draft` actions.
81
82
 
82
83
  ## Good to know
83
84
 
84
- 1. **Local-first and private.** Zero global config (`--brain` -> `BF_BRAIN` -> enclosing `bf.yaml` -> `DEFAULT_BRAIN_PATH`), `O_NOFOLLOW` path confinement, private `0700` `.bf/` locks/state, and locked read-only DuckDB queries ([Operations](https://fmind.github.io/brain-framework/operations/)).
85
+ 1. **Local-first and private.** Zero global config (`--brain` -> `BF_BRAIN` -> enclosing `bf.yaml` -> `DEFAULT_BRAIN_PATH`), `O_NOFOLLOW` path confinement, and private `0700` `.bf/` locks/state ([Operations](https://fmind.github.io/brain-framework/operations/)).
85
86
  2. **Harnesses reason; BF verifies.** Coding agents load the single `/bf` [Agent Skill](https://agentskills.io/specification) from `.agents/skills/bf`, automatically track actions inside a brain (or respond to explicit `/bf` outside), and run `bf build && bf validate && bf eval` ([Example brain](https://github.com/fmind/brain-framework/blob/main/examples/brain/README.md)).
86
87
  3. **Git-native collaboration.** Track notes, `bf.yaml`, `evals/`, and `schemas/` in Git while ignoring compiled note JSON files, `logs/`, `actions/`, and `.bf/`.
87
88
 
@@ -6,17 +6,17 @@
6
6
  />
7
7
  </p>
8
8
 
9
- Brain Framework (`bf`) turns a flat folder of human-authored Markdown notes and collected JSON records into a schema-validated, pure-JSON knowledge store (`memories/**/*.json`) that humans and AI agents query offline with `rg`, `jq`, and `duckdb` (`bf query`, `bf read`, or `bf mcp`).
9
+ Brain Framework (`bf`) turns a flat folder of human-authored Markdown notes and collected JSON records into a schema-validated, pure-JSON knowledge store (`memories/**/*.json`) that humans and AI agents query offline with `rg` and `jq` (`bf query`, `bf read`, or `bf mcp`).
10
10
 
11
- - **Three formats, one job each.** **YAML for config** (`bf.yaml`, `evals/*.yaml`, note frontmatter), **JSON for records** (`memories/**/*.json` and `logs/*.json`, enforced by `schemas/*.json`), and **Markdown for humans** (`projects/`, `concepts/`, and `actions/` parsed with [Python-Markdown](https://python-markdown.github.io/) `attr_list` metadata, plus plain Markdown inputs under `prompts/`).
11
+ - **Three formats, one job each.** **YAML for config** (`bf.yaml`, `evals/*.yaml`, note frontmatter), **JSON for records** (`memories/**/*.json`, enforced by `schemas/*.json`, plus `structlog` JSON lines in `logs/*.log`), and **Markdown for humans** (`projects/`, `concepts/`, and `actions/` parsed with [Python-Markdown](https://python-markdown.github.io/) `attr_list` metadata, plus plain Markdown inputs under `prompts/`).
12
12
  - **Agents always query JSON.** `bf build` compiles Markdown notes, headings, keyed `attr_list` metadata (`attrs`), links, and open tasks into `memories/{concepts,projects,actions}/*.json`; `bf ingest` writes validated sensor records into `memories/<source>/*.json`.
13
- - **Minimal, standard-driven core.** Under 4,500 lines of Python delegating retrieval to `rg`, `jq`, and sandboxed `duckdb`, cross-references to relative Markdown paths and standard `bf://` URLs, and orchestration (`defaults`, `jobs`, `channels`, `servers`, `watch`, `mcp`) to `bf.yaml` — with zero custom databases, built-in LLMs, or provider SDKs.
13
+ - **Minimal, standard-driven core.** Under 4,500 lines of Python delegating retrieval to `rg` and `jq`, cross-references to relative Markdown paths and standard `bf://` URLs, and orchestration (`timezone`, `env`, `jobs`, `channels`, `services`, `watch`) to `bf.yaml` — with zero custom databases, built-in LLMs, or provider SDKs.
14
14
 
15
15
  [![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)
16
16
 
17
17
  ## Try it
18
18
 
19
- Requires Linux or macOS and [uv](https://docs.astral.sh/uv/getting-started/installation/) — no model or cloud account needed:
19
+ Requires Linux or macOS, [uv](https://docs.astral.sh/uv/getting-started/installation/), [ripgrep](https://github.com/BurntSushi/ripgrep) (`rg`), and [jq](https://jqlang.org/) — no model or cloud account needed:
20
20
 
21
21
  ```bash
22
22
  uv tool install --python 3.14 brain-framework
@@ -41,13 +41,13 @@ Explore the [four-tool walkthrough](https://github.com/fmind/brain-framework/blo
41
41
  </a>
42
42
 
43
43
  - **Notes, `attr_list`, & `bf://` URLs ([Authoring](https://fmind.github.io/brain-framework/authoring/)):** Separate volatile TODOs (`projects/`), durable knowledge (`concepts/`), and dated workspaces (`actions/*/ACTION.md`). Attach metadata on headings (`## MCP {#mcp creator=Anthropic}`) and blocks (`{: #summary confidence=high}`), and cross-reference notes or sibling brains with `bf://` URLs.
44
- - **User schemas, jobs, & live watch ([Operations](https://fmind.github.io/brain-framework/operations/)):** Ship user-owned JSON Schemas in `schemas/`, copy stdlib sensors from [examples/sensors](https://github.com/fmind/brain-framework/tree/main/examples/sensors), and orchestrate schedules, JSON event triggers, channels, daemons, and Rich TUI monitoring via `bf.yaml` (`defaults`, `jobs`, `channels`, `servers`, `watch`).
45
- - **Standard JSON retrieval & MCP ([Retrieval](https://fmind.github.io/brain-framework/retrieval/)):** Resolve `bf://` anchors and `#<jq_filter>` fragments with `bf read`, search and join `memories/**/*.json` via `bf query` (`rg`, `jq`, `duckdb`), run deterministic `bf eval` checks, or expose read-only tools via `bf mcp`.
46
- - **Integrity & freshness ([Reference](https://fmind.github.io/brain-framework/reference/)):** `bf validate` checks every schema, link, `#anchor`, and cross-brain `bf://` reference; `bf review` surfaces `newer_evidence`, overdue `stale_after` notes, and open `draft` actions.
44
+ - **User schemas, jobs, & live watch ([Operations](https://fmind.github.io/brain-framework/operations/)):** Ship user-owned JSON Schemas in `schemas/`, copy stdlib sensors from [examples/sensors](https://github.com/fmind/brain-framework/tree/main/examples/sensors), and orchestrate cron/duration schedules, `structlog` JSON logs, event triggers, channels, services, and Rich TUI monitoring via `bf.yaml` (`jobs`, `channels`, `services`, `watch`).
45
+ - **Standard JSON retrieval & MCP ([Retrieval](https://fmind.github.io/brain-framework/retrieval/)):** Resolve `bf://` URLs and `#anchor` sections with `bf read`, search and filter `memories/**/*.json` via `bf query` (`rg`, `jq`), run deterministic `bf eval` checks, or expose read-only tools via `bf mcp`.
46
+ - **Integrity & freshness ([Reference](https://fmind.github.io/brain-framework/reference/)):** `bf validate` checks every schema, compiled-note sync, link, `#anchor`, and cross-brain `bf://` reference; `bf review` surfaces `newer_evidence`, overdue `stale_after` notes, and open `draft` actions.
47
47
 
48
48
  ## Good to know
49
49
 
50
- 1. **Local-first and private.** Zero global config (`--brain` -> `BF_BRAIN` -> enclosing `bf.yaml` -> `DEFAULT_BRAIN_PATH`), `O_NOFOLLOW` path confinement, private `0700` `.bf/` locks/state, and locked read-only DuckDB queries ([Operations](https://fmind.github.io/brain-framework/operations/)).
50
+ 1. **Local-first and private.** Zero global config (`--brain` -> `BF_BRAIN` -> enclosing `bf.yaml` -> `DEFAULT_BRAIN_PATH`), `O_NOFOLLOW` path confinement, and private `0700` `.bf/` locks/state ([Operations](https://fmind.github.io/brain-framework/operations/)).
51
51
  2. **Harnesses reason; BF verifies.** Coding agents load the single `/bf` [Agent Skill](https://agentskills.io/specification) from `.agents/skills/bf`, automatically track actions inside a brain (or respond to explicit `/bf` outside), and run `bf build && bf validate && bf eval` ([Example brain](https://github.com/fmind/brain-framework/blob/main/examples/brain/README.md)).
52
52
  3. **Git-native collaboration.** Track notes, `bf.yaml`, `evals/`, and `schemas/` in Git while ignoring compiled note JSON files, `logs/`, `actions/`, and `.bf/`.
53
53