Skip to main content

Brain Framework: Plain-file knowledge and offline retrieval for humans and AI agents

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.

  • 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).
  • 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.
  • 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.

CI PyPI Python License: MIT

Try it

Requires Linux or macOS, uv, ripgrep (rg), and jq, with no model or cloud account needed:

uv tool install --python 3.14 brain-framework
bf init ~/brain
cd ~/brain
bf check
bf status --format text
bf review
bf query --jq '{ref, title, headings}'

Explore the four-tool walkthrough (Workspace, Jira, GitHub, and Google Cloud fixtures) or read Getting started.

How it works

Gather, normalize, organize, act, and learn loop
  • Uniform notes, index.md bundles, & required schemas (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://).
  • Convention loops: (sensors/, routines/, agents/), two-stream JSONL, & bf watch (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 (interactive zero-dep ANSI dashboard on TTY, --format text, or --format jsonl).
  • Strictly read-only retrieval & FinOps separation (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.
  • Integrity, freshness, & schemas (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).

Good to know

  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).
  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).
  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/.

Documentation · Reference · Issues · Contribute · Governance · Security · MIT License · Third-party notices

Metadata

Release files for brain-framework 33.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brain-framework 33.2.0
File Size Uploaded Provenance Actions
brain_framework-33.2.0.tar.gz 117.1 kB With provenance Details for brain_framework-33.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brain-framework 33.2.0
File Interpreter ABI Platform Actions
brain_framework-33.2.0-py3-none-any.whl Python 3 none any Details for brain_framework-33.2.0-py3-none-any.whl

Total release size: 245.9 kB

Release files / brain_framework-33.2.0.tar.gz

Download URL brain_framework-33.2.0.tar.gz
Size 117.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a3f8b1dc3c9722823430f68f99c3cb54508999db5009177b781fb384299b31e8
BLAKE2b-256 checksum
How to use checksums
e7f7396b86ebbf7981dfa68481916871cb361084d77f8f5e166411fa7c12e4bb
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 23, 2026.

Transparency log

Release files / brain_framework-33.2.0-py3-none-any.whl

Download URL brain_framework-33.2.0-py3-none-any.whl
Size 128.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48256e33c72d798c4ebb52b4887741075d26d4cb96ba273c52f632c35aba249e
BLAKE2b-256 checksum
How to use checksums
2ace318f7e1a4d2928131c120044cc8b43a66d5cd2ade7d72914ea484fe93087
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 23, 2026.

Transparency log

Security for brain-framework 33.2.0

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.

Select from 2 files

Attestation for brain_framework-33.2.0.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 23, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

33.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page