News

AI Coding Agents Forget Everything: Memorybank Provides Persistent, Cross-Session Memory

AI Coding Agents Forget Everything: Memorybank Provides Persistent, Cross-Session Memory

Every time you start a new session with AI coding agents like Claude Code or Cursor, do they start from scratch, forgetting everything that happened previously? This includes:

  • Who you are or your preferences
  • Decisions made yesterday
  • Corrections you've already provided
  • Locations of external resources

Memorybank was built to address this fundamental limitation.

What is Memorybank?

Memorybank is an MCP (Microservice Communication Protocol) server that provides any AI agent with persistent, cross-session memory. It boasts zero dependencies, is file-based, and works seamlessly with Claude Code, Cursor, Windsurf, and any other MCP-compatible tool. You can explore its features by running `npx @ura-dev/memorybank --help`.

8 MCP Tools

ToolDescription
memory_storeSave a memory (user, project, feedback, reference, custom)
memory_recallRetrieve the most relevant memories for a given query
memory_listList all memories, with optional filtering by type or tag
memory_getGet a specific memory by its ID
memory_updateUpdate an existing memory
memory_deleteDelete a memory
memory_searchPerform full-text search across all stored memories
memory_statsProvide counts, types, and storage size statistics

How it Works

The operational mechanism of memorybank is straightforward:

  1. Your AI agent encounters something worth remembering.
  2. It calls `memory_store` with a specified type, name, and content.
  3. Memorybank saves this information as a markdown file with YAML frontmatter.
  4. In the next session, the agent calls `memory_recall` to load relevant context.
  5. Consequently, the agent now has knowledge of past interactions and data.

Memories are stored locally in `~/.memorybank/`, organized by namespace (one per project). This design means no reliance on cloud services, databases, or API keys, ensuring local data control.

Setup in 30 Seconds

Integrating memorybank into your AI agent's configuration is quick and simple. For Claude Code, add the following to your config file (`~/.claude/settings.json`):

{
  "mcpServers": {
    "memorybank": {
      "command": "npx",
      "args": ["-y", "@ura-dev/memorybank", "memorybank-mcp"]
    }
  }
}

Alternatively, for Cursor, modify your `.cursor/mcp.json` file as follows:

{
  "mcpServers": {
    "memorybank": {
      "command": "npx",
      "args": ["-y", "@ura-dev/memorybank", "memorybank-mcp"]
    }
  }
}

Once configured, your AI agent will have persistent memory capabilities.

Five Memory Types

Memorybank supports five distinct memory types, each serving a specific purpose:

  • User — Information about you: role, preferences, expertise level.
  • Project — Details about the work: goals, architecture decisions, deadlines.
  • Feedback — Corrections you provided: what to avoid, what worked well.
  • Reference — External pointers: URLs, documentation locations, API endpoints.
  • Custom — Any other information you deem important to remember.

Why Not Just Use CLAUDE.md?

While `CLAUDE.md` is excellent for static project instructions, memorybank is designed for dynamic knowledge that evolves throughout a project's lifecycle. This includes:

  • User corrections that demand persistence.
  • Architectural decisions made mid-project.
  • References discovered during research.
  • Daily changing project statuses.

Memorybank complements `CLAUDE.md`, with one focusing on rules and the other on learned, evolving knowledge.

CLI Support Included

Memorybank also offers command-line interface capabilities for direct interaction.

↗ Read original source