Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ™ MeMOXYDe

MemOry eXternal integrity sYstem for Data safEty

Your AI agent doesn't know when it's hallucinating its own memories. MeMOXYDe does.


The Problem

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.

How It Works

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.

Decision Matrix

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 ⚠️ Probable corruption Critical! Manual review + git recovery

Quick Start

# 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"

Example

$ 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

Claim Verification Layer (opt-in)

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?

The AI layer is always opt-in β€” even with a key

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)

Requirements

  • ANTHROPIC_API_KEY environment 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)

Use Case: Real Hallucination Caught Live

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.

Key Differentiator

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.

Stack

  • 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.

Status

🟒 v0.2-alpha β€” verify and check --ai escalation added

License

Apache 2.0 β€” Free to use, modify, and distribute, including in commercial products. Attribution required.


Built with 🎩 Dr.Spiccini

About

πŸ™ MemOry eXternal integrity sYstem for Data safEty β€” detect when AI agents hallucinate their own memories

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages