Skip to main content

Mneme HQ

Architectural drift prevention for the agentic AI SDLC.

Mneme turns architectural decisions and ADRs into deterministic guardrails for the agentic AI SDLC — across coding agents, repository mutations, generated rules, and CI gates.

Tests PyPI Python License: MIT

Mneme is the architectural governance layer behind that drift-prevention mechanism. It keeps recorded engineering decisions active as AI coding systems propose and modify code, instead of leaving ADRs as passive documentation.

Current phase: Layer 1 validation. Retrieval, enforcement, and benchmark semantics are governed by the accepted architecture and freeze record. See Current Phase before changing core behavior.

What Mneme does

Mneme separates architectural guidance from deterministic enforcement:

  • Records architectural decisions in a structured, auditable decision corpus.
  • Retrieves relevant decisions when an agent or model needs architectural guidance.
  • Enforces governed rules deterministically under explicit applicability semantics.
  • Integrates at the earliest reliable boundary exposed by each coding workflow.
  • Audits bypassable mutation paths where pre-change blocking is not technically available.
  • Runs in CI as a final deterministic gate before incompatible changes are accepted.

The same input and governed decision state produce the same enforcement result. Mneme does not depend on an LLM judge for its core allow/warn/fail decisions.

Mneme is not a general-purpose vector store, conversational memory system, autonomous coding agent, or deployment observability platform.

Install

Requires Python 3.11+.

pip install mneme-hq

Verify the CLI:

mneme --help

For repository development:

git clone https://github.com/MnemeHQ/mneme.git
cd mneme
pip install -e ".[dev]"

Architecture Audit

See where your architecture is actually protected — and where it still depends on people remembering the rules.

Mneme audits your repository and shows which architectural decisions are:

  • Protected — already enforced mechanically
  • Mneme-ready — can be turned into a deterministic guardrail
  • Requires modelling — important, but not yet safe to automate
  • Guidance — useful context, but not something that should be enforced

Run an audit:

mneme audit --memory .mneme/project_memory.json --repo-root .

For a Mneme-ready decision, validate the proposed protection before enabling it:

mneme protect validate <decision-id> --memory .mneme/project_memory.json

Then explicitly activate it:

mneme protect activate <decision-id> --memory .mneme/project_memory.json

Mneme only reports a decision as Protected after it can verify that real enforcement is in place. The full activation contract is documented in Protection Activation.

Try the Architecture Audit →

60-second enforcement example

Initialize a project-local decision corpus:

mneme init

Record one architectural decision:

mneme add_decision \
  --memory .mneme/project_memory.json \
  --id config-format \
  --decision "Use JSON for configuration files" \
  --scope config \
  --constraint "Use JSON only" \
  --anti-pattern "Do not use YAML"

Create a proposed input that violates it:

python -c "import pathlib; pathlib.Path('prompt.txt').write_text('Set up a new YAML config file', encoding='utf-8')"

Run the deterministic check:

mneme check \
  --memory .mneme/project_memory.json \
  --input prompt.txt \
  --query configuration

In strict mode, the prohibited YAML proposal returns a FAIL verdict and exit code 2. A compliant JSON proposal returns PASS and exit code 0.

The CLI is the common enforcement surface. Agent integrations translate their native events into the same Mneme decision and enforcement model.

Setup mode (no enforcement)

mneme setup initializes Mneme in a repository without changing how the team works: it creates or detects project memory, detects supported agent environments, and reports protection readiness — all without enabling any blocking enforcement. Setup never turns warn/observe behavior into blocking behavior; activation of preventive enforcement is always a separate, explicit decision.

mneme setup

Optionally record an opaque Architecture Audit reference so the setup can be attributed back to a saved Audit baseline:

mneme setup --audit-ref <reference>

Setup is idempotent: rerunning it against an existing Mneme project leaves valid configuration untouched.

How it works

Architectural decisions / ADRs
            |
            v
   structured decision corpus
            |
      +-----+--------------------+
      |                          |
      v                          v
relevant guidance       deterministic enforcement
   retrieval             + applicability checks
      |                          |
      +------------+-------------+
                   |
                   v
       workflow-specific boundary
                   |
      +------------+-------------+
      |            |             |
 pre-change     post-change      CI
   hooks          audit          gate

