# mnemon - Doramagic AI Context Pack

> Positioning: a pre-install experience and judgment asset. It helps the host AI get off to a good start, but it does not mean the project has already been installed, run, or validated.

## Sufficiency Principle

- **Sufficiency over compression**: The AI Context Pack should be sufficient for the host AI to understand the project's value, capability boundaries, entrypoints, risks, and evidence sources before starting work; it may be layered, but it does not aim for the shortest possible summary.
- **Compression policy**: Compress only noise and duplication, never context that affects judgment or the quality of the work.

## How the Host AI Should Use This

You are reading the AI Context Pack that Doramagic compiled for mnemon. Treat it as pre-work context: help the user understand who it fits, what it can do, how to start, what must be verified after install, and where the risks are. Do not claim that you have already installed, run, or executed the target project.

## Claim Consumption Rules

- **Fact source**: Repo Evidence + Claim/Evidence Graph; the Human Wiki only supplies salience, terminology, and narrative structure.
- **Minimum status for a fact**: `supported`
- `supported`: May be used as a project fact, but the answer must cite the claim_id and evidence path.
- `weak`: Usable only as a low-confidence lead; the user must be asked to keep verifying.
- `inferred`: Usable only for risk notes or open questions; must not be packaged as a project fact.
- `unverified`: Must not be used as fact; state clearly that evidence is insufficient.
- `contradicted`: Must show the conflicting sources and must not force a single version on the user's behalf.

## Who It Fits Best

- **Developers already using host AIs such as Claude/Codex/Cursor/Gemini**: The README or plugin config mentions multiple host AIs. Evidence: `README.md` Claim: `clm_0002` supported 0.86

## What It Can Do

- **Command-Line Startup or Install Flow** (Verify after install): The project documentation contains runnable commands; real use requires running them in a local or host environment. Evidence: `CLAUDE.md`, `README.md` Claim: `clm_0001` supported 0.86

## How to Start

- `pip install mnemon-memory` Evidence: `README.md` Claim: `clm_0003` supported 0.86, `clm_0007` supported 0.86, `clm_0009` supported 0.86, `clm_0010` supported 0.86
- `git clone https://github.com/nousergon/mnemon.git` Evidence: `README.md` Claim: `clm_0004` supported 0.86
- `pip install -e .` Evidence: `README.md` Claim: `clm_0005` supported 0.86, `clm_0006` supported 0.86, `clm_0010` supported 0.86, `clm_0012` supported 0.86
- `pip install -e ".[dev]"` Evidence: `README.md` Claim: `clm_0006` supported 0.86, `clm_0012` supported 0.86
- `pip install "mnemon-memory[server]"` Evidence: `README.md` Claim: `clm_0007` supported 0.86
- `pip install -U 'mnemon-memory[server]'` Evidence: `README.md` Claim: `clm_0008` supported 0.86
- `pip install "mnemon-memory[ui]"` Evidence: `README.md` Claim: `clm_0009` supported 0.86
- `pip install -e .           # or: pip install mnemon-memory` Evidence: `README.md` Claim: `clm_0010` supported 0.86
- `pip install 'numba==0.62.1' 'llvmlite==0.45.1' 'mnemon-memory[ui]'` Evidence: `README.md` Claim: `clm_0011` supported 0.86
- `pip install -e ".[dev]"         # Install with dev deps` Evidence: `CLAUDE.md` Claim: `clm_0012` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Needs admin / security approval
- **Why**: Continuing may involve secrets, accounts, external services, or sensitive context; get admin or security approval first.

### 30-Second Read

- **What to do now**: Needs admin / security approval
- **Minimum safe next step**: Run Prompt Preview first; if credentials or an enterprise environment are involved, get approval before trialing
- **Do not trust yet**: Tool permission boundaries cannot be trusted before install.
- **Continuing will touch**: Command execution, Host AI configuration, Local environment or project files

### What You Can Trust Now

- **Target-audience signal: Developers already using host AIs such as Claude/Codex/Cursor/Gemini** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `README.md` Claim: `clm_0002` supported 0.86
- **Capability exists: Command-Line Startup or Install Flow** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `CLAUDE.md`, `README.md` Claim: `clm_0001` supported 0.86
- **There are Quick Start / install-command signals** (supported): You can trust that the docs mention a startup or install entrypoint; do not run it directly in your primary environment because of that. Evidence: `README.md` Claim: `clm_0003` supported 0.86, `clm_0007` supported 0.86, `clm_0009` supported 0.86, `clm_0010` supported 0.86

### What You Cannot Trust Yet

- **Tool permission boundaries cannot be trusted before install.** (unverified): MCP/tool projects usually touch files, the network, the browser, or external APIs, so permissions and logs must be checked for real.
- **Real output quality cannot be trusted before install.** (unverified): Prompt Preview can only show how it guides you; it cannot prove result quality in the real project.
- **Host AI version compatibility cannot be trusted before install.** (unverified): Host loading rules and version differences across Claude, Cursor, Codex, Gemini, and others must be verified in a real environment.
- **That it will not pollute your existing host AI's behavior cannot be trusted directly.** (inferred): Skill, plugin, and AGENTS/CLAUDE/GEMINI instructions may change the host AI's default behavior. Evidence: `CLAUDE.md`
- **Safe rollback cannot be assumed by default.** (unverified): Unless the project clearly provides uninstall and recovery instructions, verify in an isolated environment first.
- **After a real install, is it compatible with the user's current host AI version?** (unverified): Compatibility can only be verified in the actual host environment.
- **Does the project's output quality meet the user's specific task?** (unverified): The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **Do the install commands require network access, permissions, or global writes?** (unverified): This affects install risk in both enterprise and personal environments. Evidence: `README.md`

### What Continuing Will Touch

- **Command execution**: Package managers, network downloads, the local plugin directory, project config, or the user's home directory. Why: Running the very first command can already change your environment; decide whether it is worth running first. Evidence: `CLAUDE.md`, `README.md`
- **Host AI configuration**: The plugin, Skill, or rule-loading config of hosts like Claude/Codex/Cursor/Gemini/OpenCode. Why: Host configuration changes how the AI works afterward and may conflict with the user's existing rules. Evidence: `CLAUDE.md`
- **Local environment or project files**: Install results, plugin caches, project config, or local dependency directories. Why: The write scope and rollback path cannot be proven before install and need isolated verification. Evidence: `CLAUDE.md`, `README.md`
- **Environment variables / API keys**: Project entry docs explicitly showing API key, token, secret, or account credential configuration. Why: If a real install needs credentials, use test credentials first and go through a permission/compliance review. Evidence: `README.md`
- **Host AI context**: The AI Context Pack, Prompt Preview, Skill routing, risk rules, and project facts. Why: Importing context affects the host AI's later judgment, so avoid packaging unverified items as facts.

### Minimum Safe Next Steps

