"FastAPI", "async SQLAlchemy 2.0",
"asyncpg driver" · confidence 0.95
query: "project framework"
Week 3 Aider had zero context from Week 1. MnemeBrain bridged three weeks of project history in a single search() call.
How it works
MCP bridge in a terminal workflowAider 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.
Install the backend
One commandpip install mnemebrain-lite mnemebrain-lite serve # → MnemeBrain running at http://localhost:8000
Keep this terminal open. Add to your shell profile to start automatically:
# Start MnemeBrain in background on shell startup mnemebrain-lite serve &> /tmp/mnemebrain.log &
Clone the MCP bridge
The subprocess Aider spawnsgit clone https://github.com/mnemebrain/mnemebrain-mcp cd mnemebrain-mcp uv sync pwd # note this path for the config step
Configure Aider
Global config or per-project flagOption A — global config (recommended): Add to ~/.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:
aider --mcp-server "uv --directory /path/to/mnemebrain-mcp run mnemebrain-mcp"
.aider.conf.yml to your project root and commit it. Anyone who clones the repo and has MnemeBrain installed gets memory immediately.
Use memory across sessions
The patterns that matter for long CLI projectsStore a project decision:
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:
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:
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.