Mneme applies governance at the earliest reliable boundary a workflow exposes:

  1. Before generation when architectural context can be injected into the model call.
  2. Before supported file mutations when an agent exposes a blocking pre-tool hook.
  3. After bypassable mutations through bounded working-tree audits where shell/script writes cannot be inspected safely before execution.
  4. Before merge through CLI-based CI gates.

These boundaries are complementary. An integration only claims the surfaces that have been implemented and validated for that harness.

Retrieval is not enforcement

Decision retrieval answers: which architectural decisions are useful as guidance for this task?

Enforcement answers: does the proposed change violate a governed rule that applies here?

Those concerns are intentionally separated. See ADR-017, ADR-019, and ADR-020.

Supported surfaces

The authoritative support matrix lives in docs/integrations/README.md. The labels below are evidence levels, not interchangeable marketing terms.

Support level Surface
Native integration Claude Code
Native integration Claude Agent SDK
Native integration Google Antigravity
Native integration Codex CLI
Native integration Kiro CLI 3.0 / v3
Validated compatibility Paperclip — CLI and ACP transports, no adapter required
Rules export Cursor
CLI-based CI gate GitHub Actions, GitLab CI
Experimental OpenCode
Planned Deep Agents middleware POC

Each integration documents its actual blocking boundary, bypass paths, degraded behavior, and validation evidence. Start with the integration matrix, not assumptions based on another harness.

ADRs and project memory

Mneme can compile architecture decisions into structured governance records rather than treating ADRs as passive prose.

The repository governance source of truth is .mneme/project_memory.json. The ADR import path preserves explicit source provenance where available so typed rules can be inspected and enforced consistently.

See:

Architecture guarantees

Three principles govern the current mechanism:

  • Deterministic > clever. Enforcement behavior must be reproducible.
  • Auditable > autonomous. A verdict should be traceable to the decision, rule, applicability state, and evidence that produced it.
  • Prevention before review. When a reliable pre-change boundary exists, use it; when it does not, surface the limitation and audit later rather than pretending the path is blocked.

The current Layer 1 scope, frozen surfaces, accepted amendments, experimental work, and deferred Layer 2 work are maintained in docs/architecture/current-phase.md.

Do not infer architecture from this README when a linked ADR or architecture document is more specific.

Benchmark and validation

Mneme's benchmark is a regression and integrity instrument for retrieval and enforcement behavior. It is not a general model-quality benchmark.

The benchmark keeps retrieval and enforcement scoring distinct so changes cannot silently improve one surface while regressing another.

See:

Demos

More examples: mnemehq.com/demo

Contributing

Before changing retrieval, enforcement, applicability, conflict handling, or benchmark semantics, read the architecture and ADRs that govern that surface.

Core behavioral changes may require the repository's charter-amendment procedure. Documentation, tooling, integrations, and examples do not automatically authorize changes to frozen behavior.

License

MIT. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mneme_hq-0.7.0.tar.gz (249.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mneme_hq-0.7.0-py3-none-any.whl (183.8 kB view details)

Uploaded Python 3

File details

Details for the file mneme_hq-0.7.0.tar.gz.

File metadata

  • Download URL: mneme_hq-0.7.0.tar.gz
  • Upload date:
  • Size: 249.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mneme_hq-0.7.0.tar.gz
Algorithm Hash digest
SHA256 95af1c7b644db5e96597bfafe1304f07494d5fb9aa4dabd5f8b86f271ad5d4cf
MD5 6588faa14b938412a68b49bafb7b8347
BLAKE2b-256 831cf3017ab071585ae9ea48abca9ee6ca1c6c94b94b9a3074cbd3055c91d602

See more details on using hashes here.

Provenance

The following attestation bundles were made for mneme_hq-0.7.0.tar.gz:

Publisher: release.yml on MnemeHQ/mneme

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mneme_hq-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: mneme_hq-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 183.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mneme_hq-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64ec2489885992869b8373c2d73d97f9129ed76c053f93da92c1b9abbd7ef280
MD5 b55325f7922aefd2772a2ac66b5b5b02
BLAKE2b-256 fd0512ed8a92fe324134e4761ed9b8cfa090b5eaba63b136c728fedd42d7e6e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mneme_hq-0.7.0-py3-none-any.whl:

Publisher: release.yml on MnemeHQ/mneme

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page