Skip to main content
Glama

Brain Memory is a persistent memory system for AI agents. It stores memories as Markdown files in ~/.brain/ and provides a command-line tool, brain, that agents use to store, recall and maintain them. The same memories are available to every supported agent on the machine.

Full documentation: brainmemory.ai/docs

Requirements

  • Node.js 18 or later.

  • One or more supported agents: Claude Code, OpenAI Codex CLI, OpenCode, GitHub Copilot CLI, Kilo or Google Antigravity.

Related MCP server: Ghostkeep

Installation

There are two ways to install Brain Memory. They can be used together.

Local installation

Memories are stored on your machine. No account is required.

npm install -g brain-memory
brain

The first command installs the package and the brain command. The second command starts the setup program, which configures the agents you select.

To configure agents without the setup program:

brain --claude --global
brain --codex --global
brain --all --global

Install with a system Node.js rather than a version manager such as nvm, so that brain remains available to agents. See Installation for details.

Hosted connector

Memories are stored in Brain Cloud and are available in any application that supports remote MCP servers, including Claude.ai and ChatGPT. An account is required. Sign in with Google or with email and password. If you have no account, signing in creates a free one with an empty brain.

The connector address is https://mcp.brainmemory.ai/mcp.

claude mcp add --transport http brain https://mcp.brainmemory.ai/mcp
codex mcp add brain --url https://mcp.brainmemory.ai/mcp

For other applications, add the address as a custom connector and sign in when asked. See Claude apps, ChatGPT, and Connect other agents for Grok Build (formerly Cursor), GitHub Copilot, Gemini CLI, Devin Desktop (formerly Windsurf), Zed, Cline and more. Apps on OpenRouter or another OpenAI-compatible API can use integrations/openrouter.

For the Claude apps there is also a plugin that adds a skill to the connector, so Claude knows when to recall and when to offer to save. The Claude apps page has the download.

If you also use the local installation, brain cloud login followed by brain cloud sync merges ~/.brain/ and the cloud copy in both directions.

Usage

After installation, agents recall relevant memories at the start of each session and offer to store new ones at the end. The following commands are also available in the agent:

Command

Purpose

/brain:remember [query]

Recall memories relevant to a query.

/brain:memorize [topic]

Store memories from the current session.

/brain:status

Show the state of the memory store.

/brain:pin [id]

Load a memory in every session.

/brain:forget [target]

Archive or erase memories.

/brain:import

Create initial memories from past agent sessions.

/brain:verify

Review memories that are waiting for approval.

/brain:sync

Synchronise memories between machines.

/brain:skills

Manage stored procedures.

/brain:sleep

Run maintenance on the memory store.

Some command-line commands are used directly:

Command

Purpose

brain cloud sync

Merge ~/.brain/ and Brain Cloud, memory by memory, in both directions.

brain review

List duplicates, likely replaced memories, faded memories and signature problems. Changes nothing.

brain keys

Show this machine's signing key and manage trusted signers.

brain episodes

Ingest, search and read past Claude Code and Codex sessions. They stay on this machine.

brain port

Export memories to, or import them from, another memory system.

Run brain help for the full list of command-line commands.

Data and privacy

  • Memories are plain Markdown files in ~/.brain/ and can be read and edited directly.

  • With the local installation, nothing leaves your machine unless you configure synchronisation, through Brain Cloud or a Git repository that you choose.

  • Content from outside sources, such as web pages or tool output, is held for your approval before agents can use it.

  • Memories are signed when written, so changes made outside Brain Memory can be detected.

  • Files under ~/.brain/.local/, including signing keys and session history, are never synchronised.

Updating and uninstalling

npm install -g brain-memory
brain update
brain uninstall
npm uninstall -g brain-memory

Uninstalling keeps ~/.brain/. Add --delete-data to brain uninstall to remove it.

Documentation

Contributing

See CONTRIBUTING.md. Report security issues as described in SECURITY.md.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides persistent, searchable memory for MCP-compatible agents, enabling recall by meaning, automatic decay, trust scoring, and cross-agent handoffs.
      5
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to store, search, and resolve shared memories with full provenance, conflict detection, and an audit trail across MCP-compatible clients.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives AI agents a persistent long-term memory store over MCP, letting them remember facts and preferences, recall ranked memories with a one-line explanation of why each scored, mark which recalled memories were used or ignored so retrieval learns over time, and forget or list memories per namespace.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables any MCP-capable client to write, search, list, and forget long-term memories stored as human-readable markdown cards, with hybrid vector-plus-keyword retrieval and automatic relevance-based injection into context.
      MIT