Brain Framework
From scattered information to informed actions, using plain files you own forever.
AI coding agents lose context between sessions, while proprietary memory platforms lock your knowledge inside opaque databases. Brain Framework (bf) turns a plain Git folder of Markdown notes, schema-validated JSONL records, and shell or Python loops into a fast, offline knowledge brain for humans and AI coding agents.
- Plain files, zero lock-in: YAML for config, Markdown for humans, canonical JSONL for records. Inspect or query your data anytime with
git,rg,jq, or DuckDB. - Instant offline BM25 search: A strictly disposable SQLite FTS5 cache ranks authored notes ahead of raw memories, resolves aliases and backlinks, and never mutates disk on read-only commands.
- Least-privilege automation loops: Run deterministic collectors (
sensors/), maintenance jobs (routines/), coding agents (agents/), and stream daemons (when: daemon) with per-loop secret allowlists (env_from:) and headlessbf watch. - Lean, model-agnostic core: Three runtime dependencies (
jsonschema,markdown-it-py,pyyaml) on Python 3.12+, zero built-in LLMs, and zero global config.
Quick start
Requires Linux or macOS and uv (Python 3.12+). No model API key, database server, or cloud account is required:
uv tool install brain-framework
bf init ~/brain
cd ~/brain
bf check --format text
bf status --format text
bf query "welcome" --format text
Output on a fresh brain:
Check: brain [OK]
notes=1 memories=0 errors=0 warnings=0
Brain: brain [HEALTHY]
notes=1 memories=0 loops=0 events=1
Query (fts5): 1 result(s) for 'welcome'
concepts/welcome.md#welcome Welcome
If BF_BRAIN is already exported in your shell, unset it or pass --brain ~/brain.
Next, follow Getting started to ingest records and write linked decisions, or run the four-tool walkthrough with synthetic Workspace, Jira, GitHub, and Google Cloud fixtures.
How it works
A brain is one portable directory organized around a 3x3 layout (three note folders, three loop folders, three JSONL record streams):
my-brain/
├── bf.yaml # Config: notes, brains, search.exclude, concurrency pools, loops
├── concepts/ # Durable knowledge (<slug>.md or <slug>/index.md bundles)
├── projects/ # Ongoing initiatives and decisions
├── actions/ # Scoped requests, deliverables, and attachments
├── sensors/ # Deterministic collectors (stdout JSONL -> memories/)
├── routines/ # Maintenance scripts and continuous daemons (when: daemon)
├── agents/ # Coding-harness or LLM tasks
├── schemas/ # Optional domain JSON Schemas (core record schema always enforced)
├── evals/ # User-owned Python/pytest contract checks
├── memories/ # Canonical JSONL (_notes.jsonl + <source>.jsonl; gitignored)
├── logs/ # Private 0700 structured JSONL loop logs (gitignored)
└── .bf/ # Private 0700 runtime: disposable cache/index.sqlite3, state/, locks/
- Authoring: Write CommonMark Markdown with YAML frontmatter,
#idheading anchors, checklist tasks, typed links ({rel=cites}), universal refs (source:id,bf://), and optionalschemas/<source>.jsonvalidation. - Retrieval: Search ranked BM25 hits and
--links-tobacklinks withbf query, resolve notes,#anchorsections, or aliases withbf read, track freshness withbf review, and runrg,jq, or DuckDB directly onmemories/*.jsonl. - Operations: Declare explicit
loops:with namedconcurrency:pools, per-loopenv_from:secrets, trailing-edgedebounce:, delayedbf emit --in|--atwakeups, livebf pause/bf resume, and headlessbf watchsupervision. - Reference: Full CLI contract (strict read-only vs write commands), exit codes,
BF_*env vars,{{...}}placeholders,bf.yamlconfig, and published Draft 2020-12 JSON Schemas (bf schema).
Works with your AI coding harness
bf pairs with Claude Code, Codex, Antigravity, Gemini CLI, OpenCode, or any terminal agent without an MCP server:
- Inside a brain: Agents read the repo's
AGENTS.md, orient withbf statusandbf review, edit Markdown notes directly, and verify withbf build && bf checkplusevals/. - From any repository: Set
export BF_BRAIN=~/brainand install the optional/bfskill (npx skills add fmind/brain-framework --skill bf) so your harness queries and updates your brain on demand. - Always-on supervision: Run
bf watchheadlessly undersystemd --userorlaunchdand monitor live in any terminal withwatch -n 2 bf status --format text.
Design principles
- Strict read/write boundary:
bf status,bf review,bf read,bf query,bf events,bf check, andbf schemanever touch disk. Cache readers open.bf/cache/index.sqlite3in strict read-only mode (mode=ro) with automatic JSONL fallback. - Private and confined by default: Every path opens via
O_NOFOLLOWdirectory descriptors,.bf/andlogs/enforce0700/0600owner-only permissions, secrets stay scoped to each loop'senv_from:, and logs redact credentials automatically. - Git-native collaboration: Track notes, config, schemas, loops, and evals in Git while keeping generated
memories/, privatelogs/,.env, and.bf/local.
Documentation · Examples · Issues · Contributing · Governance · Security · Third-party notices
Metadata
Release files for brain-framework 34.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| brain_framework-34.0.2.tar.gz | 140.7 kB | With provenance | Details for brain_framework-34.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brain_framework-34.0.2-py3-none-any.whl | Python 3 | none | any | Details for brain_framework-34.0.2-py3-none-any.whl |
Total release size: 291.2 kB
Release files / brain_framework-34.0.2.tar.gz
| Download URL | brain_framework-34.0.2.tar.gz |
|---|---|
| Size | 140.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00dcf52d075c70e6549d8d11a6e136ecadec7a0f67ab8ef0e3a07df11bb1108e
|
|
BLAKE2b-256 checksum How to use checksums |
baf26d20355d2df4dbfca8a01b5bbfd5befd6066219dc32e5a8ecb2db8f7abed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / brain_framework-34.0.2-py3-none-any.whl
| Download URL | brain_framework-34.0.2-py3-none-any.whl |
|---|---|
| Size | 150.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ac2481f3a44257fe3d0649002fac07251a37cfeaa66384e0b50b448dad3d02e
|
|
BLAKE2b-256 checksum How to use checksums |
cc4cebb3bbffc55d835dac2780328e1d33f30306fbf83832fbde9e815eb38342
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logSecurity for brain-framework 34.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for brain_framework-34.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.