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 294K+ knowledge chunks in under 50ms
  • ✓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. Sub-50ms on 300K+ 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 209KB native Swift menu bar app. Quick capture, live dashboard, knowledge graph viewer — all over a Unix socket.

Requires the BrainLayer MCP server.

MCP tools

Twelve working tools. 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_recallUnified recall entrypoint for search, entity, and session-aware lookup
Advanced
brain_entityKnowledge graph entity lookup
brain_expandDrill into one search hit with surrounding context
brain_digestDeep-ingest large content and extract entities, actions, and relations
brain_updateUpdate chunk importance and tags by chunk ID
brain_tagsList unique tags with counts, filter by prefix
brain_get_personLook up a person entity with all known relations
Lifecycle
brain_supersedeReplace a chunk with a newer version, preserving history
brain_archiveSoft-delete a chunk with timestamp for audit trail
brain_enrichTrigger deep enrichment on a stored chunk via Groq or Gemini
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, twelve tools, zero configuration.

brainlayer — memory pipeline
Session 1 — storingsess-a7f3c
Knowledge Graph0 entities
chunks284,291entities12,847latency11mspipelineidle

Keep the context. Ship faster.

Twelve working tools, one local database, and a BrainBar capture flow that does not lose the thread.