Mneme HQ
repo-native architectural rules for AI coding agents
Last verified:
What is Mneme HQ?
Mneme HQ is an open-source architectural governance layer for AI-assisted software development. It compiles your team's architectural decision records (ADRs) into deterministic, enforceable constraints that govern AI coding agents before code is generated, preventing architectural drift before it reaches code review. The tool stores architectural decisions, constraints, approved patterns, and anti-patterns as structured, repo-native governance records in a project_memory.json file that lives alongside your code.
Key features include deterministic pre-generation enforcement with no vector store or ML dependencies, scope-aware retrieval using field-weighted keyword scoring, and a Claude Code hook that intercepts every Edit, Write, and MultiEdit operation to block violations in strict mode. Mneme generates Cursor rules directly from stored decisions, provides CI integration via GitHub Actions, and includes a CLI with mneme check command supporting both strict and warn modes. The tool evaluates AI-generated code against injected constraints, surfacing violations with PASS/WARN/FAIL signals before code reaches your PR queue.
Mneme HQ is built for engineering teams using Cursor, Claude Code, GitHub Copilot, or agent workflows who need deterministic governance over AI-generated code. Ideal customers include platform engineering teams maintaining shared APIs, backend and data platform teams owning data pipelines, AI-native product engineering teams using agentic workflows daily, and architecture guilds responsible for ADRs and engineering standards. It is strongest when teams already have architectural decisions, standards, or repo constraints they need AI coding tools to respect.
Mneme HQ pricing
Pricing model: Freemium
Mneme HQ is free and open-source under MIT license. The core tool is available at github.com/TheoV823/mneme and installs via pip install mneme. No paid tiers are currently offered. Commercial offerings including managed governance, hosted policy packs, and enterprise audit log are planned for Layer 2 but the core remains open. The CLI, Claude Code hook, Cursor rule generation, GitHub Actions workflow, and Python API are all included free.
Mneme HQ pros
- Open-source with MIT license
- Deterministic enforcement with no vector store required
- No ML dependencies in the governance path
- Pre-generation governance blocks violations before code is written
- Works with Cursor, Claude Code, GitHub Copilot, and agent frameworks
- Local-first architecture keeps all data in your repo
- CLI supports both strict and warn enforcement modes
- Generates Cursor rules from single decision corpus
- Claude Code hook intercepts edits before they complete
- GitHub Actions integration for CI governance checks
- Field-weighted keyword scoring for relevant decision retrieval
- ADR compiler resolves precedence deterministically
- Conflict detector flags violations with decision ID and snippet
- Lightweight install with minimal dependencies
- Benchmark methodology is reproducible and deterministic
- Slash commands in Claude Code for check, context, record, review
- Model-agnostic supports OpenAI, Anthropic, Gemini, Llama
Mneme HQ cons
- Requires teams to already have written ADRs or architectural decisions
- Not suitable for solo projects without architectural complexity
- Does not auto-fix violations, only blocks them
- Copilot integration is prompt-layer not hook-layer
- Currently focuses on code governance not docs or configs
- Layer 2 features like multi-repo governance are out of scope
- Pure frontend teams with little architectural constraint get less value
- Not a generic code review bot or runtime safety platform
- Learning curve to write good Decision records with anti-patterns
Frequently asked questions about Mneme HQ
What is Mneme HQ in one sentence?
Mneme HQ is the architectural governance layer for AI-assisted development that compiles architectural decision records into a deterministic active constraint set and enforces those decisions at the prompt boundary, blocking AI coding agents from generating code that contradicts decisions your team already made.
How is Mneme different from Cursor Rules or CLAUDE.md?
Rules files document standards while Mneme enforces them. Cursor Rules and CLAUDE.md are prompt files that describe preferences to the model without enforcement. Mneme is a governance layer that compiles architectural decisions into enforceable constraints, retrieves them at prompt time based on what the agent is doing, and validates outputs against them with deterministic precedence resolution and conflict detection.
How is Mneme different from RAG or vector databases?
RAG retrieves knowledge while Mneme operationalizes decisions. RAG systems surface documents that the model may or may not act on using probabilistic vector similarity. Mneme compiles architectural decisions into structured rules and evaluates AI-generated code against them with no embedding model, no vector store, and no probabilistic retrieval in the governance path.
Does Mneme require a vector store or ML infrastructure?
No. Mneme uses deterministic, version-controlled decision graphs and tag-scoped retrieval with field-weighted keyword overlap scoring. There is no vector store, no embedding model, and no ML dependency in the governance path. This is a deliberate architectural commitment for determinism, debuggability, and reproducibility.
What enforcement modes does Mneme support?
Mneme supports strict and warn modes. In strict mode, mneme check exits non-zero on any violation and the Claude Code hook blocks the write. In warn mode, violations are surfaced without blocking, which is useful for adopting Mneme on an existing repo where you want visibility before turning on enforcement. The default Claude Code hook mode is strict while the default GitHub Actions workflow mode is warn.
How does Mneme integrate with Claude Code?
Mneme HQ ships a PreToolUse hook for Claude Code that intercepts every Edit, Write, and MultiEdit operation. The hook reconstructs the full post-edit file, runs mneme check against the active constraint set, and either blocks the write in strict mode or surfaces the violation without blocking in warn mode. Install with pip install mneme then python scripts/install_claude_code.py, which writes .claude/settings.json, slash commands, and a discovery skill.
What is the project_memory.json file?
A human-editable JSON file that holds your architectural decisions at your repo root. It contains three top-level arrays: items for legacy rules that auto-migrate to Decisions, examples with decision examples showing task/decision/rationale, and decisions using the modern typed Decision schema with id, decision, rationale, scope, constraints, and anti_patterns fields. Plain JSON requires no tooling to edit.
What kinds of teams should adopt Mneme HQ?
Teams that already write ADRs or maintain an internal architecture document, run AI coding agents at meaningful volume with multiple devs on Claude Code, Cursor, or Copilot, and care about architectural consistency more than raw generation speed. Best fit includes mid-size engineering orgs with 50-500 engineers, regulated industries like fintech and health, open-source projects with strict scope discipline, and any team where we already decided this six months ago is a familiar phrase.
Can Mneme HQ auto-fix violations?
No. Mneme HQ blocks and the human or model fixes. Auto-fixing is explicitly out of scope because a deterministic governance layer cannot also be the thing that decides how to comply, or it becomes the same kind of opinionated agent it is meant to govern. In strict mode the Claude Code hook blocks the write and surfaces the violation for you to amend the prompt, override the verdict after updating the ADR, or temporarily switch to warn mode.
What stacks does Mneme work with?
Mneme works with direct LLM API integrations supporting OpenAI, Anthropic, Gemini, Llama, Qwen, DeepSeek, and Mistral through both direct APIs and OpenAI-compatible endpoints. It supports coding agents including Claude Code and Cursor with native integration, plus Copilot, Aider, and Cline designed-to-support. For frameworks it supports LangGraph, CrewAI, AutoGen, and OpenAI Agents SDK, with native GitHub Actions integration and self-hosted runner support.