Setup Guide

Give Aider
long-term
coding memory

Aider is the terminal-native AI pair programmer — lightweight, fast, and built for developers who live in the CLI. But like every session-based AI tool, it forgets everything the moment you close the session.

Without MnemeBrain, Aider starts each session completely blank. With it, every architecture choice, migration, and decision is stored in a persistent belief graph — retrieved the moment it's relevant again.

March 2026 ~5 min setup Aider + MCP + MnemeBrain
aidermcpsetup guidemnemebrain-lite
terminal — aider across 3 weeks
# Week 1 $ aider You: we're building this with FastAPI, async SQLAlchemy, and Alembic migrations Aider: Stored 3 beliefs. FastAPI + async SQLAlchemy + Alembic · confidence 0.95 each
# Week 3 — new session $ aider You: we've decided to migrate to Django Aider: ⚡ Contradiction with stored beliefs: "project uses FastAPI" truth_state → BOTH · flagging conflict before updating
TL;DR
1pip install mnemebrain-lite then mnemebrain-lite serve
2Clone MCP bridge: git clone https://github.com/mnemebrain/mnemebrain-mcp then uv sync
3Add to ~/.aider.conf.yml or pass --mcp-server flag on startup
4Launch Aider as normal — memory tools are available in every session
Steps in this guide
Architecture changes tracked across weeks of Aider sessions
Week 1
You: We're going with FastAPI. Async-first throughout. SQLAlchemy 2.0 with asyncpg.

↳ believe() × 3 beliefs
"FastAPI", "async SQLAlchemy 2.0",
"asyncpg driver" · confidence 0.95
Week 3 (fresh Aider session)
You: What framework are we using?

↳ search() called
query: "project framework"

Aider: FastAPI (confidence: 0.95). Async-first, SQLAlchemy 2.0 with asyncpg. Stored in Week 1.

Week 3 Aider had zero context from Week 1. MnemeBrain bridged three weeks of project history in a single search() call.

01

How it works

MCP bridge in a terminal workflow

Aider supports MCP servers via its --mcp-server flag or config file. On startup, it spawns the MnemeBrain MCP bridge as a subprocess and registers 13 memory tools. These tools are available throughout every session — Aider calls them automatically as context becomes relevant.

The backend is a local FastAPI server. The bridge translates Aider's MCP calls into HTTP requests to localhost:8000. Nothing leaves your machine.

HN users love Aider for this reason: it's fully local, composable, and doesn't require cloud services. MnemeBrain keeps the same philosophy — local first, no external dependencies.
02

Install the backend

One command
terminal
pip install mnemebrain-lite
mnemebrain-lite serve
# → MnemeBrain running at http://localhost:8000

Keep this terminal open. Add to your shell profile to start automatically:

~/.zshrc or ~/.bashrc
# Start MnemeBrain in background on shell startup
mnemebrain-lite serve &> /tmp/mnemebrain.log &
03

Clone the MCP bridge

The subprocess Aider spawns
terminal
git clone https://github.com/mnemebrain/mnemebrain-mcp
cd mnemebrain-mcp
uv sync
pwd   # note this path for the config step
04

Configure Aider

Global config or per-project flag

Option A — global config (recommended): Add to ~/.aider.conf.yml:

~/.aider.conf.yml
mcp_servers:
  - name: mnemebrain
    command: uv
    args:
      - "--directory"
      - "/path/to/mnemebrain-mcp"
      - "run"
      - "mnemebrain-mcp"
    env:
      MNEMEBRAIN_URL: "http://localhost:8000"

Option B — per-session flag:

terminal
aider --mcp-server "uv --directory /path/to/mnemebrain-mcp run mnemebrain-mcp"
Project-scoped: Add an .aider.conf.yml to your project root and commit it. Anyone who clones the repo and has MnemeBrain installed gets memory immediately.
05

Use memory across sessions

The patterns that matter for long CLI projects

Store a project decision:

Aider session
Remember: we chose FastAPI over Flask because we need async support.
All endpoints should be async def. No sync routes in this codebase.

Retrieve it three weeks later:

Aider session — Week 3
Why are we using FastAPI instead of Flask?

Aider calls explain() and returns the full justification chain with the original reasoning, timestamp, and confidence.

Migration detected as a contradiction:

ATTACKS edge — framework migration
Week 1: "project uses FastAPI"
Week 3: "migrating to Django for admin panel support"

truth_state: BOTH ← both beliefs retained with evidence
belief_1: "FastAPI" confidence: 0.95 → 0.29
belief_2: "Django (migration in progress)" confidence: 0.88

Aider: ⚡ Framework conflict. FastAPI was stored Week 1. Confirm Django migration scope — are we replacing or running both?

Most retrieval-based memory systems cannot represent contradictions explicitly — they silently overwrite the old fact. MnemeBrain creates an ATTACKS edge, flags truth_state: BOTH, and lets Aider surface the conflict before acting on stale data.

What you've built

Aider now has a persistent belief graph that survives across every terminal session. Framework choices, migration history, architectural patterns, and developer conventions are stored, tracked for contradictions, and retrieved semantically — in the same CLI workflow you already use.

Typical belief lookup is <5ms on a local Kuzu store with ~100k beliefs. No cloud, no external APIs, no behavioural change to your Aider workflow.

GitHub: mnemebrain-lite →   PyPI →   BMB Leaderboard →