MemOry eXternal integrity sYstem for Data safEty
Your AI agent doesn't know when it's hallucinating its own memories. MeMOXYDe does.
Every AI agent suffers from silent forgetting:
- Data gets lost during updates, but the agent says "everything's fine"
- Files get overwritten without the agent noticing
- Most critically: the agent hallucinates entire narrative artifacts to fill memory gaps
The agent believes what it generates β and keeps running on corrupted context.
MeMOXYDe is a two-layer integrity shield for agent memory:
| Layer | What | Purpose |
|---|---|---|
| Hash Map | Tracks SHA256 file signatures | Detects unauthorized byte-level changes |
| Content Snapshot | Exact-content comparison against last known-good state | Distinguishes whitespace-only edits from real content changes |
When both flag the same file β proven corruption. Not a false alarm. Not a legitimate edit. Recovery mode triggered.
Note: Content Snapshot is a byte-exact diff, not semantic analysis. For semantic claim verification, see
verify.
| Hash Flag | Snapshot Flag | Meaning | Action |
|---|---|---|---|
| β Clean | β Clean | All good | β |
| π Changed | β Clean | Legitimate edit | Auto-update hash |
| β Clean | π Changed | Whitespace/cosmetic edit | Snapshot resolves |
| π Changed | π Changed | Critical! Manual review + git recovery |
# Install (copy the script anywhere in your PATH)
wget -O /usr/local/bin/memoxyde https://raw.githubusercontent.com/NerinoZ/memoxyde/main/memoxyde.py
chmod +x /usr/local/bin/memoxyde
# Track your agent's memory files
memoxyde track MEMORY.md USER.md SOUL.md
# Check integrity (Layers 1+2 only, zero API calls)
memoxyde check
# Check + offer AI escalation if flags are found
memoxyde check --ai
# Verify a specific claim against tracked files (Layer 3, requires ANTHROPIC_API_KEY)
memoxyde verify "The user's name is Dee and they live in Rome"$ memoxyde check
π MeMOXYDe β Integrity Check
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
FILE HASH SNAPSHOT SEVERITY
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
/workspace/MEMORY.md β
β
β
OK
/workspace/USER.md β
β
β
OK
/workspace/SOUL.md β
β
β
OK
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
3 files Β· 0 flag(s) Β· 0 critical(s) Status: β
CLEAN
memoxyde verify is a semantic layer that checks whether an agent-generated statement is supported, contradicted, or absent in your hash-clean tracked files.
Unlike the Hash and Snapshot layers (which detect file changes), verify answers a different question: does this thing my agent just said actually exist in the trusted corpus?
Having ANTHROPIC_API_KEY set does not make MeMOXYDe call the API automatically. You are always in control:
memoxyde check β Layers 1+2 only. Zero API calls. Zero cost.
If flags found: prints a tip suggesting verify.
memoxyde check --ai β Layers 1+2, then asks:
"Flags detected. Escalate to AI layer? [y/N]"
Only calls API if you answer y.
memoxyde verify "..." β Layer 3 directly on a specific claim.
$ memoxyde verify "The agent heard Gloria but cannot see her"
π MeMOXYDe β Claim Verification
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
CLAIM: "The agent heard Gloria but cannot see her"
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Sources checked: 3 file(s) (MEMORY.md, USER.md, SOUL.md)
Model: claude-sonnet-4-5
Verifying...
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Verdict : β οΈ UNATTESTED
Evidence : No mention of "Gloria" in any tracked file.
Confidence : high
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Three possible verdicts:
- GROUNDED β explicit source found in tracked files
- CONTRADICTED β a tracked file explicitly says the opposite
- UNATTESTED β no source either way (the most insidious case β the agent treats it as true with zero backing)
ANTHROPIC_API_KEYenvironment variable (only for Layer 3)- Default model:
claude-sonnet-4-5 - Cheaper option:
--model haiku - Only verifies against hash-clean files (dirty files are excluded for safety)
On 22 June 2026, during a debugging session, the AI agent invented a person named "Gloria" β complete with role, backstory, and sensory details. No source on disk. No git history. Hardware-incompatible claim.
See PROVENANCE.md for the full story.
| Tool | Focus | Integrity Check |
|---|---|---|
| mem0, Zep, Letta | Fast memory storage & retrieval | β |
| Aegis Memory | External attack prevention (prompt injection) | πΆ HMAC only |
| SwarmVault, OMem | Personal knowledge management | β |
| MeMOXYDe | Internal hallucination detection | β Hash + Snapshot + AI Claim Verify |
Other tools protect agents from external attacks. MeMOXYDe protects agents from themselves.
- Python 3 β zero required external dependencies
- SHA256 β file integrity (Layer 1)
- Content diff β exact-content snapshot comparison (Layer 2)
- Anthropic API β semantic claim verification, always opt-in (Layer 3)
- JSON β state persistence
- No Docker, no vector DB, no cloud for Layers 1β2. Runs anywhere Python does.
π’ v0.2-alpha β verify and check --ai escalation added
Apache 2.0 β Free to use, modify, and distribute, including in commercial products. Attribution required.
Built with π© Dr.Spiccini