ZEROlobby
22/22 strict⌘Kvisitor
skip to main
ADR-032
skin
——:——:——zcovenant · audit
memory· @zero/memory · 5 strata · 2 backends · 1 provider

an agent remembers in five layers, locally

spec part 4 names a five-stratum memory architecture every agent surface should support. ZERO ships it in @zero/memory: five strongly-typed slices, two backends (localStorage and in-memory), and a React provider with five strata-scoped hooks. article I.4 makes the default local-first · no transport, no telemetry, no opt-out required because nothing leaves the tab.

00 · liveuseMemorySnapshot() · localStorage · zero.memory.v1 · 5 strata

your own memory · edit it now · see it persist

memory · live· localStorage · zero.memory.v1 · 0 keys across 5 strata · last surface · empty
01 · identity
— · empty
02 · preference
— · empty
skin · live retintdensitymotion tierlocale
03 · navigation
— · empty
written automatically by RootProviders.MemoryBridge on every page load
04 · workingTask
— · empty
05 · learning
— · empty
01 · five stratathe canonical contract · same names across every agent surface

identity · preference · navigation · workingTask · learning

plate · A · MemoryShape · per-stratum scopecanonical
metric
memory
unit
strata
window
static · demo
agg
identity
source
packages/memory/src/types.ts
fresh
last build
stratumscopepersistenceexample field
identityoperator facts that never change · handle, brand role, public keypersist forever · operator-controlledhandle · brandRole
preferenceoperator settings shaping rendering · skin, density, motion tierpersist forever · operator-controlledskin · motionTier
navigationrecent surfaces · cursor · last chapterper-tab · transient is acceptablelastChapter · visitedChapters[]
workingTaskcurrently-active goal · in-flight steps · collected referencesper-session · cleared on completiongoal · steps[]
learningdistilled lessons · heuristics · refused-pattern hitspersist · summarised by future ADRheuristics[] · refusedPatterns[]
why five and not eight
eight strata is overspecified for a brand-system contract. four is underspecified — there is no place to put learned heuristics. five maps to the GAIN-spec's reference architecture and to every agent SDK that ships a memory hook today. each stratum has its own React hook (useIdentity, usePreference,useNavigation, useWorkingTask, useLearning) so subscriptions stay scoped.
02 · shapeMemoryShape · rendered with demo data

every stratum carries a typed receipt

plate · B · identity · operator factsnever changes
handle
operator-0
brand role
operator
pubkey
◆ b39e02 5f1c 9a02 ee87
joined
2026-01-08
plate · C · preference · render shapeoperator picks
skin
signature
density
compact
motion tier
full
locale
en-US
ambient tier
A
plate · D · navigation · per-tab cursortransient ok
last chapter
/agent-stream
last surface
/floor
visited
3 chapters
  • 00:14:08z · /agent-context
  • 00:14:14z · /agent-stream
  • 00:14:21z · /memory
plate · E · workingTask · current goalcleared on done
goal
reduce sol-perp short · 0.7x → 0.4x · paper
started
00:13:51z
steps
4 steps
references
2 refs
  • observe · book + funding skew
  • decide · reduce
  • event · stop replaced
  • · refuse · doge-perp
plate · F · learning · distilled wisdompersistent
heuristics
3 rules
refused patterns
3 patterns
  • w 0.91 · doge-perp · funding above 0.04 · always refuse
  • w 0.84 · sol-perp · short · respect drawdown gate strictly
  • w 0.72 · after 3 consecutive refusals · pause for 5 min · cooler
02b · ttls · adr-085documented ttl per stratum · runtime memory honors these

some strata expire · others persist forever

plate · G0 · MEMORY_TTLS · documented per-stratum lifetimesadr-085
metric
memory
unit
strata
window
static · demo
agg
identity
source
packages/memory/src/types.ts
fresh
last build
stratumttlrationale
identity∞ · operator-controlledoperator facts that never change
preference∞ · operator-controlledoperator picks · persists until changed
navigation1 hcursor goes stale fast · 1h is enough
workingTask24 hcleared on completion · 24h backstop
learning∞ · operator-controlleddistilled wisdom · garbage-collected by future ADR
advisory · not destructive
ttls are honored by the runtime memory's tail() read, which returns an empty stratum past the ttl. get()still reads the underlying value · stale rows stay on disk for inspection until the operator (or a future garbage-collection ADR) compacts the file.
03 · backendsLocalStorageBackend (default) · InMemoryBackend (test)

two backends · one interface

plate · G · MemoryBackend · two implementationsstrict equal interface
metric
memory
unit
strata
window
static · demo
agg
identity
source
packages/memory/src/backend.ts
fresh
last build
backendpersistencescopeSSRprivacy posture
LocalStorageBackendbrowser localStorage · per-origin · per-keytab + restoreSSR-safe (returns EMPTY_MEMORY on the server)local-first · article I.4 default
InMemoryBackendnone · process-lifetime onlythis renderfully SSR-safestrictest · zero persistence by construction
04 · article I.4local-first by default · the privacy article

memory does not become telemetry

how the constitution shapes this package
article I.4 names US and Ontario operators refused, and names ZERO telemetry-spare by design. @zero/memory ships with no transport, no key-rotation hooks, no sync API. a future ADR will land server-side sync as opt-in transport with consent receipts; today the default is the strictest available posture — every byte stays in the operator's tab.
plate · H · memory · privacy posturesigned
metric
memory
unit
strata
window
static · demo
agg
identity
source
article I.4 · CONSTITUTION.md
fresh
last build
transport
none
identifiers
0
cookies
0
cross-tab sync
0
default backend
local-storage
local-firstsigned◆ mem001a