brain-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@brain-mcpwhat did we decide about Firestore regions?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
brain-blueprint
Long-term memory for coding agents, done with files you can read.
Agents forget everything between sessions. Most memory layers fix that with a vector database you can't open, edit or review. This repo takes the other road, the one Claude Code's auto memory, Letta's MemFS and Basic Memory have converged on in 2025-2026: memory is a folder of Markdown notes, and the database is only an index you can delete.
It contains two things:
The blueprint. How to structure an agent's long-term memory: the note schema, the lifecycle (recall, encode, link, supersede, validate), ranking, the protocol you give the agent, and how to evaluate it.
A reference implementation. A small MCP server in Python (SQLite FTS5, under 400 lines, tested) that plugs into Claude Code, Claude Desktop, Cursor or any MCP client.
The design in six rules
One note, one idea. A Markdown file with typed YAML frontmatter. The
descriptionline is written so an agent can decide to open the note without opening it.Files are the truth, the index is disposable. Humans can edit notes by hand; the index catches up on the next call.
Recall before acting. The agent searches memory before any non-trivial step, then reads only the 1-3 best hits.
Rank on more than relevance. Score = BM25 relevance × confidence × freshness. Every factor is a number you can inspect when recall goes wrong.
Supersede, never overwrite. A contradicted note is marked
superseded, linked to its replacement and hidden from search, but its history stays. This mirrors how Graphiti invalidates facts instead of deleting them.Link across themes. Notes live in cortices (one folder per theme). Links between cortices are where the value is.
Related MCP server: akasha-mcp
Quickstart
git clone https://github.com/2soum/brain-blueprint && cd brain-blueprint
uv sync
BRAIN_DIR=./examples/brain uv run brain-mcp # stdio MCP serverAdd it to Claude Code:
claude mcp add brain -e BRAIN_DIR=$HOME/brain -- uv --directory $PWD run brain-mcpThen paste templates/AGENTS.md into your CLAUDE.md or AGENTS.md, so the agent knows when to recall and when to write.
Tools
Tool | What it does |
| Ranked recall. Returns id, title, description and score. |
| Full note, frontmatter included. |
| Cortices with counts, or the notes of one cortex. |
| Store a new note. Never overwrites: a clashing id gets a suffix. |
| Link two notes both ways. |
| Retire a note in favour of a newer one. |
| Record that a note was re-checked today. |
What a note looks like
---
id: firestore-region-europe-west1-for-eu-prospect-data
title: Firestore region europe-west1 for EU prospect data
type: decision
cortex: infra
description: EU prospect data stays in the EU; a Firestore region cannot change after creation.
tags: [firestore, region, gdpr]
confidence: 0.95
created: 2026-10-27
last_validated: 2026-10-27
status: active
links:
- to: firestore-region-us-central1
rel: supersedes
---
> For the next agent: create every new Firestore database in eur3 or europe-west1.
> Moving later means a migration.Browse examples/brain for a small brain with links and a superseded decision.
How it compares
Storage | Recall | Contradictions | |
brain-blueprint | Markdown + SQLite FTS5 | BM25 × confidence × freshness | Supersede with history |
Claude Code auto memory | Markdown + | Index always loaded, files on demand | Manual edits |
Basic Memory | Markdown + SQLite/Postgres | Full-text + vectors + graph | Manual edits |
Letta | Memory blocks + archive; git-backed MemFS (2026) | Blocks in context + search tools | Rewrite, git history |
mem0 | Vector facts, optional graph | Vectors (+ BM25 with extras) | LLM picks ADD / UPDATE / DELETE |
Graphiti / Zep | Bi-temporal knowledge graph | Vectors + BM25 + graph traversal | Facts invalidated with a timestamp |
MCP reference | JSONL entities and relations | String matching | Manual deletes |
Details, sources and caveats on published benchmark numbers are in docs/landscape.md.
Roadmap
Optional embeddings and Reciprocal Rank Fusion for paraphrase recall.
Graph expansion: return the neighbours of the top hits.
A background
consolidatepass to merge duplicates and flag stale notes.An evaluation harness on LongMemEval-style questions (updates, abstention).
Development
uv run pytest -q
uv run ruff check src testsMIT licensed. Built by Dayssam Bakaar.
Available Tools
7 toolsbrain_encodeA
Store one durable learning: a fix that worked, a constraint, a preference, a decision.
Start the body with a 2-3 sentence blockquote addressed to the next agent.
Pick an existing cortex when one fits (see brain_list); create a new one only for a new theme.
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| tags | No | ||
| type | No | fact | |
| title | Yes | ||
| cortex | Yes | ||
| confidence | No | ||
| description | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It does disclose two non-obvious behaviors not in the schema: a required body convention (opening blockquote addressed to the next agent) and a cortex-reuse policy. It says nothing about what happens on duplicate or near-duplicate entries, whether confidence is caller-asserted or validated, or what a failed cortex reference does.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short imperative lines, zero filler, with the core action stated first and the formatting convention immediately after. Every sentence constrains agent behavior.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema and no annotations, so the description is the only source of behavioral context for a 7-parameter mutation tool. The encoding ritual is well covered, but return values, error behavior, and the valid domain of type/confidence are all absent — an agent can call it, but cannot predict what comes back.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across 7 parameters, so the description must compensate and largely does not. It adds genuine meaning for only two — body (required blockquote opener) and cortex (reuse vs. create, cross-referencing brain_list). The type, confidence, tags, description and title parameters get no semantic treatment at all; notably 'type' defaults to 'fact' with no hint of what other values are legal.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource — 'Store one durable learning' — and enumerates the content kinds it accepts (a fix that worked, a constraint, a preference, a decision). That makes it clearly the write path among siblings (brain_list, brain_search, brain_read are all reads). It doesn't explicitly name a write-side sibling such as brain_supersede to contrast against, so it falls short of 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives real procedural guidance: begin the body with a 2-3 sentence blockquote for the next agent, prefer an existing cortex and consult brain_list, and create a new cortex only for a new theme. It names a sibling and the condition triggering it. Missing is the negative case — when to use brain_supersede or brain_link instead of encoding a new entry.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_linkC
Link two notes both ways. Links across cortices are the most valuable.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes | ||
| rel | No | related |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It discloses that linking is bidirectional, which is useful, but says nothing about permissions, whether existing links are overwritten, what happens if either note does not exist, or how the `rel` relationship behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short sentences with no waste, and the core action is front-loaded. Even the second sentence is brief enough not to undermine clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no annotations and 0% schema description coverage, this is not complete enough. The output schema means return values need not be explained, but the description still omits key details about `rel`, link conflicts, and error behavior that an agent needs before invoking the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description should explain the parameters. It implies that `a` and `b` are the two notes, but it never mentions `rel`, its default value, or what relationship values are meaningful. The description adds little beyond a vague mapping to two of the three parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: "Link two notes both ways." That is clear and actionable. It does not explicitly differentiate from siblings such as brain_encode or brain_supersede, but its purpose is still distinct.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The only guidance is a value heuristic: "Links across cortices are the most valuable." There is no explanation of when to use this tool versus a plain note update, when not to use it, or what prerequisites or failure conditions exist.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_listB
List cortices with their note counts, or the notes of one cortex.
| Name | Required | Description | Default |
|---|---|---|---|
| cortex | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses that cortices are returned with note counts and that one cortex returns notes, but it does not mention pagination, ordering, permissions, or failure behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no wasted words. The primary operation and conditional variant are both stated immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple list tool with no output schema and no annotations, the description covers the two core modes and what is returned at a high level. It remains incomplete regarding return structure, ordering, pagination, and parameter details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must clarify the optional cortex parameter. It does explain the conditional behavior: one cortex means notes of that cortex, otherwise list cortices with counts. However, it does not specify the parameter name, format, matching rules, or behavior for invalid values.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Uses a specific verb (“List”) and names the resources (“cortices” and “notes”), making the tool's purpose clear. It does not explicitly distinguish itself from siblings like brain_search or brain_read, so a 4 rather than 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies two basic modes—omit cortex to list cortices, provide cortex to list notes—but does not say when to use this tool instead of brain_search, brain_read, or other siblings. No exclusions or prerequisites are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_readB
Return the full Markdown of one note, frontmatter included.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It does disclose the return format (full Markdown plus frontmatter), which is genuinely useful behavior context, but says nothing about read-only semantics, error behavior for a missing id, or any permission constraints. The output schema covers return shape, lowering the bar somewhat.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One tight sentence with the key output detail front-loaded; every word earns its place and nothing is redundant.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
A simple one-parameter read tool with an output schema, so the description needn't explain return values. What is missing is minor but real: the identifier format and behavior when the note does not exist.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single required parameter 'id' has 0% schema description coverage, and the description does not compensate by explaining what the id is (slug, UUID, path?) or where an agent obtains it. With only one parameter this is a small gap, but it is entirely undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Specific verb ('Return') and resource ('the full Markdown of one note') with a scope qualifier ('frontmatter included'). The phrase 'one note' implicitly distinguishes it from brain_list and brain_search, though no sibling is named explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied: fetch a single note's content, as opposed to listing or searching via brain_list/brain_search. However, there is no explicit when-to-use/when-not guidance or mention of prerequisites such as needing to know the note id first.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_searchA
Recall notes relevant to a task. Call this before any non-trivial step.
Returns id, title, description and score; open the promising ones with brain_read.
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| query | Yes | ||
| cortex | No | ||
| include_superseded | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral burden. It discloses the return fields and recommends a follow-up read, but it does not clarify read-only safety, permission requirements, rate limits, or the behavior of optional parameters such as include_superseded.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three short sentences with no wasted language, and the core instruction is front-loaded. Return fields and the recommended next action are packed efficiently into the remaining text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema exists, so return-value documentation is not strictly required, though the description mentions fields helpfully. However, for a search tool with four parameters and no annotations, the description should explain optional filters like cortex and include_superseded to support correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% for four parameters, and the description does not name or explain query, k, cortex, or include_superseded. The phrase 'relevant to a task' loosely implies a query concept but provides no real parameter semantics, leaving three optional parameters completely undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action and resource: recall notes relevant to a task. It also distinguishes the tool from brain_read by telling the agent to open promising results with brain_read.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit usage guidance: call this before any non-trivial step, and use brain_read for promising results. It does not explain when not to use it or how it relates to siblings like brain_list or brain_encode, but the primary usage context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_supersedeB
Retire an outdated note in favour of a newer one. Never edit history in place.
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | ||
| old | Yes | ||
| reason | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses that the operation retires an old note and preserves history, but it does not explain reversibility, permissions, what happens to the old note or links, or other side effects of this mutation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, front-loaded with the core action, and no wasted wording. The behavioral rule is compact and relevant.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Although an output schema exists, this is a mutation tool with no annotations and 0% schema description coverage. The description does not explain the required 'reason' parameter, what 'retire' actually does, or the side effects, leaving an agent under-informed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It only loosely distinguishes 'old' and 'new' as notes and entirely omits the required 'reason' parameter and accepted identifier formats.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Retire') and resource ('outdated note') and clarifies the relationship to a newer note. It does not explicitly differentiate itself from siblings such as brain_encode or brain_read, so it falls short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It implies the tool should be used when a note is outdated and a newer one exists, and adds the rule 'Never edit history in place.' However, it does not name alternatives or explicitly state when not to use this tool versus brain_encode or brain_read.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_validateB
Mark a note as re-checked today, optionally with a new confidence.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| confidence | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations at all, the description carries the full behavioral burden. It does disclose the core state change (a 're-checked today' marker, i.e. an implicit timestamp stamp) and that confidence is optional, but it omits whether a supplied confidence overwrites the prior value, what happens if the id doesn't exist, and whether validation affects search ranking/decay.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with zero filler; the primary action comes first and the optional modifier follows.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 2-param tool with an output schema (so return values need no explanation) this is close, but the missing confidence scale and unstated error/side-effect behavior leave gaps the agent can't fill from structured fields, since no annotations and no param descriptions exist.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for both params. It does map 'note' to id and 'optionally with a new confidence' to confidence, clarifying optionality — but it gives no scale, bounds, or units for confidence (the schema allows any number), which is the one piece an agent most needs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource: marking a note as re-checked, with an optional confidence update. The action is distinguishable from brain_encode/brain_link/brain_supersede in kind, though the description never names those siblings to draw the contrast explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no when-to-use condition beyond the implied re-validation workflow, and no guidance on the key decision an agent faces: validate vs. supersede when a note is out of date, or validate vs. encode when it should be re-created. No prerequisites or exclusions are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.0- First observed
brain_encode - First observed
brain_link - First observed
brain_list - First observed
brain_read - First observed
brain_search - First observed
brain_supersede - First observed
brain_validate
TDQS
Scored across 7 tools
Each tool maps to a distinct action on notes: browse (list), create (encode), relate (link), retire (supersede), re-check (validate), find (search), open (read). The only mild overlap is between brain_list and brain_search, both retrieval paths, but descriptions differentiate enumeration from query-based recall.
Every tool follows a uniform brain_<verb> pattern (brain_list, brain_encode, brain_link, brain_supersede, brain_validate, brain_search, brain_read). Fully predictable and consistent.
Seven tools is well-scoped for a note-memory system, covering browse/search/read/create/link/supersede/validate without redundancy. Each tool earns its place.
The lifecycle is well covered: create, retrieve, relate, retire, and confidence-update, with intentional design that history is never edited in place. Minor gap is no explicit cortex management or bulk cleanup, though cortex creation is folded into encode.
Maintenance
Related MCP Connectors
- TaprootOAuthcom.taproothq
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
MCP-native notes and memory for ChatGPT, Claude, and other AI tools.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Notes and memory assistant: one Markdown vault that Claude, ChatGPT and any MCP client can share.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables coding agents to store, search, and retrieve long-term memory as plain Markdown files with a disposable SQLite index, including note management, decision/bug tracking, and codebase symbol lookup via MCP.8MIT
- AlicenseNot gradedqualityAmaintenanceGives coding agents a persistent memory by searching a local, read-only index of existing markdown and letting them write findings back as notes that the next session can retrieve. It serves ranked, context-sized results over MCP, injects standing conventions at session start, and keeps data on your machine with secret redaction and archive-only deletion.70 PyPIMIT
- FlicenseNot gradedqualityAmaintenanceEnables users to create, link, search, explore, and synthesize atomic notes through Claude and other MCP-compatible clients, using markdown files and a SQLite index.-
- FlicenseNot gradedqualityAmaintenanceEnables Claude and other MCP-compatible clients to create atomic notes, link them with semantic relationship types, tag and search them, and traverse the resulting knowledge graph for exploration and synthesis. Notes are stored as human-readable Markdown files that remain the source of truth, with a rebuildable SQLite index for fast querying.-