Brain Framework
From information to informed actions.
Brain Framework turns a regular Git folder into a living second brain that you own forever. Combine plain Markdown memory that humans and coding agents can search offline with continuous loops that keep sensors, listeners, and always-on agents running around the clock.
- Plain files, zero lock-in: Markdown, YAML, and JSONL with three dependencies, versioned in Git, and zero built-in LLMs.
- Shared memory, backed by evidence: Edit Markdown in any editor, query offline from any coding agent, and flag stale decisions when linked facts change.
- Continuous loops for always-on agents: Supervise scheduled sensors, live channel daemons, and event-driven agents together with
bf watchand per-loop secret allowlists.
Quickstart
Requires Linux or macOS and uv (Python 3.12+). No model API key, database server, or cloud account is required.
Install the CLI and initialize a brain folder:
uv tool install brain-framework
bf init ~/brain
cd ~/brain
Ingest a source record, write a decision note that cites it, and build the local search index:
bf ingest workspace <<'EOF'
{
"id": "brief",
"title": "Website brief",
"type": "doc",
"text": "Start with one clear product page before signup.",
"created": "2026-11-10T09:00:00Z",
"updated": "2026-11-10T09:00:00Z"
}
EOF
cat > projects/launch.md <<'EOF'
---
type: project
status: active
created: 2026-11-12
updated: 2026-11-15
description: Launch one focused product page.
---
# Launch site
## Decision {#decision}
Ship one product page first ([brief](workspace:brief){rel=cites}).
EOF
bf build
Search offline to see your decision rank ahead of the raw brief. Then update the brief and let bf review catch the stale decision automatically:
bf query "product page" --format text
bf ingest workspace <<'EOF'
{
"id": "brief",
"title": "Website brief",
"type": "doc",
"text": "Add a pricing table before signup.",
"created": "2026-11-10T09:00:00Z",
"updated": "2026-11-20T14:00:00Z"
}
EOF
bf review --format text
Output:
Query (fts5): 2 result(s) for 'product page'
projects/launch.md#decision Launch site
Launch site Decision Ship one product page first (brief).
workspace:brief Website brief
Start with one clear product page before signup.
Review: brain [STALE (1)]
stale=1 open_tasks=0
REF REASONS DETAIL
projects/launch.md newer_evidence newer: workspace:brief
Next, follow Getting started, wire continuous loops in Loops, or explore the offline example brain.
How it works
A brain is one portable directory where perception, memory, and action feed each other:
- Perceive: Small sensors collect records from your tools into flat JSONL files, while always-on daemons listen to live channels such as chat or webhooks.
- Remember: Humans and agents curate Markdown notes linked to raw evidence. A read-only, disposable offline search index finds answers in milliseconds and flags notes when linked facts change.
- Act and learn: Routines, event-driven agents, and interactive coding harnesses read that context, act through your existing CLIs or APIs, and write outcomes back to the brain.
Memory and continuous loops sit on the same level inside one bf.yaml and 3x3 layout, and either side works on its own:
- Memory: Plain Markdown notes with instant offline search, section reads, staleness checks, and agent recall.
- Loops: Scheduled tool feeds, live
daemonlisteners, event-driven agents, and 24/7bf watchsupervision.
my-brain/
├── bf.yaml # Declarative config for notes, search, and loops
├── concepts/ # Durable knowledge, standards, and conventions
├── projects/ # Ongoing initiatives and decisions
├── actions/ # Scoped requests, deliverables, and attachments
├── sensors/ # Scheduled scripts collecting records from your tools
├── routines/ # Maintenance jobs and always-on stream daemons
└── agents/ # Scheduled and event-driven coding-harness tasks
See the full layout and runtime folders (memories/, logs/, .bf/) in the reference.
Works with your AI coding harness
Brain Framework works with Claude Code, Codex, GitHub Copilot, Antigravity, Gemini CLI, OpenCode, and any terminal agent without running an MCP server.
- Inside a brain: Agents read the folder's
AGENTS.md, check health and stale notes, edit Markdown directly, and verify changes withbf buildandbf check. - From any repository: Export
BF_BRAINto point to your brain folder and install the optional/bfskill withnpx skills add fmind/brain-framework --skill bf.
A typical read-only lookup from another repository:
bf status --format text # Orient: health, counts, and attention items
bf query "product page" --kind note # Search curated notes first
bf read "projects/launch.md#decision" # Load one cited section without extra noise
bf query --links-to "workspace:brief" # Follow backlinks to every citing note
bf review --format text # Spot stale decisions and open tasks
Run continuous loops and always-on agents
Declare plain shell or Python scripts in bf.yaml to keep your brain updated and run always-on agents without an external orchestrator. bf watch supervises scheduled sensors, passive channel daemons, delayed timers, and event-driven agents together, forwarding only the secrets each loop allowlists:
version: 20
name: my-brain
concurrency:
default: 4
interactive: 2
loops:
github-issues:
description: Pull GitHub issues every 30 minutes.
run: [python3, sensors/github-issues.py, owner/repo]
env_from: [GH_TOKEN]
ingest: upsert
when: 30m
chat:
description: Stream incoming messages from a live channel.
run: [python3, routines/chat.py, listen]
emit: loop.message
mode: daemon
triage:
description: Run hourly checks and reply immediately to live messages.
run: [python3, agents/triage.py]
pool: interactive
timeout: 15m
env_from: [ANTHROPIC_API_KEY]
when:
- every: 1h
- event:
kind: loop.message
source: chat
Passive mode: daemon listeners stay running cheaply in plain code, while agents wake on a schedule or matching event, run your preferred coding harness, and write outcomes back to the brain.
- Preview or run once: Inspect resolved commands and secrets with
bf run triage --dry-run, or run a single cycle withbf run github-issues. - Supervise around the clock: Run
bf watchinteractively for a live terminal dashboard, or undersystemdorlaunchdfor 24/7 structured JSONL logging. - Control live loops: Mute flaky jobs with
bf pauseand attach a read-only live view from another terminal withbf status --watch.
See Loops for sensor contracts, event predicates, and concurrency pools, Operations for 24/7 supervision, and Security for secret allowlists and limits.
How it compares
| Approach | Storage and ownership | Search and agent interface | Automation and trust |
|---|---|---|---|
| Brain Framework | Plain Git Markdown + flat JSONL | Read-only CLI, ranked offline search, rg/jq/DuckDB |
Continuous bf watch loops with per-loop secret allowlists |
| Plain Markdown / Obsidian | Local Markdown files | Filename or grep search; no staleness checks | Manual upkeep or UI plugins; no structured feeds |
| Hosted / MCP memory | Opaque or remote database | Always-on MCP schemas and model-mediated recall | Extra services and API keys; hard to audit in Git |
| Generic vector RAG | Chunked embeddings in a vector index | Similarity over opaque chunks | Needs embedding pipelines; weak provenance and backlinks |
| Monolithic agent platforms | App-owned database or plugin state | Bundled LLM runtime and platform-specific SDKs | Broad host or token permissions; hard to swap harnesses or edit |
When not to use
- You want turnkey SaaS connectors, built-in LLM synthesis, or an MCP server instead of running your own CLI scripts and coding harness.
- You need semantic vector search, multimodal blob storage, or multi-user concurrent web editing across millions of records.
- You run primarily on native Windows without WSL (Brain Framework targets Linux and macOS POSIX confinement).
More
Documentation | CLI reference | Example brain | Issues | Security | License (MIT)
Metadata
Release files for brain-framework 35.0.1
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-35.0.1.tar.gz | 161.5 kB | With provenance | Details for brain_framework-35.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brain_framework-35.0.1-py3-none-any.whl | Python 3 | none | any | Details for brain_framework-35.0.1-py3-none-any.whl |
Total release size: 348.2 kB
Release files / brain_framework-35.0.1.tar.gz
| Download URL | brain_framework-35.0.1.tar.gz |
|---|---|
| Size | 161.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8af4e60482ab4bf0b1c55da7ea4f9684e10de10d74af2dcc2240fa76cc1270a
|
|
BLAKE2b-256 checksum How to use checksums |
fbd3e80ea5e71c2f5c5f45b3238390e019072521e7e2f35b9ab25a76e074d111
|
| 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 30, 2026.
Transparency logRelease files / brain_framework-35.0.1-py3-none-any.whl
| Download URL | brain_framework-35.0.1-py3-none-any.whl |
|---|---|
| Size | 186.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7eced158486251c12b1bfbd484d5e8451445ad6346ee5d23b6fce306a0db4cba
|
|
BLAKE2b-256 checksum How to use checksums |
84b6079e2ef989ddc6e0430ed2127088d45d23eb835511343062a127f9be191a
|
| 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 30, 2026.
Transparency logSecurity for brain-framework 35.0.1
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-35.0.1.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 30, 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.