brain-framework 31.0.0__tar.gz → 33.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-33.0.0/PKG-INFO +86 -0
- brain_framework-33.0.0/README.md +54 -0
- brain_framework-33.0.0/THIRD_PARTY_NOTICES.md +970 -0
- {brain_framework-31.0.0 → brain_framework-33.0.0}/pyproject.toml +30 -7
- {brain_framework-31.0.0 → brain_framework-33.0.0}/pyproject.toml.orig +25 -7
- {brain_framework-31.0.0 → brain_framework-33.0.0}/src/bf/__init__.py +8 -2
- brain_framework-33.0.0/src/bf/cli.py +399 -0
- brain_framework-33.0.0/src/bf/config.py +555 -0
- brain_framework-33.0.0/src/bf/engine.py +632 -0
- brain_framework-33.0.0/src/bf/guides/authoring.md +57 -0
- brain_framework-33.0.0/src/bf/guides/getting-started.md +89 -0
- brain_framework-33.0.0/src/bf/guides/index.md +19 -0
- brain_framework-33.0.0/src/bf/guides/operations.md +74 -0
- brain_framework-33.0.0/src/bf/guides/reference.md +70 -0
- brain_framework-33.0.0/src/bf/guides/retrieval.md +69 -0
- brain_framework-33.0.0/src/bf/loops.py +631 -0
- brain_framework-33.0.0/src/bf/markdown.py +649 -0
- {brain_framework-31.0.0 → brain_framework-33.0.0}/src/bf/models.py +40 -22
- {brain_framework-31.0.0 → brain_framework-33.0.0}/src/bf/proc.py +172 -32
- brain_framework-33.0.0/src/bf/query.py +553 -0
- brain_framework-33.0.0/src/bf/records.py +598 -0
- brain_framework-33.0.0/src/bf/schemas.py +419 -0
- brain_framework-33.0.0/src/bf/skills/bf/SKILL.md +47 -0
- brain_framework-33.0.0/src/bf/starter/AGENTS.md +17 -0
- brain_framework-33.0.0/src/bf/starter/concepts/welcome.md +16 -0
- brain_framework-33.0.0/src/bf/starter/evals/smoke.py +33 -0
- brain_framework-33.0.0/src/bf/starter/gitignore +8 -0
- brain_framework-33.0.0/src/bf/status.py +263 -0
- {brain_framework-31.0.0 → brain_framework-33.0.0}/src/bf/storage.py +80 -153
- brain_framework-33.0.0/src/bf/watch.py +577 -0
- brain_framework-31.0.0/PKG-INFO +0 -87
- brain_framework-31.0.0/README.md +0 -53
- brain_framework-31.0.0/THIRD_PARTY_NOTICES.md +0 -2457
- brain_framework-31.0.0/src/bf/cli.py +0 -392
- brain_framework-31.0.0/src/bf/config.py +0 -459
- brain_framework-31.0.0/src/bf/engine.py +0 -693
- brain_framework-31.0.0/src/bf/guides/authoring.md +0 -62
- brain_framework-31.0.0/src/bf/guides/getting-started.md +0 -81
- brain_framework-31.0.0/src/bf/guides/index.md +0 -19
- brain_framework-31.0.0/src/bf/guides/operations.md +0 -86
- brain_framework-31.0.0/src/bf/guides/reference.md +0 -62
- brain_framework-31.0.0/src/bf/guides/retrieval.md +0 -55
- brain_framework-31.0.0/src/bf/index.py +0 -384
- brain_framework-31.0.0/src/bf/loops.py +0 -669
- brain_framework-31.0.0/src/bf/markdown.py +0 -663
- brain_framework-31.0.0/src/bf/mcp.py +0 -188
- brain_framework-31.0.0/src/bf/query.py +0 -591
- brain_framework-31.0.0/src/bf/records.py +0 -351
- brain_framework-31.0.0/src/bf/schemas.py +0 -363
- brain_framework-31.0.0/src/bf/skills/bf/SKILL.md +0 -56
- brain_framework-31.0.0/src/bf/starter/AGENTS.md +0 -17
- brain_framework-31.0.0/src/bf/starter/concepts/welcome.md +0 -15
- brain_framework-31.0.0/src/bf/starter/evals/smoke.yaml +0 -12
- brain_framework-31.0.0/src/bf/starter/gitignore +0 -10
- brain_framework-31.0.0/src/bf/watch.py +0 -618
- {brain_framework-31.0.0 → brain_framework-33.0.0}/LICENSE +0 -0
- {brain_framework-31.0.0 → brain_framework-33.0.0}/src/bf/__main__.py +0 -0
- {brain_framework-31.0.0 → brain_framework-33.0.0}/src/bf/py.typed +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: brain-framework
|
|
3
|
+
Version: 33.0.0
|
|
4
|
+
Summary: Brain Framework is a local-first brain for you and your AI agents. It compiles OKF Markdown notes into JSONL records, enforces required per-source JSON Schemas, orchestrates convention loops, and queries offline with rg, jq, and DuckDB.
|
|
5
|
+
Keywords: ai,ai-agents,agent-memory,agent-skills,agents-md,context-engineering,json,json-schema,knowledge-graph,knowledge-management,local-first,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: croniter>=6.0.0,<8
|
|
21
|
+
Requires-Dist: jsonschema>=4.26.0,<5
|
|
22
|
+
Requires-Dist: markdown>=3.11,<4
|
|
23
|
+
Requires-Dist: pyyaml>=6.0.3,<7
|
|
24
|
+
Requires-Dist: watchfiles>=1.1.0,<2
|
|
25
|
+
Requires-Python: >=3.14
|
|
26
|
+
Project-URL: Changelog, https://fmind.github.io/brain-framework/changelog/
|
|
27
|
+
Project-URL: Documentation, https://fmind.github.io/brain-framework/
|
|
28
|
+
Project-URL: Issues, https://github.com/fmind/brain-framework/issues
|
|
29
|
+
Project-URL: Repository, https://github.com/fmind/brain-framework
|
|
30
|
+
Project-URL: Security, https://github.com/fmind/brain-framework/security/policy
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
<p align="center">
|
|
34
|
+
<img
|
|
35
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-framework.svg"
|
|
36
|
+
alt="Brain Framework: Plain-file knowledge and offline retrieval for humans and AI agents"
|
|
37
|
+
width="100%"
|
|
38
|
+
/>
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
Brain Framework (`bf`) turns a 3x3 folder of human-authored Markdown notes, shell/Python loops, and JSONL records (`memories/<source>.jsonl`, `usages/<source>.jsonl`, `logs/<loop>.jsonl`) into a schema-validated, UNIX-native knowledge brain with zero database or external indexer, ready for humans and AI coding harnesses to query offline with `rg`, `jq`, and DuckDB.
|
|
42
|
+
|
|
43
|
+
- **Three formats, one job each.** **YAML for config** (`bf.yaml` `version: 18` + note frontmatter), **Markdown for humans** (`concepts/`, `projects/`, `actions/` with flat `<slug>.md` and universal `<slug>/index.md` bundles), and **JSONL for records** (`memories/`, `usages/`, and private `logs/`, validated by bundled `bf`/`record` schemas plus `schemas/<source>.json` and `schemas/usages.json`).
|
|
44
|
+
- **Strict read/write boundary & UNIX composability.** `bf status`, `bf review`, `bf read`, `bf query`, `bf check`, and `bf schema` are strictly read-only and never mutate disk; flat JSONL files stay directly inspectable with `rg`, `jq`, and DuckDB.
|
|
45
|
+
- **Convention-first `loops:` with zero built-in LLMs.** Under 6,500 lines of Python with just 5 minimal runtime dependencies (`croniter`, `jsonschema`, `markdown`, `pyyaml`, `watchfiles`), unifying deterministic collectors (`sensors/`), routines (`routines/`), coding-harness agents (`agents/`), and daemons (`when: daemon`) via `BF_*` env + `stdin` JSON, `stdout` JSONL data/events, `stderr` structured JSONL logs, and `logs/events.jsonl`.
|
|
46
|
+
|
|
47
|
+
[](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)
|
|
48
|
+
|
|
49
|
+
## Try it
|
|
50
|
+
|
|
51
|
+
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/), with no model or cloud account needed:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uv tool install --python 3.14 brain-framework
|
|
55
|
+
bf init ~/brain
|
|
56
|
+
cd ~/brain
|
|
57
|
+
bf check
|
|
58
|
+
bf status --format text
|
|
59
|
+
bf review
|
|
60
|
+
bf query --jq '{ref, title, headings}'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Explore the [four-tool walkthrough](https://github.com/fmind/brain-framework/blob/main/examples/context-hub/README.md) (Workspace, Jira, GitHub, and Google Cloud fixtures) or read [Getting started](https://fmind.github.io/brain-framework/getting-started/).
|
|
64
|
+
|
|
65
|
+
## How it works
|
|
66
|
+
|
|
67
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
|
|
68
|
+
<img
|
|
69
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg"
|
|
70
|
+
alt="Gather, normalize, organize, act, and learn loop"
|
|
71
|
+
width="100%"
|
|
72
|
+
/>
|
|
73
|
+
</a>
|
|
74
|
+
|
|
75
|
+
- **Uniform notes, `index.md` bundles, & required schemas ([Authoring](https://fmind.github.io/brain-framework/authoring/)):** Organize Markdown across `concepts/`, `projects/`, `actions/` (or custom `notes:` dirs) using flat `<slug>.md` files or universal `<slug>/index.md` bundles, enforce bundled `record` + `schemas/<source>.json` / `schemas/usages.json`, attach `#id` heading anchors and `{rel=...}` link metadata, and link across notes, records (`source:id`), or declared sibling brains (`bf://`).
|
|
76
|
+
- **Convention `loops:` (`sensors/`, `routines/`, `agents/`), two-stream JSONL, & `bf watch` ([Operations](https://fmind.github.io/brain-framework/operations/)):** Drop shell (`.sh`), Python (`.py`), or executable scripts in `sensors/` (auto-implies `ingest: upsert`), `routines/`, or `agents/` (15m default timeout), stream structured JSONL logs on `stderr` into `logs/<loop>.jsonl`, coordinate over `logs/events.jsonl`, and supervise with `bf watch` (bird's-eye status + live text or `--format jsonl`).
|
|
77
|
+
- **Strictly read-only retrieval & FinOps separation ([Retrieval](https://fmind.github.io/brain-framework/retrieval/)):** Resolve notes, `#anchor` sections, `source:id` records, or `bf://` URIs uniformly with `bf read`, search `memories/*.jsonl` or `usages/*.jsonl` via `bf query` (`rg`/`jq`) or DuckDB, and inspect live health with `bf status --format text`.
|
|
78
|
+
- **Integrity, freshness, & schemas ([Reference](https://fmind.github.io/brain-framework/reference/)):** `bf check` validates `bf.yaml`, schemas, compiled-note sync, `memories/` & `usages/`, enabled `loops:`, links, `#anchor` headings, and declared cross-brain `bf://` refs; `bf review` surfaces `newer_evidence`, overdue `stale_after` notes, and open tasks; `bf schema` prints the 2 bundled Draft 2020-12 JSON Schemas (`bf`, `record`).
|
|
79
|
+
|
|
80
|
+
## Good to know
|
|
81
|
+
|
|
82
|
+
1. **Local-first and private.** Zero global config (`--brain` -> enclosing `bf.yaml` -> `BF_BRAIN` -> `$BRAIN_LOCATION` -> `~/brain`), `O_NOFOLLOW` path confinement, disposable `0700` `.bf/` (locks + loop cursors), and private `0700` `logs/` ([Operations](https://fmind.github.io/brain-framework/operations/)).
|
|
83
|
+
2. **Harnesses reason; BF verifies.** Coding agents orient with `bf status` and `bf review`, author Markdown notes directly, emit events via `bf emit`, and verify with `bf build && bf check` plus Python/pytest suites in `evals/` ([Example brain](https://github.com/fmind/brain-framework/blob/main/examples/brain/README.md)).
|
|
84
|
+
3. **Git-native collaboration.** Track notes, `bf.yaml`, `schemas/`, `sensors/`, `routines/`, `agents/`, `clients/`, `prompts/`, and `evals/` in Git while ignoring `memories/` and `usages/` (keeping `*.forgotten`), `logs/`, and `.bf/`.
|
|
85
|
+
|
|
86
|
+
[Documentation](https://fmind.github.io/brain-framework/) · [Reference](https://fmind.github.io/brain-framework/reference/) · [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) · [Security](https://github.com/fmind/brain-framework/blob/main/SECURITY.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,54 @@
|
|
|
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: Plain-file knowledge and offline retrieval for humans and AI agents"
|
|
5
|
+
width="100%"
|
|
6
|
+
/>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
Brain Framework (`bf`) turns a 3x3 folder of human-authored Markdown notes, shell/Python loops, and JSONL records (`memories/<source>.jsonl`, `usages/<source>.jsonl`, `logs/<loop>.jsonl`) into a schema-validated, UNIX-native knowledge brain with zero database or external indexer, ready for humans and AI coding harnesses to query offline with `rg`, `jq`, and DuckDB.
|
|
10
|
+
|
|
11
|
+
- **Three formats, one job each.** **YAML for config** (`bf.yaml` `version: 18` + note frontmatter), **Markdown for humans** (`concepts/`, `projects/`, `actions/` with flat `<slug>.md` and universal `<slug>/index.md` bundles), and **JSONL for records** (`memories/`, `usages/`, and private `logs/`, validated by bundled `bf`/`record` schemas plus `schemas/<source>.json` and `schemas/usages.json`).
|
|
12
|
+
- **Strict read/write boundary & UNIX composability.** `bf status`, `bf review`, `bf read`, `bf query`, `bf check`, and `bf schema` are strictly read-only and never mutate disk; flat JSONL files stay directly inspectable with `rg`, `jq`, and DuckDB.
|
|
13
|
+
- **Convention-first `loops:` with zero built-in LLMs.** Under 6,500 lines of Python with just 5 minimal runtime dependencies (`croniter`, `jsonschema`, `markdown`, `pyyaml`, `watchfiles`), unifying deterministic collectors (`sensors/`), routines (`routines/`), coding-harness agents (`agents/`), and daemons (`when: daemon`) via `BF_*` env + `stdin` JSON, `stdout` JSONL data/events, `stderr` structured JSONL logs, and `logs/events.jsonl`.
|
|
14
|
+
|
|
15
|
+
[](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)
|
|
16
|
+
|
|
17
|
+
## Try it
|
|
18
|
+
|
|
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/), with no model or cloud account needed:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uv tool install --python 3.14 brain-framework
|
|
23
|
+
bf init ~/brain
|
|
24
|
+
cd ~/brain
|
|
25
|
+
bf check
|
|
26
|
+
bf status --format text
|
|
27
|
+
bf review
|
|
28
|
+
bf query --jq '{ref, title, headings}'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Explore the [four-tool walkthrough](https://github.com/fmind/brain-framework/blob/main/examples/context-hub/README.md) (Workspace, Jira, GitHub, and Google Cloud fixtures) or read [Getting started](https://fmind.github.io/brain-framework/getting-started/).
|
|
32
|
+
|
|
33
|
+
## How it works
|
|
34
|
+
|
|
35
|
+
<a href="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg">
|
|
36
|
+
<img
|
|
37
|
+
src="https://raw.githubusercontent.com/fmind/brain-framework/main/docs/assets/brain-loop.svg"
|
|
38
|
+
alt="Gather, normalize, organize, act, and learn loop"
|
|
39
|
+
width="100%"
|
|
40
|
+
/>
|
|
41
|
+
</a>
|
|
42
|
+
|
|
43
|
+
- **Uniform notes, `index.md` bundles, & required schemas ([Authoring](https://fmind.github.io/brain-framework/authoring/)):** Organize Markdown across `concepts/`, `projects/`, `actions/` (or custom `notes:` dirs) using flat `<slug>.md` files or universal `<slug>/index.md` bundles, enforce bundled `record` + `schemas/<source>.json` / `schemas/usages.json`, attach `#id` heading anchors and `{rel=...}` link metadata, and link across notes, records (`source:id`), or declared sibling brains (`bf://`).
|
|
44
|
+
- **Convention `loops:` (`sensors/`, `routines/`, `agents/`), two-stream JSONL, & `bf watch` ([Operations](https://fmind.github.io/brain-framework/operations/)):** Drop shell (`.sh`), Python (`.py`), or executable scripts in `sensors/` (auto-implies `ingest: upsert`), `routines/`, or `agents/` (15m default timeout), stream structured JSONL logs on `stderr` into `logs/<loop>.jsonl`, coordinate over `logs/events.jsonl`, and supervise with `bf watch` (bird's-eye status + live text or `--format jsonl`).
|
|
45
|
+
- **Strictly read-only retrieval & FinOps separation ([Retrieval](https://fmind.github.io/brain-framework/retrieval/)):** Resolve notes, `#anchor` sections, `source:id` records, or `bf://` URIs uniformly with `bf read`, search `memories/*.jsonl` or `usages/*.jsonl` via `bf query` (`rg`/`jq`) or DuckDB, and inspect live health with `bf status --format text`.
|
|
46
|
+
- **Integrity, freshness, & schemas ([Reference](https://fmind.github.io/brain-framework/reference/)):** `bf check` validates `bf.yaml`, schemas, compiled-note sync, `memories/` & `usages/`, enabled `loops:`, links, `#anchor` headings, and declared cross-brain `bf://` refs; `bf review` surfaces `newer_evidence`, overdue `stale_after` notes, and open tasks; `bf schema` prints the 2 bundled Draft 2020-12 JSON Schemas (`bf`, `record`).
|
|
47
|
+
|
|
48
|
+
## Good to know
|
|
49
|
+
|
|
50
|
+
1. **Local-first and private.** Zero global config (`--brain` -> enclosing `bf.yaml` -> `BF_BRAIN` -> `$BRAIN_LOCATION` -> `~/brain`), `O_NOFOLLOW` path confinement, disposable `0700` `.bf/` (locks + loop cursors), and private `0700` `logs/` ([Operations](https://fmind.github.io/brain-framework/operations/)).
|
|
51
|
+
2. **Harnesses reason; BF verifies.** Coding agents orient with `bf status` and `bf review`, author Markdown notes directly, emit events via `bf emit`, and verify with `bf build && bf check` plus Python/pytest suites in `evals/` ([Example brain](https://github.com/fmind/brain-framework/blob/main/examples/brain/README.md)).
|
|
52
|
+
3. **Git-native collaboration.** Track notes, `bf.yaml`, `schemas/`, `sensors/`, `routines/`, `agents/`, `clients/`, `prompts/`, and `evals/` in Git while ignoring `memories/` and `usages/` (keeping `*.forgotten`), `logs/`, and `.bf/`.
|
|
53
|
+
|
|
54
|
+
[Documentation](https://fmind.github.io/brain-framework/) · [Reference](https://fmind.github.io/brain-framework/reference/) · [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) · [Security](https://github.com/fmind/brain-framework/blob/main/SECURITY.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)
|