Integration: Aider
Coverage status
Section titled “Coverage status”| Path | Status | Notes |
|---|---|---|
| Harness (proxy) | ✅ Supported | Aider routes through MemStrata via --openai-api-base |
| MCP server | — | Aider does not support MCP natively |
| Browser extension | — | Aider is terminal-based; no browser surface |
Confidence: High. The harness proxy has been the primary Aider integration path since MemStrata v5.0. Tested with Aider v0.50+.
How it works: MemStrata exposes an OpenAI-compatible API on localhost:8080/v1. Aider is configured to use this as its API base. Every request Aider makes passes through the MemStrata harness, which compresses the context before forwarding to your real LLM provider. From Aider’s perspective, MemStrata is transparent.
1. Start the MemStrata harness
memstrata serve --port 8080The harness starts an OpenAI-compatible endpoint at http://localhost:8080/v1. Your real LLM provider credentials stay in MemStrata’s config (set once with memstrata config set provider).
2. Configure Aider to use the harness
Run Aider with the --openai-api-base flag:
aider --openai-api-base http://localhost:8080/v1 --openai-api-key memstrataThe --openai-api-key value (memstrata) is a placeholder — authentication to your real provider is handled by the harness using your stored credentials. Pass any non-empty string.
3. Alias for convenience
Add to your shell profile:
alias aider-ms='aider --openai-api-base http://localhost:8080/v1 --openai-api-key memstrata'Then just run aider-ms instead of aider.
4. Verify
Start an Aider session and run:
/ask What does the main() function do?In a second terminal, check the harness log:
memstrata logs --tail 20You should see entries like:
[2025-01-15 10:23:41] aider | compressed 4,821 → 2,109 tokens (56% reduction) | recall: 0.91Model selection
Section titled “Model selection”The harness forwards requests to whatever provider you’ve configured. To use a specific model:
aider --openai-api-base http://localhost:8080/v1 \ --openai-api-key memstrata \ --model gpt-4oOr, to use Claude via the harness (the harness translates the OpenAI API format to Anthropic’s format):
aider --openai-api-base http://localhost:8080/v1 \ --openai-api-key memstrata \ --model claude-3-7-sonnet-20250219Supported provider translations: OpenAI → OpenAI (passthrough), OpenAI → Anthropic, OpenAI → Ollama (local). Configure in memstrata config set provider.
What’s captured
Section titled “What’s captured”| Signal | Captured? | Notes |
|---|---|---|
/ask queries | ✅ Yes | Full context compression applied |
/code requests | ✅ Yes | Harness compresses codebase context |
| Architect mode | ✅ Yes | Both planning and editing turns |
--map-tokens flag | ⚠️ Partial | Aider’s repo map and MemStrata’s graph index both run; MemStrata’s compressed output takes precedence |
| Edit application (file writes) | ✅ Yes | Tracked for 24h survival metric |
/run commands | — | Shell commands; not AI turns |
Voice input (--voice) | ✅ Yes | Transcribed text is captured as a normal turn |
On --map-tokens interaction: Aider builds its own repo map and includes it in the prompt. When MemStrata is in the loop, it deduplicates and compresses this alongside its own graph context. If you want MemStrata to have full control, set --map-tokens 0 to disable Aider’s map and let MemStrata handle context entirely.
Troubleshooting
Section titled “Troubleshooting”Aider shows “Connection refused” for api-base
The harness isn’t running. In a separate terminal: memstrata serve --port 8080.
openai.AuthenticationError
Pass any non-empty string as the API key (--openai-api-key memstrata). The real credentials are in MemStrata’s config.
Aider works but savings metrics don’t appear on dashboard
Check that memstrata index has been run on your project. The dashboard only shows metrics for indexed projects.
Slow responses with large codebases
First-request latency includes the graph query. Subsequent requests in the same session are faster (the relevant subgraph is cached). If it’s consistently slow, run memstrata index --rebuild to refresh the index.
Aider’s /diff shows unexpected changes
MemStrata never modifies the code Aider writes — it only compresses the input context, not the output. If diffs are unexpected, the cause is in Aider’s editing behavior, not MemStrata.