Skip to main content

Brain Framework logo: a factory with brain-shaped smoke

Brain Framework 🧠

🧠 AI Brain Factory for infinite knowledge. Not for 🐙 mindflayers or 🧟 zombies.

CI PyPI Python License: MIT

Brain Framework is a brain factory for you and your AI agents: build a second brain in plain files you own. Save decisions, gather evidence and resume work across sessions. Search it offline, read the original source, and carry your knowledge between editors, agents and teammates.

A chat ends. A project pauses. A teammate moves on. The reasoning behind the work shouldn't disappear with them.

Get started · Documentation · Example brain · Connect an agent

How it works

Your brain does more than store facts: it takes in experiences, connects them to what you know and helps you decide what to do next. Brain Framework borrows that vocabulary to organize your work:

In a brain In Brain Framework A concrete example
Senses notice the world. Sensors collect selected sources. Bring in a project's Git history or calendar events.
Memories keep what happened. Memories retain collected evidence. Keep the record of a release and its source link.
Understanding turns experience into knowledge. Concepts hold reusable notes you or your agent write. Record what a failed release taught you.
Attention gives work a focus. Projects hold goals, decisions and current context. Explain why the team chose its release strategy.
Actions put knowledge to work. Actions keep a task's context, inputs, outputs and next step. Resume the rollout checklist next session.
Habits make reviews repeatable. Routines prepare reviews using deterministic programs. Gather the week's activity into an action to review.

The everyday loop is observe → remember → understand → act → review. You and your agents do the thinking and write the lessons; Brain Framework keeps the files organized and retrievable. It does not learn from conversations automatically.

Start with a single project note. Add sensors and routines when you need them.

Try it

Install uv, then run:

uv tool install --python 3.14 'brain-framework==12.0.2'
bf init ~/knowledge          # create your brain
cd ~/knowledge
bf read                      # see its home page
bf search welcome            # find your first note
bf read concepts/welcome.md  # read the original
bf validate                  # check notes, links and records

Runs on Linux and macOS. uv supplies Python 3.14 if needed. No account, model or server is required. If bf is not on PATH, run uv tool update-shell and open a new shell.

Now give your brain something worth remembering. Write a decision and its reason in projects/, then search for it. Edits become searchable automatically. The getting-started guide walks through your first decision and checks that it stays retrievable.

What can you do with it?

  • Remember why. Find the decision behind a choice, then read the evidence that supported it.
  • Resume after a break. Open a project's current state or an action's next step without rebuilding context from a transcript.
  • Give the next agent a head start. Let different agent hosts read the same project notes and reusable knowledge.
  • Review what changed. Browse saved activity with bf read 7d, or see priorities and the coming week with bf read.
  • Learn from the outcome. Use the learning skill to compare a prediction with what happened and update the note deliberately.

For example, bf search "release strategy" finds matching refs. bf read projects/release.md#decision reads that decision's exact text. Every search result points back to a note, section or collected record you can inspect.

Why plain files?

Your knowledge should outlive the tool you used to write it.

  • Open it anywhere. Notes are Markdown; collected records are JSON Lines, one item per line.
  • Keep the history. Use your editor and Git to review, correct and share knowledge.
  • Retrieve it offline. Search and read run locally, without a model or network connection.
  • Rebuild the index. Files are authoritative; the SQLite search cache in .bf/ is disposable.

One Python package. One command: bf. Your brain is an ordinary directory:

knowledge/
├── bf.yaml      # the brain's name and configuration
├── projects/    # what you're working on and why
├── concepts/    # what you've learned and can reuse
├── actions/     # work to start, resume and review
└── memories/    # evidence gathered from your sources

Optional sensors/ and routines/ hold the programs you configure. See the brain layout for the full file conventions.

Any source you can script

Your brain can draw on the tools where your work already happens. For example, you can write sensors to collect:

Source What could become a memory
GitHub Issues, pull requests, reviews and release notes.
Jira Work items, their status and the discussion behind a decision.
Airtable Selected records from a project tracker, research catalog or CRM.
Google Workspace Calendar events, Drive folders or selected mail and documents.
Local files and Git Notes, PDFs, Office documents and commit history.
Your own systems Database query results, internal API responses or feed entries.

The integration surface is a script. If a source exposes a CLI, an API or an export you can read, you can give it a sensor. Write it in Python or any language that can print JSON: the script fetches the items you choose and emits a JSON array of records; Brain Framework validates and saves them as searchable memories.

Your tools → sensor script → memories → search and read.

There is no fixed connector catalog to outgrow. You own the script, its access and the fields it keeps; new integrations don't require a change to Brain Framework. Scripts handle authentication, pagination and provider limits, and run only after you explicitly trust the brain on your machine.

