Your AI has amnesia.

Every architecture decision, every debug session, every preference you expressed — gone between sessions. BrainLayer gives any MCP agent persistent memory that survives restarts, compactions, and context limits.

Free · open source · local-first · one SQLite file

Without BrainLayer
  • ×Repeats the same mistakes every session
  • ×Forgets architecture decisions overnight
  • ×No context survives a restart or compaction
  • ×Rediscovers bugs it already fixed last week
  • ×Asks you the same clarifying questions again
With BrainLayer
  • Remembers every decision, learning, and correction
  • Searches 700K+ knowledge chunks with hybrid retrieval
  • Knowledge graph connects entities across sessions
  • Cross-session memory persists through restarts
  • Recalls your preferences, patterns, and past work
claude ~ myproject
⎇ main | 🔧 7284,291 tokens
🤖 Opus 4.6 (1M context)
Real Output

Compact, formatted, zero noise

When a memory has no tags, the formatter omits the line. Output stays clean — same box-drawing format in Claude Code and BrainBar.

claude ~ another-project
⎇ main | 🔧 3284,291 tokens
🤖 Opus 4.6 (1M context)
The Problem

Your AI forgets everything between sessions

Every architecture decision, every debugging session, every correction you gave it — gone. BrainLayer gives any MCP agent persistent memory backed by semantic search and a knowledge graph.

Semantic search

Hybrid vector + keyword search with RRF

brain_search combines bge-large embeddings with FTS5 keyword matching via Reciprocal Rank Fusion. One query searches across every conversation you have ever had across 700K+ chunks.

Knowledge graph

Entities and relations that grow over time

brain_digest extracts entities, relations, and action items from raw content. brain_entity looks up any entity in the graph with evidence and connections.

Persistent memory

Decisions, learnings, corrections — stored forever

brain_store persists any memory with auto-type detection, auto-importance scoring, and per-agent scoping. Chunk lifecycle management (supersede, archive) keeps knowledge current without losing history.

Companion App — macOS

BrainBar

Optional native Swift menu bar app. Quick capture, live dashboard, knowledge graph viewer — all over a Unix socket.

Requires the BrainLayer MCP server.

MCP tools

17-tool live surface. One memory layer.

Core - what you use daily
brain_searchHybrid semantic + keyword + KG search with compact formatted output
brain_storePersist decisions, learnings, corrections, and capture notes
brain_recallSession-aware context, history, plans, and knowledge-base stats
brain_expandDrill into one search hit with surrounding context
Knowledge and lifecycle
brain_entityKnowledge graph entity lookup
brain_get_personLook up a person with graph relations and linked memories
brain_digestDeep-ingest large content and extract entities and relations
brain_updateUpdate chunk importance and tags by chunk ID
brain_tagsList unique tags with counts and optional filtering
brain_supersedeReplace a chunk with a newer version, preserving history
brain_archiveArchive a chunk while preserving its audit trail
brain_enrichBackfill summaries and enrichment metadata
Agent bus
brain_subscribeSubscribe an agent to notifications for matching tags
brain_unsubscribeRemove some or all tag subscriptions for an agent
brain_ackAcknowledge messages processed by an agent
Operator
brain_backup_vacuum_intoCreate a consistent SQLite backup snapshot
brain_maintenance_rebuild_trigramRebuild the trigram search index in lock-aware batches

The secondary Python transport exposes 13 tools, including the Python-only brain_resume.

Works with

Any MCP client

Claude Code
Claude Code
Cursor
Cursor
Zed
Zed
VS Code
VS Code
Codex
Codex
Kiro
Kiro
Gemini CLI
Gemini CLI
Getting started

Three steps

01

Install from PyPI

02

Configure MCP and create the local database

03

Start indexing and optional BrainBar capture flows

BrainLayer runs local-first. MCP clients talk to the same memory layer, and BrainBar exposes the same formatter and database through a menu-bar capture flow on macOS.

See it work

The memory pipeline in action

Store decisions, search across sessions, recall context, digest documents. One pipeline, 17 live tools, zero configuration.

brainlayer — memory pipeline
Session 1 — storingsess-a7f3c
Knowledge Graph0 entities
chunks704,992entities12,534latency11mspipelineidle

Keep the context. Ship faster.

17 tools on the live BrainBar surface, one local database, and a capture flow that does not lose the thread.