- **Run Prompt Preview first**: Use a pre-install interactive trial to judge whether the way of working fits; it needs no authorization or environment change. (applies when: Applies to any project, especially when output quality is unknown.)
- **Trial-install only in an isolated directory or a test account**: Avoid letting install commands pollute your primary host AI, real projects, or home directory. (applies when: When there are signals of command execution, plugin config, or local writes.)
- **Back up your host AI configuration first**: Skill, plugin, and rule files may change the default behavior of Claude/Cursor/Codex. (applies when: When there is a plugin manifest, a Skill, or a host rule entrypoint.)
- **Do not use real production credentials**: Once an environment variable / API key enters the host or toolchain, it can create account and compliance risk. (applies when: When environment signals like API, TOKEN, KEY, or SECRET appear.)
- **After install, verify just one minimal task**: Verify loading, compatibility, output quality, and rollback first, then decide whether to use it deeply. (applies when: When moving from a trial into a real workflow.)

### Exit Plan

- **Preserve the pre-install state**: Record the original host config and project state so you can later judge whether it is recoverable.
- **Be ready to remove the host plugin / Skill / rule entrypoint**: If behavior is off after the trial install, you can restore the host AI to its pre-trial state.
- **Record the install commands and written paths**: Without clear uninstall instructions, you at least need to know which directories or configs to clean up manually.
- **Be ready to revoke test API keys or tokens**: If test credentials leak or are misused, you can cut losses quickly.
- **If there is no rollback path, do not enter your primary environment**: No rollback is a blocker before continuing; do not proceed on trust or luck.

## What Can Only Be Previewed

- Explain who the project fits and what it can do
- Demonstrate a typical conversation flow based on project docs
- Help the user decide whether it is worth installing or researching further

## What Must Be Verified After Install

- Actually installing the Skill, plugin, or CLI
- Running scripts, modifying local files, or accessing external services
- Verifying real output quality, performance, and compatibility

## Boundary & Risk Decision Card

- **Mistaking the pre-install preview for a real run**: The user may overestimate how much configuration, permission, and compatibility verification the project has already done. Mitigation: Clearly separate prompt_preview_can_do from runtime_required. Claim: `clm_0013` inferred 0.45
- **Command execution will modify the local environment**: Install commands may write to the user's home directory, the host plugin directory, or project configuration. Mitigation: Run in an isolated environment or a test account first. Evidence: `CLAUDE.md`, `README.md` Claim: `clm_0014` supported 0.86
- **To confirm**: After a real install, is it compatible with the user's current host AI version?. Why: Compatibility can only be verified in the actual host environment.
- **To confirm**: Does the project's output quality meet the user's specific task?. Why: The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **To confirm**: Do the install commands require network access, permissions, or global writes?. Why: This affects install risk in both enterprise and personal environments.

## Pre-Work Working Context

### Loading Order

- First read how_to_use.host_ai_instruction to establish the boundaries of this pre-install judgment asset.
- Read claim_graph_summary to confirm facts come from the Claim/Evidence Graph, not the Human Wiki narrative.
- Then read intended_users, capabilities, and quick_start_candidates to judge whether the user is a match.
- When you need to carry out a concrete task, check role_skill_index first, then evidence_index.
- For real install, file modification, network access, performance, or compatibility questions, turn to risk_card and boundaries.runtime_required.

### Task Routes

- **Command-Line Startup or Install Flow**: State that this is an after-install capability first, then give a pre-install checklist. Boundary: Must be verified after a real install or run. Evidence: `CLAUDE.md`, `README.md` Claim: `clm_0001` supported 0.86

### Context Scale

- Total files: 71
- Important-file coverage: 40/71
- Evidence index entries: 50
- Role / Skill entries: 9

### Handling Insufficient Evidence

- **missing_evidence**: State that evidence is insufficient and ask the user for the target file, a README section, or after-install verification records; do not fill in facts.
- **out_of_scope_request**: State that the task is beyond the current AI Context Pack's evidence scope and suggest the user check the Human Manual or verify after a real install.
- **runtime_request**: Provide a pre-install checklist and command sources, but do not run commands for the user or claim they have been run.
- **source_conflict**: Show the conflicting sources side by side, mark them as unverified, and do not force a single version.

## Prompt Recipes

### Fit assessment

- Goal: Judge whether this project fits the user's current task.
- Expected output: A fit conclusion, key reasons, evidence citations, what can be previewed before install, what must be verified after install, and a next-step recommendation.

```text
Based on the AI Context Pack for mnemon, ask me 3 necessary questions first, then judge whether it fits my task. The answer must cover: who it fits, what it can do, what it cannot do, whether it is worth installing, and where the evidence comes from. Every project fact must cite evidence_refs, source_paths, or a claim_id.
```

### Pre-install experience

- Goal: Let the user feel the core workflow before installing, while avoiding packaging the preview as real capability or a marketing promise.
- Expected output: An experience script with boundary labels, an after-install verification checklist, and a cautious recommendation; with no real-run promises or strong marketing language.

```text
Treat mnemon as a pre-install experience asset, not an already-installed tool or a real runtime environment.

Output exactly four parts:
1. Ask me 3 necessary questions first.
2. Give an "experience script": use the three labels [Previewable before install], [Must verify after install], and [Insufficient evidence] to show how it might guide the workflow.
3. Give an after-install verification checklist: list which capabilities can only be confirmed after a real install, real host loading, and a real project run.
4. Give a cautious recommendation: only "worth researching/trialing further", "add information before deciding", or "not recommended to continue"; do not endorse the project.

Hard boundaries:
- Do not claim you have installed, run, executed tests, modified files, or produced real results.
- Do not write promise-like phrasing such as "auto-adapts", "guarantees passing", "perfect fit", or "strongly recommend installing".
- If you describe how it works after install, you must use a conditional such as "if installed successfully and the host loads the Skill correctly, it might...".
- The experience script may only be written as "example lines / hypothetical flow": use "might ask / might suggest / might show", not "has written, has generated, has passed, is running, is generating".
- Prompt Preview does not hand out install commands; if the user is ready to trial, only prompt them to read Quick Start and the Risk Card first and to verify in an isolated environment.
- Every project fact must come from a supported claim, evidence_refs, or source_paths; inferred/unverified items can only be risks or open questions.

```

### Role / Skill selection

- Goal: Pick the best-matching asset from the project's roles or Skills.
- Expected output: A list of candidate roles or Skills, each with an applicable scenario, evidence paths, risk boundary, and whether after-install verification is needed.

```text
Read role_skill_index and recommend 3-5 of the most relevant roles or Skills for my target task. For each recommendation, state the applicable scenario, likely output, risk boundary, and evidence_refs.
```

### Risk pre-check

- Goal: Identify environment, permission, rule-conflict, and quality risks before installing or adopting.
- Expected output: A checklist of environment, permission, dependency, license, host-conflict, quality risk, and unknown items.

```text
Based on risk_card, boundaries, and quick_start_candidates, give me a pre-install risk pre-check list. Do not run commands for me; only explain what I should check, why, and what impact a failure would have.
```

### Host AI kickoff instruction

- Goal: Turn the project context into a host AI instruction for the start of a conversation.
- Expected output: A pre-work instruction with clear boundaries and clear evidence citations, suitable to copy to a host AI.

```text
Based on the AI Context Pack for mnemon, generate a pre-work instruction I can paste to my host AI. This instruction must obey not_runtime=true and must not claim the project has been installed, run, or produced real results.
```

## Role / Skill Index

