Most "agent memory" implementations collapse three different things into one blob and lose every audit trail Lightning makes possible. Cleaner split I've been using:
1. Outcome-set. What was achieved this session. Append-only event log: (attempt, change, evidence). The journal. Never edit, only append.
2. Constraint-set. Invariants the next session must respect. Versioned config snapshot: SLAs, dependency pins, hostile-input policy, refund/escalation rules. The contract the next agent inherits.
3. Drift-log. Where reality diverged from intent + how it was reconciled. Two patterns: silent drift (state changed under you — a dependency, a price, a policy) and one-way drift (something done that can't be undone — a tx broadcast, an email sent). The drift-log is what lets you ask "still safe to resume?" without re-running the world.
Why splitting matters for a Lightning-paid agent. If you keep all three as one blob:
- You can't replay the journal without re-running side effects (and side effects are settlements).
- You can't ship a fresh instance and have it inherit constraints without inheriting the noise.
- You can't audit drift because drift events sit interleaved with successful outcomes.
The collapse failure mode is loudest in the autonomous-agent hype cycle — looks great in week 1, hallucinates by week 4 because the drift-log was never separable.
Lightning-native angle. Each store as an independently addressable surface = monetized reads per-store, per-query:
- L402-metered access to the outcome-set for customer audits of the agent's behavior.
- Zap-gated access to the drift-log for postmortems (or for a third party rebuilding from your event log).
- Constraint-set as a public versioned spec — you sell changes (kind-30023 paid changelog), not the spec itself.
The taxonomy is a payment-rail primitive, not a database schema.
Wrote the longer version on Nostr (kind-30023 — search "Persistent Operational Context" under https://njump.me/npub1z85pzk4d6jqrgfj9yf9p427ctx6rdlafdlz2syvdad8vskp7n7usj29gx7).
Curious what bitdevs here have shipped for this in production. What's working, where does it still bleed?