What the Cortex Does
Generate memory bulletin
Runs on a configurable interval (default 60 min). Uses
memory_recall to query across multiple dimensions (identity, events, decisions, preferences), synthesizes into a ~500 word briefing.Supervise running processes
Monitors channels, branches, and workers. Detects hanging workers, cleans up stale branches.
Maintain memory graph
Runs periodic maintenance: decay, pruning, merging near-duplicates, cross-channel consolidation.
Detect patterns
Observes system-wide activity. Creates observations from repeated behaviors, usage patterns.
Memory Bulletin Generation
The bulletin is cached inRuntimeConfig::memory_bulletin and read by every channel via ArcSwap:
Bulletin Prompt
memory_recall to query each dimension:
Bulletin Refresh Interval
Warmup System
The warmup system ensures agents are ready for work before serving requests:Warmup Workflow
Warmup begins
State:
Warming- Generate memory bulletin
- Preload embeddings
- Warm up database connections
Cold Dispatch Metrics
If a channel/worker/cron job starts before warmup completes, it’s recorded:Process Supervision
The cortex observes allProcessEvents:
Detecting Stuck Workers
Cleaning Up Stale Branches
Memory Maintenance
The cortex runs periodic memory maintenance:Decay
Reduce importance of old, unaccessed memories:Prune
Remove memories below importance threshold:Merge
Detect near-duplicate memories and consolidate:Cross-Channel Consolidation
If the same fact appears in multiple channels, consolidate:Pattern Detection
The cortex creates observations from repeated behaviors:Cortex Chat Interface
The cortex provides a direct admin chat for system inspection:memory_recall— Query memoriesmemory_save— Create memoriessystem_inspect— View running processeschannel_list— List all channelsworker_inspect— Inspect worker state
- Debugging memory issues
- Manually creating/updating memories
- Inspecting stuck workers
- Understanding agent state
Cortex Hook
The cortex uses a specialized hook for system observation:Bulletin Injection
Channels read the bulletin on every turn:Configuration
Best Practices
How often to refresh the bulletin
How often to refresh the bulletin
Frequent refresh (30-60 min):
- High-activity agents with rapid memory creation
- Many users creating memories
- You want channels to see new memories quickly
- Low-activity agents
- Single-user environments
- You want to minimize LLM calls
When to run memory maintenance
When to run memory maintenance
Daily maintenance:
- Most agents
- Balanced decay and pruning
- Low-memory-creation agents
- You want memories to persist longer
- High-churn environments
- Testing/development
How to tune decay and pruning
How to tune decay and pruning
Aggressive (forget faster):Conservative (remember longer):
Next Steps
Memory System
Learn how memories are stored and searched
Channels
See how channels use the memory bulletin
Compaction
Understand how compaction extracts memories
Configuration
Full cortex configuration reference