- Indexed 9 role / Skill / project-doc entries.

- **mnemon** (project_doc): ! Status https://img.shields.io/badge/status-alpha-orange.svg https://github.com/nousergon/mnemon/issues ! Python https://img.shields.io/badge/python-3.10+-blue.svg https://www.python.org/downloads/ ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg LICENSE ! MCP https://img.shields.io/badge/MCP-compatible-blueviolet.svg https://modelcontextprotocol.io ! PyPI https://img.shields.io/pypi/v/mnemon-memo… Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `README.md`
- **bench/** (project_doc): Performance benchmarks for mnemon. Numbers here are indicative , not guarantees — they're recorded against a single development machine to catch regressions and inform marketing claims, not to set SLAs. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `bench/README.md`
- **Examples** (project_doc): Runnable scripts that demonstrate mnemon's public API directly, no MCP transport required. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `examples/README.md`
- **mnemon** (project_doc): Universal long-term memory layer for AI agents via MCP. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CLAUDE.md`
- **Contributing to mnemon** (project_doc): mnemon is in alpha. Bug reports, PRs, and design discussion are all welcome. Issues that reproduce on a fresh pip install get prioritized. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CONTRIBUTING.md`
- **mnemon — Architecture** (project_doc): A map of the codebase for readers and contributors. mnemon is two products in one codebase : a simple local memory vault zero accounts, single SQLite file, stdio MCP and an optional hosted web layer Fly-deployed remote MCP with OAuth, multi-device . The most important thing to understand: Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `ARCHITECTURE.md`
- **Changelog** (project_doc): External-readiness audit — no behavior changes, packaging/docs only. Bumped specifically because publish.yml is skip-existing , so the pyproject.toml metadata fixes below would never actually reach PyPI without a version bump. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CHANGELOG.md`
- **Contributor Covenant Code of Conduct** (project_doc): Contributor Covenant Code of Conduct Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CODE_OF_CONDUCT.md`
- **Security Policy** (project_doc): If you find a security vulnerability in mnemon, please report it privately: Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `SECURITY.md`

## Evidence Index

- Indexed 50 evidence entries.

- **mnemon** (documentation): ! Status https://img.shields.io/badge/status-alpha-orange.svg https://github.com/nousergon/mnemon/issues ! Python https://img.shields.io/badge/python-3.10+-blue.svg https://www.python.org/downloads/ ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg LICENSE ! MCP https://img.shields.io/badge/MCP-compatible-blueviolet.svg https://modelcontextprotocol.io ! PyPI https://img.shields.io/pypi/v/mnemon-memory.svg https://pypi.org/project/mnemon-memory/ ! Coverage https://img.shields.io/badge/coverage-90%25-brightgreen.svg https://github.com/nousergon/mnemon/actions/workflows/ci.yml Evidence: `README.md`
- **bench/** (documentation): Performance benchmarks for mnemon. Numbers here are indicative , not guarantees — they're recorded against a single development machine to catch regressions and inform marketing claims, not to set SLAs. Evidence: `bench/README.md`
- **Examples** (documentation): Runnable scripts that demonstrate mnemon's public API directly, no MCP transport required. Evidence: `examples/README.md`
- **mnemon** (documentation): Universal long-term memory layer for AI agents via MCP. Evidence: `CLAUDE.md`
- **Contributing to mnemon** (documentation): mnemon is in alpha. Bug reports, PRs, and design discussion are all welcome. Issues that reproduce on a fresh pip install get prioritized. Evidence: `CONTRIBUTING.md`
- **License** (source_file): Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Evidence: `LICENSE`
- **mnemon — Architecture** (documentation): A map of the codebase for readers and contributors. mnemon is two products in one codebase : a simple local memory vault zero accounts, single SQLite file, stdio MCP and an optional hosted web layer Fly-deployed remote MCP with OAuth, multi-device . The most important thing to understand: Evidence: `ARCHITECTURE.md`
- **Operator-side LLM-judge backend for scripts/build standing set.py** (source_file): build-system requires = "hatchling" build-backend = "hatchling.build" Evidence: `pyproject.toml`
- **Init** (source_file): version = "0.7.9" Evidence: `src/mnemon/__init__.py`
- **Api** (source_file): logger = logging.getLogger name ⋮---- default store: Store None = None ⋮---- def get default store - Store ⋮---- default store = Store ⋮---- def resolve store store: Store None - Store ⋮---- store = resolve store store results = search store, query, limit=limit, content type=content type ⋮---- def memory get id: int, , store: Store None = None - str ⋮---- doc = store.get id ⋮---- doc id = store.save ⋮---- doc = store.get doc id ⋮---- def memory forget id: int, , store: Store None = None - str ⋮---- ok = store.forget id ⋮---- def memory pin id: int, , store: Store None = None - str ⋮---- ok = store.pin id ⋮---- def memory status , store: Store None = None - str ⋮---- HANDLERS = { ⋮---- class… Evidence: `src/mnemon/api.py`
- **Server returns a human-facing confirmation line like** (source_file): def remote mode active - bool ⋮---- def main - None ⋮---- args = sys.argv 1: command = args 0 if args else "--help" ⋮---- app path = Path file .parent / "dashboard" / "app.py" port = args 1 if len args 1 else "8503" ⋮---- store = Store stats = store.status standing = store.standing tier status ⋮---- query = " ".join args 1: ⋮---- results = search store, query, limit=10 ⋮---- snippet = r.content :200 ellipsis = "..." if len r.content 200 else "" ⋮---- title = args 1 content = " ".join args 2: ⋮---- doc id = store.save title=title, content=content, source client="cli" ⋮---- doc = store.get doc id ⋮---- docs = store.timeline 10 000 embedded = 0 failed = 0 ⋮---- doc id = int args 1 ⋮---- apply… Evidence: `src/mnemon/cli.py`
- **First candidate's NLI failure → bail out entirely with the** (source_file): logger = logging.getLogger name ⋮---- UPDATE DECAY = 0.15 CONTRADICTION DECAY = 0.25 CONFIDENCE FLOOR = 0.2 ⋮---- VALID CLASSIFICATIONS = {"same", "update", "contradiction", "unrelated"} ⋮---- relationships: list dict = decayed = 0 ⋮---- query emb = embed f"title: {new title} text: {new content}" overlapping = store.search vector query emb, 5 ⋮---- candidates = ⋮---- premise = hypothesis = result = classify pair bidirectional premise, hypothesis classification = result.mnemon label ⋮---- First candidate's NLI failure → bail out entirely with the named-error path; subsequent candidates would fail identically singleton model load . Surfaces a clear "nli unavailable" flag for the caller to com… Evidence: `src/mnemon/contradiction.py`
- **.get defensively: an older remote e.g. a Fly app on a** (source_file): CONTENT TYPES = "All", "decision", "preference", "antipattern", "observation", "research", "project", "handoff", "note" ⋮---- query = st.text input "Search query", placeholder="e.g. deployment architecture" content type filter = st.selectbox "Filter by type", CONTENT TYPES ⋮---- ct = None if content type filter == "All" else content type filter ⋮---- results = load search query, limit=20, content type=ct ⋮---- .get defensively: an older remote e.g. a Fly app on a pre-recency score mnemon won't include every score field. fig = make score bars Evidence: `src/mnemon/dashboard/pages/1_Search.py`
- **Issuer must equal the deployment base — mismatches silently break** (source_file): PASS = "✓" FAIL = "✗" WARN = "⚠" ⋮---- HEALTH TIMEOUT SEC = 5.0 MCP TIMEOUT SEC = 15.0 ⋮---- @dataclass class CheckResult ⋮---- name: str ok: bool detail: str warn: bool = False ⋮---- def check remote url - CheckResult ⋮---- url = get remote url ⋮---- source = "env" if os.environ.get "MNEMON REMOTE URL" else f"file {REMOTE URL FILE}" ⋮---- def check local token - CheckResult ⋮---- token = get local token ⋮---- from env = bool os.environ.get "MNEMON LOCAL TOKEN" source = "env" if from env else f"file {LOCAL TOKEN FILE}" ⋮---- def check token file perms - CheckResult ⋮---- """Warn if the token is coming from a file that is group/world readable.""" ⋮---- mode = LOCAL TOKEN FILE.stat .st mode p… Evidence: `src/mnemon/doctor.py`
- **Step 2: sync pull S3 → local** (source_file): class DowngradeError Exception ⋮---- MNEMON DIR = Path.home / ".mnemon" REMOTE URL FILE = MNEMON DIR / "remote url" LOCAL TOKEN FILE = MNEMON DIR / "local token" ⋮---- def resolve remote url - str ⋮---- env = os.environ.get "MNEMON REMOTE URL", "" .strip ⋮---- content = REMOTE URL FILE.read text .strip ⋮---- def extract app name remote url: str - str None ⋮---- """Best-effort parse of a Fly app name from a remote URL. Matches https:// .fly.dev /... . Returns None for any URL that doesn't fit the Fly pattern — the user might be self-hosting on a custom domain, in which case we can't safely guess the app. """ m = re.match r"https?:// a-z0-9 -a-z0-9 {0,61} \.fly\.dev /. ?$", remote url ⋮---- d… Evidence: `src/mnemon/downgrade.py`
- **Embedder** (source_file): VECTOR DIM = 384 MODEL NAME = "BAAI/bge-small-en-v1.5" ⋮---- model = None ⋮---- def get model ⋮---- kwargs: dict = {"model name": MODEL NAME} cache dir = os.environ.get "FASTEMBED CACHE DIR" ⋮---- model = TextEmbedding kwargs ⋮---- def embed text: str - "np.ndarray" ⋮---- model = get model result = list model.embed text ⋮---- def embed batch texts: list str - list "np.ndarray" ⋮---- results = list model.embed texts ⋮---- def fragmentize title: str, content: str - list dict ⋮---- fragments = ⋮---- full text = f"title: {title} text: {content}" :2000 ⋮---- fragments = fragmentize title, content count = 0 ⋮---- emb = embed frag "text" Evidence: `src/mnemon/embedder.py`
- **Unexpected — could be RemoteMemoryClient HTTP failure,** (source_file): TOOLS TRIGGERING MIRROR = "Write", "Edit", "MultiEdit" ⋮---- def extract file path hook input: dict str, Any - str None ⋮---- tool name = hook input.get "tool name", "" ⋮---- tool input = hook input.get "tool input" ⋮---- file path = tool input.get "file path" ⋮---- def main - int ⋮---- hook input = read stdin ⋮---- file path = extract file path hook input ⋮---- result = mirror path Path file path , auto=True ⋮---- except Exception as exc: noqa: BLE001 — top-level surface Unexpected — could be RemoteMemoryClient HTTP failure, auth problem, dispatch error. Same posture: surface, never block. Exit 0 so the harness prints the stderr line back to Claude per feedback surface mnemon unreachable. Evidence: `src/mnemon/hooks/auto_mirror.py`
- **Context Surfacing** (source_file): TOKEN BUDGET = HOOK TOKEN BUDGET CHARS PER TOKEN = HOOK CHARS PER TOKEN CHAR BUDGET = HOOK CHAR BUDGET SLOW THRESHOLD SEC = HOOK SLOW THRESHOLD SEC SITUATIONAL MIN VECTOR SIMILARITY = HOOK SITUATIONAL MIN VECTOR SIMILARITY ⋮---- CLIENT LABEL = "claude-code-context-surfacing" ⋮---- SEARCH LIMIT = 12 ⋮---- SNIPPET CHARS = 300 ⋮---- def balance bold snippet: str - str ⋮---- last = snippet.rfind " " ⋮---- SPOTLIGHT INSTRUCTION = ⋮---- def standing tier enabled - bool ⋮---- env = os.environ.get "MNEMON STANDING TIER ENABLED", "" .strip .lower ⋮---- def fetch standing via mcp - str ⋮---- docs = json.loads raw ⋮---- lines: list str = ⋮---- title = defang control markup str d.get "title", "" conten… Evidence: `src/mnemon/hooks/context_surfacing.py`
- **Framework** (source_file): DEDUP WINDOW SEC = 600 ⋮---- NOISE PATTERNS = ⋮---- re.compile r"^ yn $", re.I , single letter confirmations ⋮---- def dedup path - Path ⋮---- def load and prune entries - tuple list dict , float ⋮---- now = time.time dedup file = dedup path entries: list dict = ⋮---- entries = json.loads dedup file.read text ⋮---- entries = entries = ⋮---- def is duplicate text: str - bool ⋮---- text hash = hashlib.sha256 text.encode .hexdigest ⋮---- def mark seen text: str - None ⋮---- def is noise prompt: str - bool ⋮---- trimmed = prompt.strip ⋮---- def read stdin - dict str, Any ⋮---- raw = sys.stdin.read ⋮---- def write output output: dict str, Any - None ⋮---- def log hook error hook name: str, conte… Evidence: `src/mnemon/hooks/framework.py`
- **── Filters & dedup ────────────────────────────────────────────────────────** (source_file): HANDOFF DEBOUNCE SEC = 600 ⋮---- SESSION STATE PATH = Path.home / ".mnemon" / "handoff session state.json" SESSION STATE PRUNE SEC = 86400 ⋮---- ── Filters & dedup ──────────────────────────────────────────────────────── ⋮---- Trivial / system-payload skip. Cheaper than LLM extraction so it runs first. ⋮---- Per-session debounce. Empty session id degrades to "always ⋮---- Try LLM generation first, fall back to regex Evidence: `src/mnemon/hooks/handoff_generator.py`
- **Layer 0: a span carrying host control-plane markup is captured** (source_file): EXTRACTION SYSTEM PROMPT = ⋮---- OBSERVATION RE = re.compile ⋮---- VALID TYPES = {"decision", "preference", "observation", "antipattern", "research", "project"} ⋮---- CLIENT LABEL = "claude-code-session-extractor" ⋮---- MIN OBSERVATION CHARS = 20 SENTENCE TERMINATORS = ".", "!" ⋮---- def is well shaped obs: dict - bool ⋮---- title = obs.get "title" or "" .strip content = obs.get "content" or "" .strip Layer 0: a span carrying host control-plane markup is captured harness scaffolding, not a memory. Reject it before it reaches the vault and gets replayed defanged-at-best into another client's context. Authoritative chokepoint — covers the LLM and regex paths and any future caller. See safety.… Evidence: `src/mnemon/hooks/session_extractor.py`
- **Generic mnemon auto-memory location:** (source_file): AUTO MEMORY PATTERNS = ⋮---- Generic mnemon auto-memory location: ~/.config/mnemon/auto-memory/ .md ⋮---- Frontmatter delimiter: --- on its own line at the start of the file. Matches the format Claude Code's auto-memory uses + standard YAML/Markdown frontmatter conventions. FRONTMATTER RE = re.compile ⋮---- Identity marker injected when a memory file is itself a sync-down from mnemon. The hook MUST skip these — re-mirroring would create an infinite write loop. The presence of this key in the frontmatter is load-bearing; future mnemon sync down paths should write it. SYNC SOURCE KEY = "mnemon sync source" ⋮---- class MirrorError Exception ⋮---- @dataclass class MirrorResult ⋮---- status: str… Evidence: `src/mnemon/mirror.py`
- **BM25 still serves results — but we need the cause visible so** (source_file): logger = logging.getLogger name ⋮---- @dataclass class ScoredResult ⋮---- doc id: int title: str content: str content type: str memory type: str confidence: float created at: str score: float source: str composite score: float = 0.0 recency score: float = 0.0 ⋮---- source client: str None = None ⋮---- vector similarity: float None = None ⋮---- def compute recency created at: str - float ⋮---- created = datetime.fromisoformat created at .replace tzinfo=timezone.utc age days = datetime.now timezone.utc - created .total seconds / 86400 ⋮---- age days = 365 ⋮---- def composite score result: SearchResult - ScoredResult ⋮---- recency = compute recency result.created at composite = w rel result.sc… Evidence: `src/mnemon/search.py`
- **Origins default to https:// versions of each host claude.ai connectors** (source_file): logger = logging.getLogger name ⋮---- def build transport security - TransportSecuritySettings None ⋮---- raw = os.environ.get "MNEMON ALLOWED HOSTS", "" .strip ⋮---- hosts = h.strip for h in raw.split "," if h.strip Origins default to https:// versions of each host claude.ai connectors use HTTPS exclusively . origins = f"https://{h}" for h in hosts ⋮---- mcp = FastMCP "mnemon", transport security= build transport security ⋮---- store: Store None = None ⋮---- def get store - Store ⋮---- store = Store ⋮---- store = get store results = search store, query, limit=limit, content type=content type ⋮---- @mcp.tool def memory get id: int - str ⋮---- doc = store.get id ⋮---- doc id = store.save ⋮--… Evidence: `src/mnemon/server.py`
- **Check env var first highest priority, matches remote client** (source_file): MNEMON DIR = Path.home / ".mnemon" LOCAL TOKEN FILE = MNEMON DIR / "local token" REMOTE URL FILE = MNEMON DIR / "remote url" ⋮---- REMOTE PREFLIGHT TIMEOUT SEC = 30.0 ⋮---- class SetupError Exception ⋮---- def python path - str ⋮---- def mcp config - dict ⋮---- def hooks config remote url: str None = None - dict ⋮---- py = python path user prompt hooks: list dict = ⋮---- base url = remote url.rstrip "/" ⋮---- base url = base url :-4 health url = f"{base url}/health" ⋮---- hooks: dict = { ⋮---- def read json path: Path - dict ⋮---- def write json path: Path, data: dict - None ⋮---- def ensure remote url remote url: str - str ⋮---- def ensure local token token: str None = None - str ⋮---- exi… Evidence: `src/mnemon/setup.py`
- **Chokepoint guard: opening the DEFAULT local vault while a remote is** (source_file): def capture attention enabled - bool ⋮---- env = os.environ.get "MNEMON CAPTURE ATTENTION ENABLED", "" .strip .lower ⋮---- class CaptureAttentionUnavailableError RuntimeError ⋮---- class StandingTierError ValueError ⋮---- class StandingTierCapReached StandingTierError ⋮---- class StandingTierProvenanceRejected StandingTierError ⋮---- @dataclass class Document ⋮---- id: int collection: str None path: str None title: str hash: str content type: str memory type: str confidence: float quality score: float access count: int pinned: int source client: str None invalidated at: str None invalidated by: int None created at: str updated at: str content: str = "" joined from content table ⋮---- @datac… Evidence: `src/mnemon/store.py`
- **Clean any stale snapshot from a prior run.** (source_file): S3 PREFIX DEFAULT = "mnemon/vaults" VAULT NAME DEFAULT = "default" ⋮---- def s3 bucket - str ⋮---- def s3 prefix - str ⋮---- def vault name - str ⋮---- def vault files - dict str, Path ⋮---- vdir = vault dir name = vault name ⋮---- def s3 path filename: str - str ⋮---- def run cmd cmd: str - tuple bool, str ⋮---- """Run a shell command. Returns success, output .""" result = subprocess.run cmd, shell=True, capture output=True, text=True ⋮---- def snapshot sqlite src path: Path, snap path: Path - str None ⋮---- """Produce an atomic consistent snapshot of a SQLite database via the online-backup API. SOTA primitive for "copy a SQLite database file safely while something else might be writing it… Evidence: `src/mnemon/sync.py`
- **3. Cursor.** (source_file): class UninstallError Exception ⋮---- MNEMON DIR DEFAULT = Path.home / ".mnemon" REMOTE URL FILE = MNEMON DIR DEFAULT / "remote url" ⋮---- def mnemon dir - Path ⋮---- override = os.environ.get "MNEMON VAULT DIR", "" .strip ⋮---- def claude desktop config path - Path ⋮---- """Same logic as setup. claude desktop config path — duplicated here to avoid a circular import and to keep uninstall self-contained.""" ⋮---- appdata = os.environ.get "APPDATA" ⋮---- def detect claude ai mnemon - bool ⋮---- out = subprocess.run ⋮---- def detect state - dict ⋮---- mdir = mnemon dir state = { ⋮---- def confirm prompt: str - bool ⋮---- def claude mcp remove - str None ⋮---- detail = out.stderr or out.stdout o… Evidence: `src/mnemon/uninstall.py`
- **── Deploy templates ─────────────────────────────────────────────────────────** (source_file): DEFAULT DEPLOY SETTLE SECONDS = 30 ⋮---- def settle after deploy - None ⋮---- raw = os.environ.get "MNEMON UPGRADE SETTLE SECONDS" ⋮---- seconds = DEFAULT DEPLOY SETTLE SECONDS ⋮---- seconds = max 0, int raw ⋮---- class UpgradeError Exception ⋮---- """Raised when upgrade cannot proceed. Message is user-facing.""" ⋮---- ── Deploy templates ───────────────────────────────────────────────────────── Embedded here rather than shipped as package data so pip install mnemon-memory users have everything they need without a repo clone. Both install mnemon-memory from PyPI rather than copying source — no build context beyond these two files is required. ⋮---- DOCKERFILE TEMPLATE = """\ ⋮---- def requi… Evidence: `src/mnemon/upgrade.py`
- **Cosine similarity: dot q, v / q v** (source_file): logger = logging.getLogger name ⋮---- class VecStore ⋮---- def init self, file path: str Path, dim: int = 384 ⋮---- def set self, vec id: str, embedding: np.ndarray - None ⋮---- embedding = np.asarray embedding, dtype=np.float32 ⋮---- idx = self. ids.index vec id ⋮---- def search self, query: np.ndarray, k: int = 20 - list dict ⋮---- """Find the top-k most similar vectors to the query.""" ⋮---- query = np.asarray query, dtype=np.float32 Cosine similarity: dot q, v / q v query norm = np.linalg.norm query ⋮---- vec norms = np.linalg.norm self. vectors, axis=1 Avoid division by zero nonzero = vec norms 0 similarities = np.zeros len self. ids ⋮---- top k = min k, len self. ids top indices = np.… Evidence: `src/mnemon/vecstore.py`
- **Changelog** (documentation): External-readiness audit — no behavior changes, packaging/docs only. Bumped specifically because publish.yml is skip-existing , so the pyproject.toml metadata fixes below would never actually reach PyPI without a version bump. Evidence: `CHANGELOG.md`
- **Contributor Covenant Code of Conduct** (documentation): Contributor Covenant Code of Conduct Evidence: `CODE_OF_CONDUCT.md`
- **Security Policy** (documentation): If you find a security vulnerability in mnemon, please report it privately: Evidence: `SECURITY.md`
- **Baseline 1K** (structured_config): { "memories": 1000, "queries": 50, "limit": 10, "seed": 42, "save total seconds": 0.1, "embed total seconds": 7.95, "search ms": { "mean": 3.23, "p50": 3.11, "p95": 3.88, "p99": 4.2, "max": 4.2 } } Evidence: `bench/baseline-1k.json`
- **.dockerignore** (source_file): .venv/ .git/ .pytest cache/ pycache / .egg-info/ dist/ build/ ts/ node modules/ .coverage .sqlite .vec.npz .gguf .DS Store .claude/ Evidence: `.dockerignore`
- **Python** (source_file): Python pycache / .py cod .egg-info/ dist/ build/ .venv/ .pytest cache/ pytest-of- / fastembed cache/ Evidence: `.gitignore`
- **False positives allowlisted by fingerprint commit:file:rule:line .** (source_file): False positives allowlisted by fingerprint commit:file:rule:line . Each entry should have a comment explaining why it's not a real secret. Evidence: `.gitleaksignore`
- **Install mnemon with server deps uvicorn, starlette, pyjwt crypto** (source_file): Install mnemon with server deps uvicorn, starlette, pyjwt crypto COPY . . RUN pip install --no-cache-dir ". server " Evidence: `Dockerfile`
- **Save phase. Time saving so we know how long building the corpus** (source_file): EXAMPLE VAULT = Path tempfile.mkdtemp prefix="mnemon-bench-" ⋮---- TEMPLATES = ⋮---- POOLS = { ⋮---- def generate corpus n: int, seed: int = 42 - list tuple str, str ⋮---- rng = random.Random seed out: list tuple str, str = ⋮---- template = rng.choice TEMPLATES ⋮---- filled = template ⋮---- placeholder = "{" + key + "}" ⋮---- filled = filled.replace placeholder, rng.choice POOLS key , 1 ⋮---- title = filled.split ". " 0 :60 + f" ⋮---- def quantile values: list float , q: float - float ⋮---- s = sorted values k = int round q len s - 1 ⋮---- def main - None parser = argparse.ArgumentParser ⋮---- args = parser.parse args ⋮---- corpus = generate corpus args.memories, seed=args.seed store = Stor… Evidence: `bench/search_stress.py`
- **Semantic query — none of these words appear in any saved memory,** (source_file): EXAMPLE VAULT = Path tempfile.mkdtemp prefix="mnemon-quickstart-" ⋮---- MEMORIES = ⋮---- def main - None ⋮---- store = Store ⋮---- doc id = store.save title=title, content=content ⋮---- except ImportError: ⋮---- Semantic query — none of these words appear in any saved memory, but the hybrid BM25+vector pipeline still surfaces the right one. ⋮---- Diagnostic query — covers the cold-start observation. Evidence: `examples/quickstart.py`
- **Fly.io deployment template for mnemon.** (source_file): Fly.io deployment template for mnemon. Setup: cp fly.toml.example fly.toml Edit the three REPLACE ME placeholders below, then: fly launch --copy-config --no-deploy creates the app, don't deploy yet fly volume create mnemon data --size 1 --region fly secrets set MNEMON LOCAL TOKEN=... MNEMON AS ENABLED=true MNEMON AS PASSPHRASE=... fly deploy See the "Self-host on Fly.io" section of README.md for the full runbook. Evidence: `fly.toml.example`
- **Layer3 Remote Helper** (source_file): def total documents - int ⋮---- data = json.loads result ⋮---- def save title: str, content: str, content type: str - str ⋮---- TOOLS EXERCISED ELSEWHERE = { ⋮---- DESTRUCTIVE TOOLS = { ⋮---- def exercise all tools - int ⋮---- timeline = json.loads timeline raw target id = timeline 0 "doc id" if timeline else 1 ⋮---- inputs = { ⋮---- registered = set mcp. tool manager. tools.keys to exercise = sorted ⋮---- failures: list tuple str, str, str = ⋮---- args = inputs.get tool name ⋮---- t0 = time.time ⋮---- n chars = len result if isinstance result, str else 0 ⋮---- def main - None ⋮---- cmd = sys.argv 1 Evidence: `scripts/_layer3_remote_helper.py`
- **Best-effort — a single failed call shouldn't abort the** (source_file): REPO ROOT = Path file .resolve .parent.parent ⋮---- CONSTRAINT EXEMPLARS = ⋮---- TIME BOUNDED EXEMPLARS = ⋮---- CORRECTION PATTERNS = ⋮---- W CONSTRAINT = 2.0 W CORRECTION = 2.0 W CONTRADICTION = 1.0 W BREADTH = 0.5 W TIME PENALTY = 1.5 ⋮---- DEFAULT TOP N = 10 HARD CEILING = 20 ⋮---- VAULT EXEMPLAR DEFAULT COUNT = 15 VAULT POSITIVE CONFIDENCE FLOOR = 0.80 ⋮---- JUDGE LLM ENV = "MNEMON JUDGE LLM" JUDGE LLM DEFAULT SPEC = "openrouter:deepseek/deepseek-v4-flash:floor" JUDGE LLM ANTHROPIC SPEC = "anthropic:claude-haiku-4-5-20251001" JUDGE MAX TOKENS = 300 ⋮---- JUDGE SFT SINK ENV = "MNEMON JUDGE SFT SINK" JUDGE RUBRIC DIMENSIONS = "generality", "durability", "imperative shape", "cross domain"… Evidence: `scripts/build_standing_set.py`
- **Pull live document ids + their content hash. We compare via** (source_file): REPO ROOT = Path file .resolve .parent.parent FIXTURE PATH = REPO ROOT / "tests" / "fixtures" / "capture attention pairs.json" FIXTURE EXAMPLE PATH = REPO ROOT / "tests" / "fixtures" / "capture attention pairs.example.json" DEFAULT DB = "/tmp/mnemon-prod-snap.sqlite" DEFAULT N = 20 THRESHOLDS = 0.70, 0.75, 0.80, 0.85, 0.90 ⋮---- def load pairs db path: Path, n: int - list dict ⋮---- src = REPO ROOT / "src" ⋮---- MIN PAIR COSINE = 0.55 ⋮---- MAX ATTEMPTS = max n 20, 200 ⋮---- vec path = str db path .replace ".sqlite", ".vec" ⋮---- vs = VecStore vec path, dim=384 db = sqlite3.connect db path ⋮---- Pull live document ids + their content hash. We compare via the indexed full-document fragment s… Evidence: `scripts/calibrate_capture_threshold.py`
- **persisted sessions total is kept for observability but NOT** (source_file): DEFAULT URL = "https://mnemon-memory.fly.dev/health" ⋮---- TTL SECONDS = 7 24 3600 PRUNE INTERVAL SECONDS = 6 3600 SESSION AGE WARN SECONDS = TTL SECONDS + 2 PRUNE INTERVAL SECONDS ⋮---- DECAY INTERVAL SECONDS = 24 3600 DECAY AGE WARN SECONDS = DECAY INTERVAL SECONDS + 12 3600 ⋮---- def fetch health url: str, timeout: float = 30.0 - dict ⋮---- req = urllib.request.Request url, headers={"User-Agent": "mnemon-health-monitor/1"} ⋮---- def main - int ⋮---- parser = argparse.ArgumentParser ⋮---- args = parser.parse args ⋮---- payload = fetch health args.url ⋮---- metrics = payload.get "metrics" ⋮---- failures: list str = warnings: list str = ⋮---- stale = metrics.get "stale session misses" ⋮----… Evidence: `scripts/check_health.py`
- **Mnemon Ops** (source_file): set -euo pipefail SCRIPT DIR="$ cd "$ dirname "${BASH SOURCE 0 }" " && pwd " REPO ROOT="$ cd "$SCRIPT DIR/.." && pwd " MNEMON VENV BIN="${MNEMON VENV BIN:-$REPO ROOT/.venv/bin}" APP NAME="${MNEMON FLY APP NAME:-mnemon-memory}" VAULT DIR="${MNEMON VAULT DIR:-$HOME/.mnemon}" LOCAL TOKEN FILE="$VAULT DIR/local token" CHANGELOG="$REPO ROOT/CHANGELOG.md" usage { sed -n '2,/^$/{s/^ \{0,1\}//;p;}' "${BASH SOURCE 0 }" } redact in stdout { : } cmd cleanup test apps { command -v flyctl /dev/null { echo "ERROR: flyctl not on PATH" &2; exit 2; } local apps apps=$ flyctl apps list 2 /dev/null awk '/^mnemon-test-/ {print $1}' true if -z "$apps" ; then echo "no dangling mnemon-test- apps" return 0 fi echo… Evidence: `scripts/mnemon_ops.sh`
- **---- helpers ----** (source_file): set -euo pipefail SCRIPT DIR="$ cd "$ dirname "${BASH SOURCE 0 }" " && pwd " REPO ROOT="$ cd "$SCRIPT DIR/.." && pwd " cd "$REPO ROOT" MNEMON VENV BIN="${MNEMON VENV BIN:-$REPO ROOT/.venv/bin}" -x "$MNEMON VENV BIN/mnemon" { echo "ERROR: mnemon CLI not found at $MNEMON VENV BIN/mnemon" &2; exit 1; } APP NAME="${MNEMON FLY APP NAME:-mnemon-memory}" STATE FILE="${MNEMON RESOAK STATE FILE:-$HOME/.mnemon/phase a resoak.state}" MIN SOAK DAYS="${MNEMON RESOAK MIN DAYS:-7}" BOOST RATE CEILING="${MNEMON RESOAK BOOST CEILING:-0.25}" echo step { printf "\n\033 1;34m== %s\033 0m\n" "$ "; } echo ok { printf "\033 1;32m ✓\033 0m %s\n" "$ "; } echo warn { printf "\033 1;33m ⚠\033 0m %s\n" "$ " &2; } echo… Evidence: `scripts/phase_a_resoak.sh`
- **Operator-overridable so CI / non-.venv setups can point at the** (source_file): set -euo pipefail SCRIPT DIR="$ cd "$ dirname "${BASH SOURCE 0 }" " && pwd " REPO ROOT="$ cd "$SCRIPT DIR/.." && pwd " cd "$REPO ROOT" echo step { printf "\n\033 1;34m== %s\033 0m\n" "$ "; } echo ok { printf "\033 1;32m ✓\033 0m %s\n" "$ "; } echo warn { printf "\033 1;33m ⚠\033 0m %s\n" "$ " &2; } echo err { printf "\033 1;31m ✗\033 0m %s\n" "$ " &2; } die { echo err "$ "; exit 1; } confirm { local prompt="$1" printf "\033 1;33m ? %s y/N \033 0m" "$prompt" local reply="" read -r reply "$reply" =~ ^ Yy $ die "aborted by operator" } TARGET VERSION="$ awk -F'"' '/^ version = /{print $2; exit}' src/mnemon/ init .py " -n "$TARGET VERSION" die "could not read version from src/mnemon/ init .py" O… Evidence: `scripts/promote_stable.sh`
- **Salience Phase0** (source_file): set -euo pipefail SCRIPT DIR="$ cd "$ dirname "${BASH SOURCE 0 }" " && pwd " REPO ROOT="$ cd "$SCRIPT DIR/.." && pwd " MNEMON VENV BIN="$REPO ROOT/.venv/bin" -x "$MNEMON VENV BIN/python" { echo "ERROR: $MNEMON VENV BIN/python not found — install editable venv first" &2; exit 1; } SNAPSHOT PATH="${SALIENCE SNAPSHOT PATH:-/tmp/mnemon-prod-snap.sqlite}" STANDING FILE="$HOME/.mnemon/standing.json" FLY APP="${MNEMON FLY APP:-mnemon-memory}" echo step { printf "\n\033 1;34m== %s\033 0m\n" "$ "; } echo ok { printf " \033 1;32m✓\033 0m %s\n" "$ "; } echo warn { printf " \033 1;33m⚠\033 0m %s\n" "$ " &2; } echo err { printf " \033 1;31m✗\033 0m %s\n" "$ " &2; } die { echo err "$ "; exit 1; } cmd sna… Evidence: `scripts/salience_phase0.sh`
- **Hard guard: never let the throwaway name collide with prod.** (source_file): set -euo pipefail PROD APP="mnemon-memory" REPO ROOT="$ cd "$ dirname "$0" /.." && pwd " MNEMON BIN="${MNEMON BIN:-$REPO ROOT/.venv/bin/mnemon}" S3 BUCKET="${MNEMON S3 BUCKET:-mnemon-memory}" DRY RUN=0 KEEP=0 APP NAME="" VERSION="" c ok { printf '\033 32m✓\033 0m %s\n' "$ "; } c info { printf ' %s\n' "$ "; } c warn { printf '\033 33m⚠\033 0m %s\n' "$ "; } c err { printf '\033 31m✗\033 0m %s\n' "$ " &2; } die { c err "$ "; exit 1; } usage { sed -n '2,30p' "$0" sed 's/^ \{0,1\} \{0,1\}//'; exit 0; } while $ case "$1" in --dry-run DRY RUN=1 ;; --keep KEEP=1 ;; --app-name APP NAME="${2:-}"; shift ;; --version VERSION="${2:-}"; shift ;; --help -h usage ;; die "unknown arg: $1 try --help " ;; esa… Evidence: `scripts/validate_cross_device.sh`

## Rules the Host AI Must Follow

- **Treat this asset as pre-work context, not a runtime environment.**: The AI Context Pack contains only an evidence-backed understanding of the project, not the project's executable state. Evidence: `README.md`, `bench/README.md`, `examples/README.md`
- **When answering the user, distinguish what can be previewed from what can only be verified after install.**: The consumer value of the pre-install experience comes from reducing bad installs and misjudgments, not from pretending to be a real run. Evidence: `README.md`, `bench/README.md`, `examples/README.md`

## Questions the User Should Answer First

- Which host AI or local environment do you plan to use it in?
- Do you just want to experience the workflow first, or are you ready to actually install?
- What matters most to you: install cost, output quality, or conflicts with your existing rules?

## Acceptance Checks

- Every capability claim can be traced back to a file path in evidence_refs.
- AI_CONTEXT_PACK.md does not package previews as a real run.
- The user can understand who it fits, what it can do, how to start, and the risk boundaries within 3 minutes.

---

## Doramagic Context Augmentation

The following sections strengthen the repository context for a host AI. Human Manual data is a reading route, and pitfall notes become operating constraints.

## Human Manual Outline

Usage rule: this is only a reading route and salience signal, not factual authority. Concrete claims must still return to repo evidence or Claim Graph.

Host AI hard rules:
- Do not treat page titles, section order, summaries, or importance values as factual project evidence.
- When explaining the Human Manual outline, state that it is only a reading route or salience signal.
- Capability, installation, compatibility, runtime state, and risk claims must cite repo evidence, source paths, or Claim Graph.

- **Overview & System Architecture**: importance `high`
  - source_paths: README.md, pyproject.toml, ARCHITECTURE.md, src/mnemon/__init__.py, src/mnemon/__main__.py
- **Core Features: MCP Tools, Memory Types, and Claude Code Hooks**: importance `high`
  - source_paths: src/mnemon/api.py, src/mnemon/cli.py, src/mnemon/hooks/framework.py, src/mnemon/hooks/context_surfacing.py, src/mnemon/hooks/session_extractor.py
- **Data Management, Search, and Intelligence Subsystems**: importance `high`
  - source_paths: src/mnemon/store.py, src/mnemon/search.py, src/mnemon/embedder.py, src/mnemon/vecstore.py, src/mnemon/mirror.py
- **Deployment, Operations, and Multi-Client Integration**: importance `high`
  - source_paths: src/mnemon/setup.py, src/mnemon/upgrade.py, src/mnemon/downgrade.py, src/mnemon/uninstall.py, src/mnemon/sync.py

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `811ad12cbea2ae6c942d15982a6fc5d91602cb9e`
- inspected_files: `Dockerfile`, `README.md`, `pyproject.toml`, `examples/README.md`, `examples/quickstart.py`, `src/mnemon/__init__.py`, `src/mnemon/__main__.py`, `src/mnemon/api.py`, `src/mnemon/auth.py`, `src/mnemon/cli.py`, `src/mnemon/config.py`, `src/mnemon/contradiction.py`, `src/mnemon/dashboard/__init__.py`, `src/mnemon/dashboard/app.py`, `src/mnemon/dashboard/charts.py`, `src/mnemon/dashboard/loaders.py`, `src/mnemon/dashboard/pages/1_Search.py`, `src/mnemon/dashboard/pages/2_Timeline.py`, `src/mnemon/dashboard/pages/3_Graph.py`, `src/mnemon/dashboard/pages/4_Profile.py`

Host AI hard rules:
- Without repo_clone_verified=true, do not claim that the source code has been read.
- Without repo_inspection_verified=true, do not write README, docs, or package-file conclusions as facts.
- Without quick_start_verified=true, do not claim that the Quick Start path has run successfully.

## Doramagic Pitfall Constraints

These rules come from Doramagic discovery, validation, or compilation findings. The host AI must treat them as operating constraints, not background notes.

### Constraint 1: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: 0.7.0rc6
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: 0.7.0rc6. Context: Observed when using python, docker
- Why it matters: Upgrade or migration may change expected behavior: 0.7.0rc6
- Evidence: failure_mode_cluster:github_release | https://github.com/nousergon/mnemon/releases/tag/v0.7.0rc6
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: Pre-existing ruff lint debt (66 errors) not caught by CI
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Pre-existing ruff lint debt (66 errors) not caught by CI. Context: Observed during installation or first-run setup.
- Why it matters: Developers may fail before the first successful local run: Pre-existing ruff lint debt (66 errors) not caught by CI
- Evidence: failure_mode_cluster:github_issue | https://github.com/nousergon/mnemon/issues/263
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: Uninstall message reword
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Uninstall message reword. Context: Observed during installation or first-run setup.
- Why it matters: Developers may fail before the first successful local run: Uninstall message reword
- Evidence: failure_mode_cluster:github_issue | https://github.com/nousergon/mnemon/issues/244
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: Verify multi-version Python (3.10/3.12/3.13) + matrix.os on self-hosted AL2023 runner before repointing ci.yml
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Verify multi-version Python (3.10/3.12/3.13) + matrix.os on self-hosted AL2023 runner before repointing ci.yml. Context: Observed when using python, docker, linux
- Why it matters: Developers may fail before the first successful local run: Verify multi-version Python (3.10/3.12/3.13) + matrix.os on self-hosted AL2023 runner before repointing ci.yml
- Evidence: failure_mode_cluster:github_issue | https://github.com/nousergon/mnemon/issues/272
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 5: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: v0.7.0rc3 — soak-substrate (test trio + coverage gate)
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.7.0rc3 — soak-substrate (test trio + coverage gate). Context: Observed when using python, docker
- Why it matters: Upgrade or migration may change expected behavior: v0.7.0rc3 — soak-substrate (test trio + coverage gate)
- Evidence: failure_mode_cluster:github_release | https://github.com/nousergon/mnemon/releases/tag/v0.7.0rc3
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 6: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: v0.7.6 — suspend-robust session hygiene
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.7.6 — suspend-robust session hygiene. Context: Observed when using python
- Why it matters: Upgrade or migration may change expected behavior: v0.7.6 — suspend-robust session hygiene
- Evidence: failure_mode_cluster:github_release | https://github.com/nousergon/mnemon/releases/tag/v0.7.6
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 7: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: v0.7.7 — prose supersession auto-detect
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.7.7 — prose supersession auto-detect. Context: Observed when using python
- Why it matters: Upgrade or migration may change expected behavior: v0.7.7 — prose supersession auto-detect
- Evidence: failure_mode_cluster:github_release | https://github.com/nousergon/mnemon/releases/tag/v0.7.7
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
