Skip to main content

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

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

  • Three formats, one job each. YAML for config (bf.yaml version: 16, evals/*.yaml version: 1, note frontmatter), JSON for records (memories/**/*.json, validated by package-owned core schemas and optional user schemas/*.json by convention, plus plain JSON lines in logs/*.log), and Markdown for humans (projects/, concepts/, and actions/ parsed with Python-Markdown attr_list metadata, plus plain Markdown inputs under prompts/).
  • Agents always query JSON — with minimal tokens. bf build compiles Markdown notes, headings, keyed attr_list metadata (anchors), links, and open tasks into memories/{concepts,projects,actions}/*.json and updates per-source .bf/cache/index/ shards without scanning sensor corpora. bf read (--outline, --lines, --fields, --max-bytes), bf query (rg + --jq, --format jsonl|tsv), bf review, and bf status keep outputs bounded and fast.
  • Unified strange-loop orchestration (loops:). Around 6,000 lines of Python with lazy imports, delegating retrieval to rg and jq, cross-references to relative Markdown paths, source:id, and bf:// URLs, and every sensor, routine, git hook, continuous listener (on: daemon), and autonomous thinking bot to one loops: primitive in bf.yaml — with bounded concurrent execution under bf watch and zero custom databases, built-in LLMs, or provider SDKs.

CI PyPI Python License: MIT

Try it

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

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

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
  • Notes, attr_list, & unified links (Authoring): Separate volatile TODOs (projects/), durable knowledge (concepts/), and dated workspaces (actions/*/ACTION.md), scaffold with bf new, attach metadata on headings (## MCP {#mcp creator=Anthropic}) and blocks ({: #summary confidence=high}), and cross-reference notes, records (source:id), or sibling brains (bf://).
  • Unified loops:, schemas, & concurrent bf watch (Operations): Ship user-owned JSON Schemas in schemas/, copy stdlib sensors from examples/sensors, and orchestrate multi-schedule, event-triggered, git-hook, emit: <kind>, and on: daemon loops under bf.yaml (loops:, watch.concurrency) with a live Rich TUI.
  • Standard JSON retrieval & MCP (Retrieval): Resolve bf:// URLs, #anchor sections, --outline, or --lines with bf read, search and filter memories/**/*.json via bf query (rg, jq, or rg + --jq), verify in one shot with bf check, or expose strictly read-only tools via bf mcp.
  • Integrity, freshness, & schemas (Reference): bf check compiles notes, validates every schema, compiled-note sync, link, #anchor, and cross-brain bf:// reference with digest caching, and runs deterministic evals (--validate or --eval [TARGET]); bf review surfaces newer_evidence, overdue stale_after notes, and open draft actions; bf schema prints bundled Draft 2020-12 JSON Schemas.

Good to know

  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/ and logs/ (Operations).
  2. Harnesses reason; BF verifies. Coding agents load the single /bf Agent Skill from .agents/skills/bf, track work via bf new action <slug>, emit loop events via bf emit, and run bf check (Example brain).
  3. Git-native collaboration. Track notes, actions/*/ACTION.md, bf.yaml, evals/, and schemas/ in Git while ignoring compiled note JSON files, logs/, actions/*/{inputs,outputs}/, and .bf/.

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

Metadata

Release files for brain-framework 31.0.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 31.0.0
File Size Uploaded Provenance Actions
brain_framework-31.0.0.tar.gz 127.5 kB With provenance Details for brain_framework-31.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 266.9 kB

Release files / brain_framework-31.0.0.tar.gz

Download URL brain_framework-31.0.0.tar.gz
Size 127.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f0115ee6cdd7e4cfcaffb5efba51b79c3c9ce10a8f12e128d84f12ca1b8f3358
BLAKE2b-256 checksum
How to use checksums
ad15435dae904fcfbb0934c84d38dab776743494fcfcac128abd5dbf2f6daea4
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 21, 2026.

Transparency log

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

Download URL brain_framework-31.0.0-py3-none-any.whl
Size 139.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f11fbb0681aff80b06789669203dd1ccd58ff2c01e11d710d7c49d90b9905e87
BLAKE2b-256 checksum
How to use checksums
46a1e36eb88ebb8a17e0e2b22ddba64f2a6def56fe7d5a0aa6b4e976ef75887c
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 21, 2026.

Transparency log

Security for brain-framework 31.0.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-31.0.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 21, 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

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