Back to catalog

mnemosyne-semantic-audit

Audit Mnemosyne for conflicting or stale entries.

Category ๐Ÿง  MLOps
Version v1.0.0
mnemosynememoryauditcleanuphygiene

Mnemosyne Semantic Audit

Use when the user asks to audit, clean up, or check Mnemosyne memory for effectiveness. This is about semantic hygiene โ€” catching conflicting, stale, or misleading entries that reduce recall quality โ€” NOT about space/vacuuming.

When to Run

  • User asks to "audit memory" or "check for conflicts"
  • Monthly cron job (see mnemosyne-semantic-cleanup cron)
  • After major canonical changes or framework restructuring
  • When recall feels "off" or returns contradictory information

Audit Process

Step 1: Get Current State

mnemosyne_stats()

Note total working/episodic/canonical counts. High unconsolidated count may indicate noise.

Step 2: Search for Conflicts Across Topic Clusters

Use mnemosyne_recall with these queries (adapt to user's actual topics):

Cluster Query What to check
Family/People "Jerry age sons" Age conflicts, name spelling
Work role "[client] CTO role" Overlapping role descriptions
File paths "blog draft path directory" Path conflicts between canonical and working
Stale snapshots "wiki pages count" Point-in-time tool outputs still in working memory
Methodology "consulting methodology" Overlapping consulting prefs
Life domains "Joseph domains" Flat lists vs framework hierarchy

Step 3: Compare Tiers

For each cluster, compare:

  • Canonical (use mnemosyne_recall_canonical) โ€” source of truth
  • Working (from mnemosyne_recall) โ€” active memories
  • Episodic (from mnemosyne_recall) โ€” session snapshots

Flag:

1. Conflicts: Canonical contradicts working/episodic

2. Redundancies: Working memory duplicates canonical content

3. Stale snapshots: Point-in-time tool outputs (page counts, file lists) still in working memory

4. Misplaced entries: CTO-specific items in life-domains list, or vice versa

Step 4: Broad Sweep

mnemosyne_recall(query="*", sort="newest", limit=20)

Catch any emerging conflicts not covered by the topic clusters.

Step 5: Compile Report

Present findings as a table:

# Type Memory ID Content preview Recommended action
1 Conflict abc123 "Jerry age 14" vs canonical "age 16" Invalidate working
2 Redundancy def456 "Alan Weiss style" duplicates canonical Invalidate working
3 Stale ghi789 "Wiki: 63 pages" (Jul 31) Leave to decay
Do NOT auto-fix. Present for user review.

Fix Actions (After User Approval)

Invalidate Working/Episodic Memory

mnemosyne_batch(operations=[
    {"action": "invalidate", "memory_id": "<id>"}
])

Retire Canonical Entry

mnemosyne_forget_canonical(category="<cat>", name="<name>")

Create New Canonical

mnemosyne_batch(operations=[
    {"action": "remember", "content": "<text>", "importance": 0.9, 
     "scope": "global", "source": "preference", "veracity": "stated"}
])

Update Existing Canonical

mnemosyne_update(memory_id="<id>", content="<new text>")

Common Patterns

Pattern: "No need to X" โ†’ User wants X

If a canonical entry says "no need to do X" and the user later asks for X, the canonical is stale. Retire it with mnemosyne_forget_canonical.

Pattern: Framework Redundancy

If a master framework canonical (e.g., framework:operating-system) contains all sub-frameworks, and individual canonicals exist for each sub-framework (e.g., framework:action-opes, framework:insights-loop), retire the individual ones โ€” they're strict subsets.

Pattern: Flat List vs Hierarchy

If a working memory lists domains as a flat list (e.g., "AI/ML, Software, CTO, Faith, Health, Finance") but the canonical framework organizes them into buckets (WINS), invalidate the flat list โ€” it's redundant and doesn't reflect the hierarchy.

Pattern: Stale Point-in-Time Snapshots

Tool outputs like "Wiki at /opt/data/wiki: 63 pages" are snapshots from a specific date. Multiple versions accumulate (63, 125, 182, 257...). Only the latest is accurate. Leave older ones to decay naturally โ€” they'll lose recall priority as newer ones get recalled more.

Pattern: Alan Weiss / Methodology Scope

If a methodology entry is tied to a specific role (e.g., "Alan Weiss style at [client]") but applies broadly, create a standalone canonical (e.g., preference:consulting-methodology) and invalidate the role-specific working memory.

Pitfalls

  • Don't vacuum for space โ€” this is semantic hygiene, not storage cleanup
  • Don't auto-fix without approval โ€” always present findings first
  • Don't touch canonicals without explicit confirmation โ€” they're the source of truth
  • Don't confuse system prompt with memory โ€” the system prompt's USER PROFILE comes from $HERMES_HOME/memories/USER.md, not from Mnemosyne canonicals
  • Stale snapshots decay naturally โ€” don't aggressively clean episodic memories; they lose priority over time

User Profile vs Mnemosyne

The system prompt's "USER PROFILE" section is loaded from $HERMES_HOME/memories/USER.md (plain text, ยง-delimited). This is separate from Mnemosyne canonical entries. To fix stale info in the system prompt (like wrong ages), edit USER.md directly โ€” the snapshot is frozen at session load time.

For podman users: exec into the container or edit the mounted volume on the host.