← BACK TO DOCS
SPECIFICATION · ANAMNESIS MEMORY LAYER

Anamnesis: The Verifiable Memory Layer for Physical AI

Anamnesis records what autonomous machines actually did in a strictly ordered, hash-chained ledger. Every epoch's root is anchored to AnamnesisAnchor on Robinhood Chain (Chain ID 4663) so any third party can verify inclusion and chain continuity without trusting HEPH's operator database alone.

1. Canonical Record Format & Hash Chain

Each record belongs to a single machine bytes32 ID and increments seq contiguously from 1. Payloads are canonicalized using RFC 8785 deterministic JSON and salted with a private 32-byte per-record salt before hashing.

payloadHash = keccak256(salt || canonicalJsonBytes)
sourceRef   = on-chain: keccak256(abi.encode(chainId, txHash, logIndex))
              off-chain: keccak256(utf8(requestId))
recordHash  = keccak256(abi.encode(version, machineId, seq, prevHash, timestamp, type, evidence, sourceRef, payloadHash))

Because seq = 1 binds prevHash = 0x00...00 and every subsequent record binds the previous recordHash, deleting or reordering any historical record invalidates all following hashes and Merkle roots.

2. Event Taxonomy & Evidence Levels

Event types 1–10 carry evidence = enforced (derived from indexed smart contract logs on Robinhood Chain or enforced backend/Sentinel policy evaluations). HEPH v1.7 Histor adds witness events: FIRMWARE_REPORTED and HEALTH_REPORT are attested (signed by the machine's own software witness key; HEPH checks signature, order and time, not the content), while key registrations and rejections are enforced. reported is reserved.

REGISTERED#1
POLICY_UPDATED#2
PAYMENT_SETTLED#3
PAYMENT_REJECTED#4
FROZEN#5
UNFROZEN#6
SENTINEL_TRIGGER#7
SWEPT#8
PASSPORT_SYNCED#9
CORRECTION#10
FIRMWARE_REPORTED#11
HEALTH_REPORT#12
WITNESS_KEY_REGISTERED#13
WITNESS_REJECTED#14

3. Two-Tier Merkle Tree & Urgent Freeze Anchoring

  • Per-Machine Tier: Leaves in an epoch for machine m are recordHash values folded with OpenZeppelin-compatible sorted-pair keccak256 into machineRoot.
  • Global Epoch Tier: Each machine contributes one leaf keccak256(abi.encode(machineId, fromSeq, toSeq, machineRoot, lastRecordHash)) folded into the global epochRoot.
  • Regular Cadence: Sealed hourly (or upon reaching 1,000 unanchored records).
  • Urgent SLA (≤ 60s): Any FROZEN, POLICY_UPDATED, or freeze-mode SENTINEL_TRIGGER event triggers an immediate epoch seal so critical safety events are committed on-chain within 60 seconds.

4. Honest Finality Progression & Crypto-Shredding

Every record tracks honest finality across four stages: Recorded → Anchored → Posted to Ethereum → Final. Under GDPR Article 17 / operator erasure, deleting a record's secret salt destroys the payload preimage and appends a CORRECTION record without breaking surrounding hash-chain or Merkle proofs.

5. Open-Source Verifier CLI & REST API

# Verify live from API + Robinhood Chain RPC
npx @heph/anamnesis verify --machine HEPH-REF-001 --api https://api.hephfleet.tech

# Verify offline from exported JSONL + saved roots
npx @heph/anamnesis verify --file heph-ref-001.jsonl --offline-roots roots.json

# REST endpoints
GET  /v1/memory/stats
GET  /v1/memory/roots
GET  /v1/memory/epochs/:epoch
GET  /v1/memory/:machineId?cursor=&limit=&type=
GET  /v1/memory/:machineId/:seq/proof
GET  /v1/memory/:machineId/export      # SIWE auth (raw payload + salts as JSONL)
OPEN INTERACTIVE VERIFIER →VIEW MACHINE PASSPORTS ↗
Disclosures: Robinhood Chain is a rollup at Stage 0; see L2BEAT for its trust assumptions. Designed to support machine logging requirements. Not legal advice.