Skip to content

Background Jobs

Iris processes memory extraction, conversation summarization, and memory consolidation in the background so your chat experience stays fast and responsive. Here's how the pieces fit together.

Automatic Jobs

These jobs dispatch automatically after Iris processes a response, based on configurable thresholds.

ExtractMemories

Pulls meaningful information from recent conversations and stores it as searchable memories with embeddings.

SettingDefaultDescription
TriggerEvery 10 messagesConfigurable via iris.extraction.threshold
Max per run6 memoriesPrevents over-extraction from a single batch

The job builds context from up to 50 recent messages, uses an LLM to identify what's worth remembering, then creates memory records with vector embeddings for semantic search.

SummarizeConversation

Creates narrative summaries of older conversations, capturing emotional context and relationship dynamics.

SettingDefaultDescription
Trigger40+ unsummarized messagesAfter keeping 35 recent messages as buffer

Summaries chain together via previous_summary_id, maintaining conversational continuity across sessions. Each summary includes emotional markers, resolved/unresolved threads, and relationship dynamics.

Memory Consolidation

Consolidation merges semantically similar memories into denser, more useful representations. It runs on two schedules:

  • Daily (3 AM) — Processes memories from the last 3 days
  • Weekly (Sunday 4 AM) — Full sweep of all memories

See Memory Consolidation for the full details on how it works, generation tracking, and command options.

Configuration

Key settings in config/iris.php:

php
'extraction' => [
    'threshold' => 10,        // Messages between extractions
    'max_per_extraction' => 6 // Max memories per run
],

'summarization' => [
    'threshold' => 40,        // Unsummarized messages to trigger
    'buffer' => 35            // Recent messages to keep unsummarized
],

Monitoring

bash
# Watch job activity in real-time
php artisan pail

# View failed jobs
php artisan queue:failed

# Retry failed jobs
php artisan queue:retry all

For development, composer dev runs the queue worker alongside everything else.