# brainlayer [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/EtanHey/brainlayer  
**GitHub Stars:** 10  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/brainlayer

## Description
Persistent memory MCP for AI agents — SQLite, knowledge graph, 13-tool Python MCP + 17-tool BrainBar surface with ToolAnnotations

## Tools
Capabilities this server exposes over MCP:

- **brain_search** — Semantic + keyword hybrid search across all memories. Lifecycle-aware, MMR-deduped.
- **brain_store** — Persist decisions, corrections, bug causes, learnings. Auto-importance scoring.
- **brain_recall** — Session-level context — current work, recent sessions, one session's detail, or stats.
- **brain_expand** — Open one search result in full, with the chunks around it.
- **brain_entity** — Look up a person, project, company, or tool in the knowledge graph and its relations.
- **brain_get_person** — One person's profile, relations, and linked memories in a single call.
- **brain_tags** — List tags in use with counts; filter by substring.
- **brain_digest** — Digest a large raw block (transcript, doc, article) into a searchable chunk and connect its entities into the KG.
- **brain_update** — Change an existing chunk's importance or tags. Does not edit content.
- **brain_subscribe** — Subscribe an agent to live notifications for given tags.
- **brain_unsubscribe** — Remove some or all of an agent's tag subscriptions.
- **brain_ack** — Acknowledge that an agent processed messages up to a chunk rowid.
- **brain_backup_vacuum_into** — Write a SQLite backup snapshot (`VACUUM INTO`) to a target path.
- **brain_maintenance_rebuild_trigram** — Operator-triggered rebuild of the trigram FTS table in lock-aware batches.
- **brain_supersede** — Replace an old memory with a newer one and hide the old. Safety gate on personal data.
- **brain_archive** — Hide a chunk from default search, recoverably.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "brainlayer": {
    "command": "uvx",
    "args": ["brainlayer"]
  }
}
```

## Documentation

## What brainlayer MCP server does

brainlayer provides persistent memory for MCP-compatible AI agents. It stores decisions, corrections, bug causes, preferences, and other learnings in a local SQLite database, allowing later sessions and other agents to retrieve that context. The storage layer also includes a knowledge graph for entities and relationships involving people, projects, companies, and tools.

The system is designed for both individual continuity and shared organizational memory.

## How it works

Memory indexing, retrieval, and graph operations run on-device. SQLite uses WAL mode and sqlite-vec in a single database file. Search combines vector similarity from `bge-large-en-v1.5` embeddings with FTS5 keyword search, merging results with Reciprocal Rank Fusion. Search results are lifecycle-aware and MMR-deduplicated.

The agent-facing MCP transport is provided by BrainBar through `/tmp/brainbar.sock`. A bundled stdio bridge connects MCP clients to that socket and reconnects if BrainBar restarts. A watcher can index JSONL conversations with approximately one-second latency and persistent offsets.

## Setup and configuration

Install the Python package with:

```bash
pip install brainlayer
```

MCP usage requires the Homebrew BrainLayer bridge and a running BrainBar process that owns `/tmp/brainbar.sock`. Configure an MCP client to run the bridge executable, for example:

```json
{
  "mcpServers": {
    "brainlayer": {
      "command": "/opt/homebrew/opt/brainlayer/bin/brainlayer-mcp-stdio-bridge"
    }
  }
}
```

The Intel Homebrew path uses `/usr/local/opt/brainlayer` instead. Claude Code, Cursor, Zed, and VS Code configurations are shown by the project. `brainlayer setup --migrate-mcp` can back up and upgrade owned legacy MCP configurations. Set `BRAINLAYER_MCP_PROFILE=full` to expose the complete tool palette immediately; otherwise sessions begin with five core tools and can call `expand_palette`.

## Tools and capabilities

The core MCP palette contains:

- `brain_search` for semantic and keyword memory search.
- `brain_store` for saving decisions, corrections, bug causes, and learnings with automatic importance scoring.
- `brain_recall` for current work, recent sessions, individual session details, or statistics.
- `brain_expand` for opening a result with surrounding chunks.

Additional tools support entity and person lookups, tag inspection, document digestion, metadata updates, live tag subscriptions, message acknowledgements, SQLite snapshots, trigram index maintenance, memory superseding, and recoverable archiving. `brain_store` reports explicit outcomes such as `STORED`, `DUPLICATE`, `MERGED`, or `DEFERRED`, so agents can distinguish successful writes from rejected or failed requests.

## Limitations and notes

BrainLayer uses a local Unix socket and requires BrainBar to be running for the MCP bridge to connect. The documented bridge is preferred over raw `socat` wiring because it reconnects after BrainBar restarts. The destructive `brain_supersede` and `brain_archive` tools alter memory visibility, while `brain_update` changes importance or tags but not stored content. Optional Axiom telemetry and Drive backups are network integrations; core memory storage and retrieval remain local.

_Full upstream README: https://allmcps.com/mcp/brainlayer/readme_

