Skip to main content
Glama

Mnemo

Mnemo is an open-source, local-first context runtime for coding agents. It keeps project facts, decisions, constraints, tasks, failed approaches and Git-aware checkpoints outside any individual model, then compiles only the relevant context for the next session.

The model can change. The project memory remains.

Why Mnemo

Coding sessions are temporary, but project decisions are not. Mnemo provides a small continuity layer shared by Codex, Claude Code, Gemini CLI and any MCP-compatible client:

developer → Mnemo → relevant context → coding agent → checkpoint → Mnemo

Mnemo is not an IDE, hosted service or coding agent. The core works offline and stores data inside the project.

Related MCP server: mcp-project-context-router

Requirements

  • Node.js 22 or newer

  • Git is recommended, but not required

  • At least one supported agent CLI for ctx <agent>

Install

During development:

pnpm install
pnpm build
npm link

After publication:

npm install -g mnemo-context-runtime

Quick start

cd my-project
ctx init
ctx task "Implement authorization" "Add server-side role checks"
ctx decide "Identity key" "Use immutable provider subject, never email"
ctx constrain "Authorization boundary" "Every object access is checked server-side"
ctx checkpoint "Authorization foundation"
ctx codex

Running ctx without an agent opens a selector containing the installed agent CLIs.

For the complete command sequence in Portuguese, see GUIA_DE_USO.md.

Commands

Command

Purpose

ctx init

Create .context/ and the local SQLite database

ctx

Select an installed agent and inject compiled context

ctx codex / claude / gemini

Start one agent with the current context

ctx remember

Record a durable fact

ctx decide

Record an active decision

ctx constrain

Record a critical constraint

ctx task

Record the current or next task

ctx fail

Record a failed approach and resolution

ctx checkpoint

Snapshot Git state and project continuity

ctx context

Print the token-budgeted context package

ctx why <topic>

Retrieve memory related to a decision or topic

ctx status

Show active memory and checkpoint state

ctx doctor

Diagnose runtime and agent availability

ctx mcp

Serve project memory using MCP over stdio

Use ctx <command> --help for command-specific options.

Storage

Mnemo creates:

.context/
├── config.json
├── context.db
├── state.json
└── logs/

.context/ should not be committed. Project configuration stays local, and SQLite uses WAL mode, foreign keys and prepared statements.

Security model

All text is sanitized before persistence. Built-in rules redact common API keys, bearer credentials, JWTs, private keys and password-like assignments. .contextignore documents files that must not enter repository analysis.

Sanitization is defense in depth, not a reason to paste credentials into Mnemo. Never deliberately record secrets.

MCP setup

Any MCP client that supports local stdio servers can launch:

{
  "mcpServers": {
    "mnemo": {
      "command": "ctx",
      "args": ["mcp"]
    }
  }
}

Available tools include project_state, project_context, memory_search, memory_get, report_memory and memory_checkpoint.

Design principles

  • Git owns code history; Mnemo owns continuity and rationale.

  • Active decisions supersede old decisions instead of silently rewriting history.

  • Context cost grows with changes, not the full conversation history.

  • Local rules and deterministic inspection come before optional model inference.

  • An agent receives a minimal package first and retrieves more context on demand.

Development

pnpm typecheck
pnpm test
pnpm build

See PROJETO.md for the product definition and IMPLEMENTATION.md for release status.

Benchmark

The first controlled handoff experiment is documented in benchmarks/devtrace-saas/RESULTS.md. It observed an 18% reduction in uncached-input-plus-output tokens with equivalent typecheck/test outcomes. This is an initial paired run, not yet a statistically reliable performance claim; the protocol requires at least five repetitions.

License

Apache License 2.0.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Hosted memory for coding agents, exposing commit_mem, recall, and status over stdio. Each write carries provenance, contradictions surface as inspectable state changes, and a bad run can be rolled back from a snapshot.
    8
    305 PyPI
    1
    Business Source 1.1
  • A
    license
    Not graded
    quality
    A
    maintenance
    A local markdown memory and cross-agent context engine for AI coding assistants. It provides an MCP server with tools to search, add, retrieve, and distill persistent memory across tools like Claude Code, Cursor, and Zed.
    126 PyPI
    5
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides a drop-in MCP memory server over stdio using a local SQLite store, enabling agents to store, search, and audit memory with provenance, scoped access, and contradiction tracking without requiring API keys, LLMs, or embedding providers.
    551 npm
    16
    Apache 2.0