Skip to main content

Brain Framework logo

Brain Framework

From information to informed actions.

CI PyPI Python License: MIT

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 watch and per-loop secret allowlists.

Brain Framework terminal demo: ranked search, backlinks, staleness review, and live bf watch supervision

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

Perceive, normalize, connect, act, and learn loop connecting your tools, your brain folder, and your routines and agents

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 daemon listeners, event-driven agents, and 24/7 bf watch supervision.
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 with bf build and bf check.
  • From any repository: Export BF_BRAIN to point to your brain folder and install the optional /bf skill with npx 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 with bf run github-issues.
  • Supervise around the clock: Run bf watch interactively for a live terminal dashboard, or under systemd or launchd for 24/7 structured JSONL logging.
  • Control live loops: Mute flaky jobs with bf pause and attach a read-only live view from another terminal with bf 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.2

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 35.0.2
File Size Uploaded Provenance Actions
brain_framework-35.0.2.tar.gz 162.0 kB With provenance Details for brain_framework-35.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 349.2 kB

Release files / brain_framework-35.0.2.tar.gz

Download URL brain_framework-35.0.2.tar.gz
Size 162.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0a8f1e34f7dde858308fc7486d6d096807f7347553e912b45970882b756126df
BLAKE2b-256 checksum
How to use checksums
24119b2597b460fc6ae05d1039aadd6737d59162716c13643a064f4c667b948a
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 log

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

Download URL brain_framework-35.0.2-py3-none-any.whl
Size 187.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92eed7eed61c77c95708d38ada27c9b304e2d983f52af5a7efab5b01128dddab
BLAKE2b-256 checksum
How to use checksums
6e9843fe1d4b8e8bb29d359a7059330911d0f72197b689e395b557d2c1addc1f
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 log

Security for brain-framework 35.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.

Select from 2 files

Attestation for brain_framework-35.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 30, 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

35.0.2 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