Skip to content

Memory System ​

The memory system enables persistent, contextual conversations by storing and retrieving relevant information about your interactions. Unlike traditional chat applications that forget everything between sessions, Iris builds a growing understanding of you over time.

Two Layers of Context ​

Iris uses two complementary systems for remembering what matters:

  1. Truths - Stable, core facts that are relevant across conversations. Your name, key relationships, and fundamental preferences. Truths are earned through behavioral evidence - memories that consistently prove useful get promoted automatically.

  2. Memories - Contextual information retrieved based on what you're currently discussing. Memories about cooking surface when you're planning dinner, not when you're debugging code.

This separation ensures Iris always knows the essentials while keeping context focused on what's relevant to the current conversation.

NOTE

Memories and Truths are stored globally across all threads — your preferences, relationships, and core facts are searchable regardless of which thread you're in. However, memory recall is thread-scoped: search queries are generated from the current thread's conversation, so the memories that surface are relevant to what you're discussing right now, not influenced by other threads. Thread-specific context (conversation history, summaries) is handled by the thread system.

Memory Retrieval ​

When you send a message, Iris retrieves relevant context through semantic search:

  1. Query Generation: An LLM analyzes recent conversation turns from the current thread and generates up to four search queries. If it fails or returns nothing, Iris searches with your message instead.
  2. Vector Search: Iris embeds all queries in one request and compares them against your full memory pool using cosine similarity. Each query returns its closest matches above the similarity threshold (default: 0.38).
  3. Merging: When several queries find the same memory, Iris keeps it once, with its best similarity.
  4. Ranking: Iris scores the candidates with the composite formula below and includes the top memory.max_results (default: 7) in context.

Query generation is thread-scoped — only conversation turns from the active thread inform what to search for. The search itself runs against all your memories globally. This means if you're discussing a recipe in one thread, cooking memories surface there without being influenced by a debugging conversation in another thread.

Memory Types ​

TypeDescription
factObjective information about the user
preferenceLikes, dislikes, and preferences
goalThings the user wants to achieve
eventPast or upcoming events
skillCapabilities and expertise
relationshipPeople and relationships
habitRegular behaviors and routines
contextSituational information

Scoring ​

Memories are ranked by a composite score that balances multiple factors:

score = (semantic × 0.60) + (recency × 0.25) + (frequency × 0.0) + type bonus

Score Components ​

ComponentDefault weightWhat it measures
Semantic similarity0.60How closely the memory relates to the current conversation: its best cosine similarity across the recall queries
Recency0.25How recently the memory was created, decaying linearly from 1 to 0 over 90 days
Frequency0.0 (off)How often the memory has been included in context, saturating at 10 inclusions

Only the ratios between weights affect ordering.

NOTE

Frequency is off by default. Access counts record what earlier rankings chose, so weighting them feeds past selections back into future ones. In a blind-graded replay of real conversations, turning it off added about half a useful memory per recall. You can turn it back on with memory.scoring.frequency.

Access Tracking ​

A memory's access_count and last_accessed_at change only when the memory lands in the context for a message, or when the search_memory tool returns it. Candidates that get ranked out don't count, and retrying a message doesn't count the same memories twice. Access counts feed truth promotion, even though they no longer affect ranking by default.

Type Bonuses ​

Certain memory types receive score bonuses because they tend to be more relevant:

  • Relationships: +0.10 (people you know are often contextually important)
  • Preferences and goals: +0.05 (these shape how Iris should respond)
  • Events: +0.10 if the memory was created in the last 7 days, otherwise no bonus

Example Scoring ​

Consider a preference memory: "Prefers morning meetings before 10am", created 30 days ago.

If you ask "When should we schedule our call?":

  • Semantic similarity might be 0.85 (highly relevant)
  • Recency: ~0.67 (30 of 90 days elapsed)
  • Frequency: weighted at 0, so it doesn't contribute

Raw score: (0.85 × 0.60) + (0.67 × 0.25) = 0.68

With the preference bonus (+0.05): 0.73

Configuration ​

SettingDefaultDescription
memory.max_results7Maximum memories to include from semantic search
memory.similarity_threshold0.38Minimum similarity score to include a memory
memory.max_queries4Maximum search queries generated per message
memory.context_turns20Recent turns from the thread used to generate search queries
memory.scoring.semantic0.60Weight for semantic similarity
memory.scoring.recency0.25Weight for recency
memory.scoring.frequency0.0Weight for access frequency (off by default)
memory.scoring.recency_window_days90Age at which the recency score reaches zero
memory.scoring.frequency_saturation10Access count at which the frequency score maxes out
memory.scoring.type_bonusesrelationship 0.10, preference 0.05, goal 0.05Flat bonus per memory type
memory.scoring.recent_event_bonus0.10Bonus for events created within recent_event_days
memory.scoring.recent_event_days7How recent an event has to be to get the bonus

TIP

If memories seem stale or irrelevant, adjust the scoring weights in config. Increase recency to prioritize recent memories, or semantic to prioritize relevance.

When Recall Fails ​

Recall depends on two provider calls: the LLM that generates search queries and the embeddings API. A failed query generation falls back to searching with your message. If embedding fails (a provider outage, a rate limit, or an exhausted credit balance), recall can't run at all for that message.

When that happens, Iris still answers, and two things make the gap visible:

  • Iris knows. Its context for that turn says memory recall failed, so it doesn't treat the missing memories as missing history or ask you to re-explain things you've already told it.
  • You see it. An amber warning appears under your message in the chat, and it stays there after a reload.

NOTE

Prism reports an exhausted OpenAI credit balance the same way as a rate limit, so the warning can't tell those two apart. If warnings keep appearing, check your embeddings provider's billing first.

How Memories Are Created ​

  1. Automatic Extraction - Background job analyzes conversations and extracts memorable facts
  2. Consolidation - Similar memories are merged nightly, with generation tracking to enable organic memory evolution
  3. Promotion to Truths - Frequently accessed memories can be promoted to Truths through distillation
  4. Manual Tools - Iris can store, update, or delete memories directly during conversation

Viewing Memories ​

The Memories page in the UI shows all your memories with filtering and search. Consolidated memories display their generation level (e.g., "Merged Gen 2") to show how many times they've been consolidated. The Insights page includes consolidation statistics in the Memory Insights panel.

Troubleshooting Memory Retrieval ​

Memories not surfacing ​

If relevant memories aren't appearing in conversations:

  1. Check the similarity threshold - The default (0.38) is fairly permissive. If memories still aren't surfacing, the search queries may not match well. Try rephrasing your question to use similar language to how the memory is stored.

  2. Verify memories exist - Check the Memories page to confirm the information was actually stored.

  3. Check if it should be a Truth - If a memory is important enough to surface in most conversations, it might be better suited as a Truth. Create it manually or wait for distillation to promote it.

Too many irrelevant memories ​

If Iris seems to include memories that aren't helpful:

  1. Raise the similarity threshold - Increase memory.similarity_threshold in config to be more selective.

  2. Reduce max results - Lower memory.max_results to include fewer total memories.

Stale memories dominating ​

If old memories keep appearing over newer, more relevant ones:

  1. Increase recency weight - Raise memory.scoring.recency above its default of 0.25 to prioritize recent memories.

  2. Let consolidation run - Consolidation merges similar memories, which can help surface the most current version of information.

  3. Update outdated memories - Use the update_memory tool to correct information rather than creating new memories.