Mneme enforces architectural decisions at generation time. It retrieves the relevant decisions for the current edit, evaluates the staged change against them with a precedence engine, and returns a binary verdict before the code reaches review. Deterministic enforcement is Mneme’s core mechanism within the architectural drift prevention stack.
How it works

Human-readable decisions,
deterministic enforcement.

Mneme lets teams author architectural decisions in plain language, then enforces them as structured rules at the moment an AI agent is about to generate code — before the output exists.

Engineers working a derivation through on a whiteboard, the reasoning written in marker
A system's decisions, laid out where people can see them. Mneme's job is to keep them true once agents start writing.

The problem with prose decisions

Architecture Decision Records and team conventions live in documents. Engineers write them carefully. But an AI coding agent working three weeks later does not reliably recall that ADR-007 forbids direct BigQuery access from frontend routes, or that the team standardized on Pub/Sub and retired Celery.

Prose is for humans. It communicates intent, rationale, and trade-offs. But prose alone cannot produce a verdict. It cannot be checked at generation time. It cannot tell an agent to stop.

Mneme solves that gap without replacing the prose. ADRs remain the human artifact. Mneme maintains a parallel structured representation that enforcement can reason against.

The enforcement flow

Every check Mneme runs follows the same path:

  1. 01
    Author decisions in human-readable form. Write ADRs, policy documents, or team conventions as you normally would. Mneme provides a structured schema alongside them — each rule gets an id, a title, constraints, and the anti-patterns that should block generation.
  2. 02
    Retrieve the relevant rules for the current task. When a developer or agent starts a task, Mneme surfaces the decisions most likely to apply. The retrieval is deterministic: same task description, same memory, same rules surface — every time.
  3. 03
    Check the prompt against the retrieved rules. Before the model generates output, Mneme evaluates the prompt against the constraints and anti-patterns in the retrieved decisions. A match produces a structured verdict: PASS, WARN, or FAIL.
  4. 04
    Record an auditable trace. Every verdict records which rule matched, which term in the prompt triggered it, and why that rule was surfaced. A human can reconstruct any verdict from the artifacts — no hidden scoring, no black box.

A concrete example

The team has decided: no second LLM provider in v1. Anthropic SDK only.

From decision to verdict
The decisionThe team has recorded: "Do not introduce a provider-abstraction layer like litellm. The only LLM provider is Anthropic."
The structured ruleMneme holds this as a structured constraint: the anti-pattern is litellm; the constraint is no second LLM provider.
The promptAn agent's task reads: "Add litellm as the provider abstraction layer so we can swap models later."
The verdictFAIL — anti-pattern matched before generation. The decision that fired, the term that triggered it, and the rule text are all recorded in the output.
The key distinction. This check runs before the model generates a single line of code. The violation is caught at the prompt boundary, not in a code review after the output already exists. That is the difference between governance and audit.

Why deterministic enforcement matters

Enforcement that varies between runs is not governance — it is suggestion. Mneme is built around the principle that the same decision, the same task, and the same memory must produce the same verdict, every time, in every environment.

This determinism is what makes governance auditable. When a CI step fails or an agent is blocked, the verdict is reconstructible: the rule that matched is recorded, the term that triggered it is recorded, and the score that surfaced that rule is recorded. There is nothing probabilistic to investigate.

It also makes regressions visible. Any change to the enforcement layer that would alter a verdict is detectable against the frozen benchmark suite — nothing can drift silently.

For deeper detail on the retrieval mechanics, the benchmark methodology, and the Layer 1 charter, see the architecture doc in the source repository.

Where Mneme sits

The architectural intent enforcement layer.

Coding agents generate. Rules files steer. Memory recalls. RAG retrieves. Mneme HQ enforces the architectural decisions that govern implementation.

Where Mneme sits A developer prompts AI coding agents (Claude Code, Cursor, Codex). The Mneme HQ architectural intent enforcement layer for AI coding agents draws on ADRs, standards, architectural constraints and its decision corpus to run a constraint evaluation. An allow verdict yields architecture-aligned code; a block verdict produces guidance that is fed back to the agents to retry. WHERE MNEME SITS ALLOW BLOCK retry with guidance Developer AI coding agents Claude Code · Cursor · Codex Mneme HQ Architectural Intent Enforcement for AI Coding Agents ADRs Standards Architectural constraints Decision corpus Constraint evaluation Guidance Architecture-aligned code
Mneme governs the moment between intent and generated code — one set of rules, applied to every agent, before the change lands.
Rules files document standards.
Mneme enforces them.
Memory tools recall context.
Mneme governs implementation.
RAG retrieves knowledge.
Mneme operationalizes decisions.

The AI-assisted engineering stack

Pre-generation governance
Mneme. Compiles architectural intent into enforceable constraints before the agent generates code.
Generation and runtime
Agent frameworks and runtime harnesses. Cursor, Claude Code, agent platforms.
Post-generation observability
Tools like SentRux. Detect violations after the agent has acted.

SentRux tells you when the agent violated architecture. Mneme helps prevent the violation from being proposed in the first place. The two layers are complementary.

What Mneme prevents

Concrete violations, not abstract rules.

Mneme injects your team's architectural decisions into AI-assisted generation. Below is what that catches in practice — the kinds of changes an agent will otherwise ship, because nothing told it not to.

Example scenario

A developer asks Claude Code to add analytics to a checkout route. The agent proposes importing the BigQuery client directly into the frontend service — violating your layered architecture decision that data-platform calls belong in a backend service only.

Mneme detects the cross-boundary call before generation completes. The violation is flagged and blocked — the agent never writes the code, and nothing reaches your PR queue.

Unauthorized framework introduction

Redux pulled into a Zustand-standardized app. Banned ORM imported into a service that already chose another.

Cross-boundary architecture violations

BigQuery client instantiated inside a frontend route. Business logic dropped into a controller. Layering decisions ignored.

ADR supersession conflicts

Celery re-introduced after the team moved to Pub/Sub. Old decisions reappearing because the agent didn't see the new one.

Restricted path modifications

Codegen agent writing to db/prod/migrations/*. Billing agent touching the auth package.

Security policy violations

Raw SQL string concatenation. Mock auth shipped in production paths. Credentials handled outside the approved surface.

Non-approved dependency usage

GPL packages added to a license-restricted repo. Internal-only libraries imported into externally-shipped services.

See all twelve examples across five governance categories →

Not the same category

Not all AI guardrails govern architecture.

"Governance" and "guardrails" describe several different problems. Mneme HQ solves a specific one: keeping AI-generated code aligned with your architecture.

AI governance platforms
Manage model risk, compliance, access, and organizational oversight.
Agent security guardrails
Restrict commands, tools, credentials, networks, and runtime behaviour.
Memory and rules files
Provide agents with instructions and historical context.
Mneme HQ
Enforces ADRs, system boundaries, framework decisions, and engineering standards where agents generate code.