Local-first persistent-memory MCP server. Per-project brain with hybrid vector + FTS5 search, recall, remember, forget, and supersede over a single SQLite file.
Project description
BrainCell
Created by Karl Toussaint (kt2saint).
BrainCell is local-first project memory for MCP clients. Each Project has one database and a stable project ULID. Connecting BrainCell to Project A never starts it for, or exposes it to, Project B.
The public vocabulary is defined in NAMINGS.md. In particular, BrainCell uses Project, Build, Connect, Pool, and Decouple from Pool. Earlier terms are compatibility or migration language only. See CHANGELOG.md for verified public release notes.
Current status
This release establishes project-local connections and skills, live named Pools, native Memory Map Pool controls, and preview-first recovery for retired shared data. Legacy automation and shared-data behavior are not part of the project-only workflow.
What is isolated
- Project memory is stored and queried per Project.
- Codex uses only
<project>/.codex/config.toml; Codex must trust the project before it loads that configuration. - VS Code uses only
<project>/.vscode/mcp.json. - Claude connection is project-bounded: private local-project scope is the
default, and shareable
.mcp.jsonscope is an explicit choice. - A package installation can live anywhere on the machine. It does not select a Project or enable BrainCell in another Project.
Connection management preserves unrelated client configuration. It writes only BrainCell's entry, refuses a conflicting user-managed entry, creates a backup, and replaces the configuration atomically. Existing legacy client-wide entries are detected for explicit cleanup; BrainCell never silently removes them.
Install
After PyPI publication, use pipx for a production install:
pipx install braincell-mcp
ollama pull qwen3-embedding:4b
The default embedder is local Ollama qwen3-embedding:4b. For hosted
embeddings, install the optional OpenAI extra instead and configure its
documented provider environment:
pipx install "braincell-mcp[openai]"
For source/developer installation from a checkout:
git clone https://github.com/kt2saint-sec/braincell.git
cd braincell
./scripts/install.sh
Before publication, install directly from source:
python3 -m pip install "braincell-mcp @ git+https://github.com/kt2saint-sec/braincell.git"
Installing the package never selects a Project, creates a database, or changes a
client configuration. After any install, connect one selected Project with the
dry-run/apply flow below. The commands are braincell, braincell-mcp, and
braincell-map.
Connect one Project
Choose the Project deliberately. BrainCell resolves symlinks, refuses /, and
requires acknowledgements for a home directory, a non-Git Project, or a
privileged/root invocation.
cd /path/to/project
braincell setup . --dry-run --client codex
braincell setup . --client codex --yes
The first command resolves the path and displays every planned database,
registry, client-configuration, skills, and optional Pool-recall write without
applying it. --yes applies the plan. Use --with-skills for project-local
skills and --automatic-pool-recall "Pool name" only for an existing named Pool
with Claude. You can still run Build and Connect individually:
braincell build .
braincell connect . --client claude --scope local
braincell install remains a compatibility alias for braincell connect;
uninstall remains an alias for disconnect. Disconnecting removes only
BrainCell's managed entry for that client and Project. It does not delete
Project memory.
For Codex, open the selected trusted Project after connecting. A Codex session outside that Project has no BrainCell project configuration to load.
Skills are a separate, explicit choice:
braincell skills add . --client claude # writes .claude/skills
braincell skills add . --client codex # writes .agents/skills
braincell skills remove . --client claude
BrainCell never installs these skills machine-wide. Add and Remove preserve an edited same-name skill and report it as a conflict.
Use Project memory
braincell recall "how did we handle rate limiting?"
braincell search "throttle"
braincell start .
braincell start, braincell gui, and braincell-map open the native
Memory Map for the selected Project. The embedded localhost server is an
implementation detail of that desktop app, not a browser product or an
always-on service.
Build reads supported documents and transcripts into that Project's database.
braincell sync is the incremental compatibility alias for Build. Remember,
Forget, and Correct memory are MCP actions; normal Recall and Search are always
limited to the connected Project.
Pools: intentional, live cross-Project reads
A Pool is a named set of stable Project ULIDs. It stores memberships only: it never contains copied notes, documents, chunks, or vectors. Pool Search and Recall resolve members through the registry at query time and open their databases read-only. Missing, inaccessible, corrupt, or incompatible members are reported and skipped without failing the whole query.
# Obtain a Project ULID when building/registering the Project.
braincell pool create "release work"
braincell pool add "release work" <project-a-ulid> <project-b-ulid>
braincell pool search "release work" "deployment rollback"
braincell pool recall "release work" "which rollout guardrail applies?"
braincell pool decouple "release work" <project-b-ulid>
Decouple from Pool removes only that membership. It never changes either Project's memory, client connection, Project registration, or membership in another Pool. Re-adding a member restores its live results without a Build. Pool names compare after Unicode NFKC normalization, whitespace normalization, and case-folding; the original spelling remains visible.
Optional Automatic Pool recall
Automatic Pool recall is Disabled by default. Enable it only for a selected Project and Pool:
braincell automatic-pool-recall enable . --pool "release work"
braincell automatic-pool-recall status .
braincell automatic-pool-recall disable .
Claude private-local scope writes only .claude/settings.local.json. Add
--scope project only when you intentionally want shareable
.claude/settings.json. The hook command stores the stable Project ULID and
Pool name, not an absolute Project path. It no-ops outside that connected
Project, and ordinary Recall remains Project-only.
Safety model
- There is no ordinary query that reads every Project.
- There is no shared operational memory database.
- Writes remain pinned to the Connected Project.
- Pool reads are explicit; an ordinary Recall or Search never silently widens scope.
- A legacy shared installation or database is a recovery/migration concern, not a normal runtime mode. Do not delete it until the dedicated migration workflow has previewed, backed up, and verified the recovery.
Development
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev,openai]"
python -m pytest
ruff check braincell tests
The Memory Map is a PySide6/QtWebEngine application. Test its native window and bridge for desktop changes; a standalone-browser test is supplemental only. See CONTRIBUTING.md for contribution requirements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file braincell_mcp-0.4.0.tar.gz.
File metadata
- Download URL: braincell_mcp-0.4.0.tar.gz
- Upload date:
- Size: 294.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b6d243cf9bc569f777ec19fe394cffff251680aca01c70657b624846e096c1b
|
|
| MD5 |
3b69702b6a8eeada2a407b83d1bd405c
|
|
| BLAKE2b-256 |
c59f6a5a015e85c9313ab9bd604bf87ac573d0c9719488dd85897dc0d78d0487
|
Provenance
The following attestation bundles were made for braincell_mcp-0.4.0.tar.gz:
Publisher:
publish.yml on kt2saint-sec/braincell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
braincell_mcp-0.4.0.tar.gz -
Subject digest:
9b6d243cf9bc569f777ec19fe394cffff251680aca01c70657b624846e096c1b - Sigstore transparency entry: 2257420275
- Sigstore integration time:
-
Permalink:
kt2saint-sec/braincell@e92aaf0f96aeb752ea98032411a0c87132ad6c13 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/kt2saint-sec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e92aaf0f96aeb752ea98032411a0c87132ad6c13 -
Trigger Event:
push
-
Statement type:
File details
Details for the file braincell_mcp-0.4.0-py3-none-any.whl.
File metadata
- Download URL: braincell_mcp-0.4.0-py3-none-any.whl
- Upload date:
- Size: 309.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f333e5ceacd89ce4cc31deeef65d220f3864c93878e415f03a13f8dcbc5b684
|
|
| MD5 |
eda63e51b57276512a45aa2e15708abf
|
|
| BLAKE2b-256 |
5b760f62bb7f12de9f2bacc0a0f1af56474e27d25f6654f058e14669ab142262
|
Provenance
The following attestation bundles were made for braincell_mcp-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on kt2saint-sec/braincell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
braincell_mcp-0.4.0-py3-none-any.whl -
Subject digest:
4f333e5ceacd89ce4cc31deeef65d220f3864c93878e415f03a13f8dcbc5b684 - Sigstore transparency entry: 2257420281
- Sigstore integration time:
-
Permalink:
kt2saint-sec/braincell@e92aaf0f96aeb752ea98032411a0c87132ad6c13 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/kt2saint-sec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e92aaf0f96aeb752ea98032411a0c87132ad6c13 -
Trigger Event:
push
-
Statement type: