Brainlayer logo

Brainlayer

Local persistent memory for MCP agents using SQLite, hybrid search, session recall, and a knowledge graph.

Install Brainlayer

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "brainlayer": {
      "command": "uvx",
      "args": [
        "brainlayer"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

brainlayer MCP server gives MCP-compatible agents persistent, shared memory backed by a local SQLite database and knowledge graph. Its tools store and retrieve decisions, debugging lessons, session context, documents, entities, and tagged notifications through BrainBar over a Unix socket. Hybrid vector and keyword search combines sqlite-vec embeddings with FTS5, while lifecycle-aware ranking and deduplication improve retrieval. Reach for brainlayer when agents need memory across conversations or multiple agents need to share local project knowledge without cloud infrastructure.

Use cases

  • Store architecture decisions for later sessions
  • Search previous debugging fixes and corrections
  • Recall recent work across agent conversations
  • Digest meeting transcripts into searchable memory
  • Look up people, projects, and related entities

Key features

  • Hybrid semantic and keyword memory search
  • SQLite and sqlite-vec local storage
  • Knowledge graph with entity relationships
  • Session recall and lifecycle-aware retrieval
  • Document digestion with entity linking
  • Tag subscriptions and live notifications

Tools16

What Brainlayer lets your agent do. Expand a tool for its parameters.

Self-reported~343 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 45d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · brainlayer (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars10Stargazers on the source repository.
Last commitTodayMost recent push to the default branch.
Tools exposed16Callable tools this server registers over MCP.

How Brainlayer works

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:

Terminal
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:

config.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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Brainlayer

brainlayer is an MCP server that connects AI agents to a local SQLite memory store, hybrid vector and keyword search, and a knowledge graph. Its main tools search and store memories, recall session context, expand results, inspect entities, digest documents, and manage memory lifecycle operations through BrainBar.

Install the package with `pip install brainlayer`, then configure an MCP client to run the Homebrew `brainlayer-mcp-stdio-bridge` executable. BrainBar must be running and own `/tmp/brainbar.sock`; Intel Macs use the `/usr/local/opt/brainlayer` Homebrew path.

Yes, brainlayer works with Cursor through its MCP settings. Configure Cursor to launch the `brainlayer-mcp-stdio-bridge` command, using the Homebrew installation path appropriate to the machine.

brainlayer combines vector similarity with FTS5 keyword search and merges the results using Reciprocal Rank Fusion. Retrieval is lifecycle-aware and MMR-deduplicated, and `brain_expand` can open a result with surrounding chunks.

Yes, brainlayer supports shared organizational memory through its local database and BrainBar transport. One agent can store a decision, fix, or learning so other MCP-compatible agents can retrieve it in later sessions.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewBrainlayer AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/brainlayer?style=directory)](https://allmcps.com/mcp/brainlayer)
HTML Embed
<a href="https://allmcps.com/mcp/brainlayer"><img src="https://allmcps.com/api/badge/brainlayer?style=directory" alt="Brainlayer on AllMCPs" /></a>