Page typeFlagship demo RunnabilityRunnable locally OutcomeDeny → pass

An agent creates a second source of truth. Mneme blocks the migration.

This project keeps state in human-editable JSON. The agent proposes SQLAlchemy, PostgreSQL, and Alembic anyway—a storage migration with new credentials, operations, and a second place to trust. Mneme stops it before code is written, then checks a correction that stays inside the existing store.

Live enforcement

One decision. One blocked plan. One safe retry.

This is a product boundary, not a style preference. Both plans go through the same recorded decision.

Decision at stake

mneme_storage_json · Use JSON storage only. Keep the project local-first and human-editable. No external database, ORM, or migration layer in v1.

mneme check · storage policy trace
  1. 01 Decision

    The project records JSON as a deliberate storage boundary, not a temporary default.

    storage: JSON · external database: denied
  2. 02 Guidance

    The relevant decision is selected before the agent executes the storage refactor.

    mneme_storage_json: no ORM · no migration layer
  3. 03 Violation

    The proposed task replaces the approved store with a new database stack.

    Use SQLAlchemy + PostgreSQL + Alembic
  4. 04 Deny

    The pre-flight check matches two explicit anti-patterns and exits non-zero.

    mneme_storage_json · add sqlalchemy · add migration layer · exit 2
    DENY
  5. 05 Correction

    The task is narrowed to add capability inside the existing storage boundary.

    Add expires_at · keep JSON · no new dependencies
  6. 06 Allow

    The same deterministic check runs clean on the corrected task.

    Result: PASS · exit 0
    PASS
No autoplay scroll · transcript follows bundled fixtures

Run it yourself

Run the violating and compliant tasks

Both inputs and the decision record ship with the product repository, so the deny-to-pass sequence is reproducible without a live model call.

git clone https://github.com/MnemeHQ/mneme
cd mneme
pip install -e .

mneme check --memory examples/project_memory.json \
  --input examples/prompt_violation.txt --query "storage backend"
# FAIL [mneme_storage_json] · exit 2

mneme check --memory examples/project_memory.json \
  --input examples/prompt_clean.txt --query "storage backend"
# Result: PASS · exit 0

What happened

The boundary is explicit.

The decision names JSON as the approved store and ORM, SQLAlchemy, and migrations as anti-patterns.

One source of truth remains.

The agent cannot create a parallel database, migration history, and credential path that later work would treat as established architecture.

The retry is re-verified.

The corrected task is not trusted automatically; it passes through the same decision and returns clean.

Common questions

Is the terminal output real?

Yes. The decision record and both input files are included in the Mneme repository. The transcript condenses the two real mneme check runs into one readable sequence.

Does Mneme rewrite the agent task?

No. Mneme blocks the violating task and identifies the decision it conflicts with. A human or the model submits the corrected task, which is evaluated through the same check.

Why block this before the agent writes code?

The proposal already contradicts an explicit architecture decision. Blocking it before execution prevents a predictable SQLAlchemy and migration diff from becoming review work.

Ready to try it?

Install Mneme and check your first decision in under five minutes.

pipx install "mneme-hq>=0.5.1"
Python 3.11+ · MIT licensed