How Mneme HQ Prevents Coding Assistants from Violating Architecture Rules
Stop Cursor, Claude Code, and Copilot from ignoring your ADRs, service boundaries, and team conventions — session after session.
Your coding assistant has no memory of yesterday's decisions.
Every session with a coding assistant starts fresh. It doesn't know that you decided in March to never bypass the service layer. It doesn't know that the embeddings approach was ruled out after a spike. It doesn't know your team's naming conventions or which abstractions are off-limits.
The result: repeated architectural violations, slow code review, and "we've discussed this" conversations that happen every sprint.
Rule: All database access must go through the repository layer.
Context: Direct queries in route handlers bypass transaction management and were banned in ADR-004.
→ Surfaced 1 violation before code generation.
RAG and system prompts don't hold across sessions.
| Approach | Limitation | With Mneme HQ |
|---|---|---|
| System prompt | Truncated at context limit; can't cover full decision history; manually maintained | Decisions retrieved at query time — only relevant decisions are surfaced |
| RAG over docs | Documents aren't decisions; no enforcement layer; retrieves text, not rules | Structured decision store with explicit violation detection |
| Code review | Catches violations after the fact; wastes reviewer time on avoidable issues | Pre-flight check catches violations before code is written |
| CLAUDE.md / .cursorrules | Flat text; no semantic retrieval; decays as teams add more rules | Mneme HQ generates optimized rules files from structured decision store |
Decision-aware pre-flight checks for every AI request.
Capture decisions in structured YAML
Record architectural decisions, constraints, and anti-patterns in decisions/. Each entry has a rule, rationale, and enforcement metadata.
Run mneme check before prompting
Pass your intended prompt or planned change through Mneme HQ. It retrieves relevant decisions and checks for potential violations.
Generate assistant-specific rules files
mneme cursor generate outputs .cursor/rules/mneme.mdc — a distilled ruleset the assistant sees in every session.
Gate CI on decision compliance
Add mneme check --mode strict to your CI pipeline. PRs that violate architectural decisions fail before review.
What the setup looks like.
id: no-direct-db-queries title: All database access via repository layer status: accepted rule: Never query the database directly from route handlers or services. rationale: Direct queries bypass transaction management and make testing impossible. Banned after incident in sprint 14 (ADR-004). enforcement: strict tags: [architecture, database, anti-pattern]
$ mneme check "add a search endpoint that filters by tag" --mode strict Retrieving relevant decisions... (3 matched) ✓ PASS decision/use-repository-pattern ✓ PASS decision/tag-filtering-via-indexed-column ✗ FAIL decision/no-direct-db-queries Reason: Prompt implies direct query construction in handler layer. See: decisions/adr-004-no-direct-db.yml Result: FAIL (1 violation, strict mode)
- name: Check decision compliance run: mneme check --mode strict --ci
What teams report after adding decision enforcement.
Common questions.
Does Mneme HQ work with Cursor, Claude Code, and Copilot?
mneme check runs before you prompt, and mneme cursor generate writes a rules file that Cursor picks up automatically. Claude Code users can source the generated rules file via CLAUDE.md.What's the difference between Mneme HQ and just writing better system prompts?
How long does it take to set up?
pip install mneme-hq, add your first decision to .mneme/project_memory.json, and run mneme check. See the README for the quickstart.Can I enforce decisions in CI without blocking the pipeline during setup?
--mode warn for a non-blocking run that logs violations without failing the build. Switch to --mode strict once you're confident in your decision set.