operations.ts, jobs.ts, items.ts, and runtime/src/temporal/memory.
Job types
runMemoryMaintenanceJob() supports five job types.
Jobs are stored in
memory_jobs with running, completed, or failed status.
Inline and Temporal execution
The low-leveljobs.ts runner executes maintenance inline. The Temporal service runs the same jobs through Temporal when execution: "temporal" is requested and Temporal is configured.
Temporal memory workflows send heartbeats, retry activities, support pause/resume signals, and continue-as-new during long consolidation batches.
Schedules
Memory schedules are managed through/api/memory/schedules.
The default overlap policy is
SKIP, except weekly per-agent archives use BUFFER_ONE.
Pattern extraction
extractExecutionPatterns() reads session_transcripts, extracts tool-call names, groups identical sequences, and stores frequent sequences as tool_sequence patterns.
skills document. Promotion creates a learned skill with a pattern trigger, the extracted tool list, and success metadata.
Archives
createMemoryArchive() serializes selected vector rows into a JSON payload, compresses the payload with gzip by default, and stores it in archives.
Archive rows contain:
syncArchiveToPinata() accepts PINATA_JWT or PINATA_API_KEY plus PINATA_API_SECRET.
Item lifecycle
The item APIs work againstmemory collection rows.
Soft-deleted and superseded rows are excluded by active-layer filters. Hard deletes remove the row permanently.
Cleanup
cleanupExpiredMemories() deletes:
After cleanup, the runtime invalidates memory caches globally.