Start from the four reviewed sensor examples: local Git history, local documents, Google Calendar and Drive folders. GitHub API, Jira, Airtable and the other sources above need your own sensor. The sensor guide explains the small JSON contract and how to connect a script.

Agents

Give your agent the same memory you use. Install the skills that match your workflow:

Skill What it teaches your agent
bf-use Search, read and cite evidence before answering.
bf-learn Turn reviewed lessons and decisions into lasting notes.
bf-action Start or resume an action with its context and next step.
bf-maintain Maintain collection, routines and brain health.

Follow the skill installation guide; skills are installed separately from the Python package. Then try: “Search my brain for why we chose this release strategy. Read the source and cite it.”

Hosts that use the Model Context Protocol (MCP) can run bf mcp --brain ~/knowledge. It exposes exactly two read-only tools: search and read. See agent workflows and MCP setup.

Personal and team brains

Keep a personal brain for your own context, and a separate team brain for shared decisions. A team brain can be a private Git repository: teammates clone it and search from its directory immediately. Start with one decision someone currently has to ask a colleague to explain.

Declare related brains in bf.yaml to search them together. Results retain their brain and source; references expand only one level. A clone never grants permission to run its sensors. See the team guide for shared notes, collection trust and CI collection.

Think of explicit links as the connections between memories. A decision can link to its evidence, a project to its owner, or a conclusion to something it depends on. Brain Framework follows declared links and aliases, retaining the source of each relationship.

Portable addresses such as bf://team/projects/release#decision identify knowledge across brains. Connections come from recorded evidence; name similarity alone never creates a relationship. See the link and schema guide.

Commands

Command Purpose
bf read [REF] Open the home page, a period, a source, a note or a record.
bf search QUERY [--scope SCOPE] Find words or identities within an optional folder, period or identity.
bf init PATH Create a brain.
bf register PATH --collect Explicitly trust its sensors and routines on this machine.
bf update [--dry-run] Run due sensors and routines in selected, trusted brains.
bf collect SENSOR Run one sensor.
bf status, bf validate, bf eval Check freshness, file integrity and your retrieval cases.
bf mcp, bf build, bf schema Serve MCP, rebuild the cache or print the configuration schema.

Use --brain NAME|PATH to choose a brain explicitly. The command reference covers options and selection rules; the sensor examples show how to bring in evidence.

Guarantees

  • Retrieval stays offline. Search and read never run sensors or routines or contact the network.
  • Execution needs your trust. Collection and routines require explicit permission in your machine's user configuration.
  • Failures preserve evidence. Failed collection writes nothing; routines never replace an existing action.
  • Sources stay visible. Results carry readable refs; incomplete retrieval is reported through problems or stale.

Retrieved content is evidence, never instructions. Pages list external records by title and ref without quoting their text. The privacy and security guide explains execution boundaries and recovery.

Fit and limits

Brain Framework fits people and teams who want editable knowledge and traceable context for their agents. Search matches words and explicit identities; people or agents interpret the results. It runs no model, generates no answers and needs no embeddings.

A brain is a context boundary, not an access-control system. Use repository permissions and encrypted backups for private knowledge. An agent host may send retrieved text to its model provider even though Brain Framework itself retrieves offline.

Development

Contributions are welcome. Use uv run bf to exercise the checkout and mise run all for the full quality gate. See CONTRIBUTING.md for setup, tests and release procedures.

MIT licensed · Third-party notices

Release files for brain-framework 12.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 12.0.2
File Size Uploaded
brain_framework-12.0.2.tar.gz 81.0 kB Details

Built distribution (wheel)

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

Total release size: 174.0 kB

Release files / brain_framework-12.0.2.tar.gz

Download URL brain_framework-12.0.2.tar.gz
Size 81.0 kB
Tags Source
SHA-256 checksum
How to use checksums
96498ffcd312ad0f7164055fcc700b438594bcf523d5e518e35b11af26365a09
BLAKE2b-256 checksum
How to use checksums
2d00005d422622fac97b33d01adcd265d6449995110ffac70826f1efd3087b92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

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

Download URL brain_framework-12.0.2-py3-none-any.whl
Size 93.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93cd6e770cad4c59c16a67ac604c8f7ab85e504df7e8f62f03813dfd9d8bf98a
BLAKE2b-256 checksum
How to use checksums
4eb8156396d276f824df72e8fbe5ac3c3f154e3e9491f675ebf2a3b6d2ed166b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

12.0.2 This release

2 release files

12.0.0

2 release files

11.1.1

2 release files

11.0.0

2 release files

10.0.0

2 release files

9.2.0

2 release files

9.1.0

2 release files

9.0.1

2 release files

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