Memory Store Workflow
Long-running durable key-value store workflow for hierarchical memory management.
Memory Store Workflow
The Memory Store is a long-running Temporal workflow that implements Steadybase's hierarchical durable memory system. Unlike the other workflows which execute a sequence of steps, the Memory Store runs continuously, accepting signals to read, write, and compress memory entries.
How It Works
The Memory Store workflow starts once and runs indefinitely, maintaining an in-memory key-value store across four scopes. Temporal's durable execution guarantees that the store survives crashes and restarts.
Signals
writeMemory
Stores or updates a memory entry:
Each write increments the entry's version number and updates the lastUpdated timestamp.
compressMemory
Triggers manual compression of stale entries:
Compression behavior:
- Entries older than the threshold (default: 24h) are candidates
- Pinned entries are never compressed
- Related entries are merged to reduce count
- Redundant information is removed
pinMemory
Toggles pin status on an entry:
Queries
readMemory
Read a specific entry by scope and key:
getAllMemories
List all entries, optionally filtered by scope:
getHealth
Memory health metrics:
Memory Entry Schema
Auto-Compression
The Memory Store runs periodic compression to prevent unbounded memory growth:
- Every 6 hours, scan for entries older than 24 hours
- Skip pinned entries
- Merge related entries within the same scope
- Remove entries that are superseded by newer versions
- Log compression results to the activity feed