Skip to main content
Glama

Mimir

Persistent memory for LLMs via MCP. SQLite + FTS5 full-text search, stdio transport.

Your MCP client launches the server automatically — you never run it manually.

Quick Start

1. Install

curl -LsSf https://astral.sh/uv/install.sh | sh  # install uv
git clone <repo-url> mimir && cd mimir
uv sync

2. Register the MCP Server

Add to your client's MCP config. Replace /path/to/mimir with wherever you cloned it.

VS Code — .vscode/mcp.json or your global MCP config:

{
  "servers": {
    "mimir": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "--directory", "/path/to/mimir", "mimir"]
    }
  }
}

Claude Code:

claude mcp add mimir -- uv run --directory /path/to/mimir mimir

Cursor — Cursor Settings > MCP:

{
  "mcpServers": {
    "mimir": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/mimir", "mimir"]
    }
  }
}

3. Add Agent Instructions (Required)

Registering the server only makes the tools available. The LLM won't use them unless you tell it to. Paste the following into your agent's instruction file:

## Memory (Mimir MCP)

You have access to persistent memory via the Mimir MCP tools (prefixed `mem_`).
Use these tools proactively — do NOT wait for the user to ask.

### Session Start
- Call `mem_wake_up` at the start of every conversation to load prior context.

### When to Store (`mem_store`)
- User states a preference, convention, or decision
- You discover a codebase pattern, architecture detail, or build command
- A bug is diagnosed and fixed — store the root cause and solution
- A conversation produces an important outcome or action item
- The user corrects you — store the correction so you don't repeat the mistake

### When to Search (`mem_search`)
- Before answering questions about the project or user preferences
- Before making architectural or design decisions
- When the user references something from a past conversation

### Labels
- Use lowercase, hyphenated labels (e.g. `bug-fix`, `preference`, `codebase`, `decision`)
- Check `mem_list_labels` before creating new labels to stay consistent
- Before storing, call `mem_check_duplicate` if the memory might already exist

### Knowledge Graph
- `mem_kg_add` — record relationships (who works on what, service dependencies)
- `mem_kg_query` — answer "what is X?" or "who owns Y?"
- `mem_kg_invalidate` — mark a fact as no longer true

Where to put it depends on your client:

Client

File

Scope

VS Code / Copilot

.github/copilot-instructions.md

per repo

Claude Code

CLAUDE.md

per repo

Claude Code

~/.claude/CLAUDE.md

global

Cursor

.cursor/rules/mimir.mdc

per repo

Cursor

~/.cursor/rules/mimir.mdc

global

See each client's docs for additional global instruction options.

Related MCP server: misMEM

Storage

Mode

Flag

Path

global (default)

—

~/.mimir/memories/<workspace>/

workspace

--location=workspace

.mimir/memories/

To use workspace mode, append "--location=workspace" to the args array in your MCP config.

Tools

Tool

Description

Core

mem_store

Store a memory

mem_get

Retrieve by ID

mem_update

Update fields

mem_delete

Delete a memory

mem_batch_store

Store multiple in one transaction

mem_search

Full-text search with BM25, label/type/date filters

Context

mem_wake_up

Compact context summary — call at session start

mem_check_duplicate

Check for similar memories before storing

mem_list_labels

All labels with counts

mem_list_sessions

All sessions with time ranges

mem_stats

Totals, breakdowns, storage size

Organization

mem_link

Bidirectional link between memories

mem_purge_expired

Delete expired memories

mem_export

Export as JSON

mem_import

Import from JSON (idempotent)

Knowledge Graph

mem_kg_add

Add a subject→predicate→object fact

mem_kg_query

Query facts, with point-in-time support

mem_kg_invalidate

Mark a fact as no longer true

mem_kg_timeline

History of all facts about an entity

mem_kg_stats

Triple/entity/predicate counts

Development

uv run pytest

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
      B
      maintenance
      Provides persistent, cooperative memory for LLMs via MCP, with SQLite storage and tools for capturing, recalling, consolidating, crystallizing, and forgetting memories across sessions.
      4
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to persistently save, search, retrieve, update, link, and forget project-scoped memories through MCP tools, using local SQLite FTS5 keyword search without cloud access or telemetry.
      11 npm
      14
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables MCP-capable AI clients to share one local SQLite-backed memory of preferences, decisions, tasks, and handoffs across sessions and models. It supports saving, searching, recalling, exporting, and restoring context through tools like remember, recall, get_context, and save_handoff.
      7
      MIT