Memory Integrity

SAME doesn't just store knowledge — it tracks where that knowledge came from and tells you when it might be wrong.

← Back to home

The Problem: Stored Knowledge Goes Wrong

Memory tools store and retrieve. That's useful, but it ignores a fundamental problem: stored knowledge becomes wrong over time.

Most systems address this with recency decay — older notes rank lower. But recency is too blunt. A note from six months ago that references stable infrastructure is more reliable than a note from yesterday that references a file you just refactored.

What matters is not when a note was written, but what it depended on and whether those dependencies changed.

The Solution: Three Pillars of Memory Integrity

SAME tracks the relationship between your stored knowledge and the source material it was derived from. When sources change, SAME tells you which notes are affected and adjusts retrieval accordingly.

Pillar 1

Provenance Tracking

Every note can record its source files with SHA256 hashes at capture time.

  • save_note MCP tool accepts a sources parameter
  • Graph extraction auto-discovers file references
  • Hashes are computed at capture time, creating a snapshot of the source state
  • You always know: "this note was derived from auth.go at commit abc123"
Pillar 2

Trust State

Every note carries a trust state that reflects the integrity of its source material.

State Meaning
validated Source files haven't changed since capture
stale One or more source files have changed (hash mismatch)
contradicted Conflicting information detected
unknown No provenance data available

Run same health to see trust distribution across your vault: "18 validated · 2 stale · 3 unknown"

Pillar 3

Source Divergence Detection

SAME compares stored hashes against current files on disk. When a source file changes:

  • The note's trust state moves to stale
  • same health lists which specific files changed and when
  • Trust-aware retrieval ranks the note lower in search results
  • Context injection flags the note so your AI knows it may be outdated

Trust-Aware Retrieval

Search results factor in trust state. Notes with compromised provenance are automatically ranked lower, so your AI prioritizes trustworthy knowledge without any manual curation.

validated / unknown no penalty
stale -25% rank
contradicted -60% rank

Stale context doesn't poison decisions. The system self-corrects without human intervention.

In Practice

~/project — terminal
$ same health
 
◆ Memory Integrity
 
Trust: 18 validated · 2 stale · 3 unknown
Score: 87/100
 
Stale notes (source changed since capture):
auth-audit.mdauth.go changed 2 days ago
api-review.mdhandler.go changed yesterday

Two notes are flagged. Their source files changed after the notes were captured. You can review them, revalidate if they're still accurate, or let trust-aware retrieval handle it automatically — stale notes rank lower until the situation is resolved.

Why This Matters

An AI making decisions based on stale knowledge is worse than an AI with no knowledge. Wrong context is more dangerous than missing context.

Roadmap

Memory integrity is a layered problem. We're building it incrementally and being transparent about what exists today versus what's planned.

Phase 1
v0.12.0 — Shipped

Provenance capture via save_note sources parameter. Trust state tracking (validated, stale, contradicted, unknown). Health scoring with same health. Trust-aware retrieval with rank penalties. Source divergence detection via SHA256 hash comparison.

Phase 2
Next

Revalidation workflows. Contradiction detection. Provenance queries ("show me everything derived from this file").

Phase 3
Future

Transitive invalidation (if note A depends on note B, and B goes stale, A is affected too). Automatic revalidation triggers.

This is phase 1. The foundation is in place — provenance capture, trust state, health scoring, and trust-aware retrieval all work today in v0.12.0. The more ambitious features (transitive invalidation, automatic revalidation) are planned but not yet built. We'd rather ship a solid foundation than overpromise.

Try It

Memory integrity ships with SAME. Install it and run same health to see the trust state of your vault.

View on GitHub Read the docs → About SAME →