cd /news/developer-tools/how-mneme-governs-ai-generated-code-… · home topics developer-tools article
[ARTICLE · art-43504] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

How Mneme governs AI-generated code before the model writes a line

Mneme, a new open-source tool, governs AI-generated code by enforcing project decisions before the model writes a line. It reads existing architectural decisions and checks tasks against them, preventing architectural drift. The tool runs locally in under two minutes and is available on GitHub.

read2 min views1 publishedJun 29, 2026

LLMs start every call from zero. They reintroduce a library you dropped six months ago, rebuild a component you chose to keep small, and contradict decisions your team already settled. Each violation reads as reasonable on its own. Stack them across a week of agent sessions and you get architectural drift.

Mneme works at the prompt boundary. It reads the decisions your project already made and checks the task against them before the model generates anything. The repo ships Layer 1: local-repo, single-developer, project-scoped governance. Here is the shape.

Five stages, running locally in under two minutes:

project_memory.json → MemoryStore → Retriever → ContextBuilder → LLMAdapter → Evaluator

project_memory.json

MemoryStore

Retriever

ContextBuilder

LLMAdapter

Evaluator

A second path adds conflict_detector

, which scans the response after generation, and an ADR compiler (adr_parser

then adr_compiler

) that turns ADR files with YAML frontmatter into the corpus and resolves precedence between decisions that disagree.

The demo runs each task twice, once with no governance and once with the corpus enforced, so you read the delta yourself.

RAG retrieves documents to inform an answer. Mneme retrieves decisions to constrain one.

RAG Mneme
Input Documents, chunks, embeddings Rules, constraints, decision records
Goal Inform the response Shape the response
Output The model knows more The model follows what you decided
Test "Did it cite the right source?" "Did it respect the constraint?"

No vector store, no agent loop. The corpus stays small, structured, and yours.

The freeze pins the retrieval mechanics, enforcement semantics, and benchmark methodology at commit e73ff7d

. The open exit criterion is real-world validation with design partners. Several things sit outside the wedge on purpose, not on a backlog:

The benchmark carries the same restraint. It is a regression instrument, not a generalization claim: canned model responses, fixed retrieval, two-layer scoring, today at 7/7 scenarios and recall@3 = 1.00. Its job is to make any change to retrieval or enforcement visible, so no regression lands unseen.

Layer 1, the benchmark suite, and an example corpus are public at ** https://github.com/MnemeHQ/mneme**. The concepts behind the design (governance before generation, architectural drift, verification contracts) are defined at

── more in #developer-tools 4 stories · sorted by recency
── more on @mneme 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-mneme-governs-ai…] indexed:0 read:2min 2026-06-29 ·