Skip to content

research(memory): write-time importance scoring for improved memory retrieval #2021

@bug-ops

Description

@bug-ops

Source

MemOS: A Memory OS for AI Systems (arxiv 2507.03724 / EMNLP 2025 oral)
Cross-attention memory retrieval with importance weighting (Frontiers 2025)

Core Idea

Assign an explicit importance score to each memory entry at write time, combining:

  • Recency: how recently was this memory written
  • Reference frequency: how many times has this memory been recalled
  • Explicit salience: is the content emotionally/task-relevant (keyword heuristic or LLM score)

This "heat score" then weights the vector similarity score at retrieval time, so frequently-referenced or explicitly important memories surface higher than stale ones with similar embeddings.

Current Zeph Gap

Zeph uses temporal decay and MMR re-ranking, but lacks a persistent importance signal written at memory save time. Current retrieval ranking:

  • Vector similarity (0.7 weight) + keyword match (0.3 weight)
  • Temporal decay applied post-retrieval
  • MMR lambda applied for diversity

What's missing: a reference count that increments each time a memory is recalled (positive signal), and an importance flag set at write time for high-salience content (e.g., user preferences, explicit instructions, key facts).

Implementation Sketch

Schema: add importance_score REAL DEFAULT 0.5 and recall_count INTEGER DEFAULT 0 columns to the memories table (additive SQLite migration, backward-compatible).

Increment recall_count each time a memory is returned by recall(). Compute importance at write time: combine content length (proxy for information density), explicit markers ("remember:", "important:", "always:"), and user feedback signal if available.

Blend into final retrieval score: final = alpha * vector_sim + beta * keyword + gamma * importance + decay

Complexity

Low-Medium. Schema migration is additive (new columns with defaults, no breaking changes). Scoring logic is pure Rust, no new dependencies. Retrieval formula tweak in recall_merge_and_rank() in zeph-memory.

Expected Benefit

  • Higher-quality memory recall for frequently-referenced context
  • User preferences and explicit instructions surface reliably
  • Reduces retrieval noise from stale/irrelevant memories with coincidentally high embedding similarity

See Also

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2High value, medium complexitymemoryzeph-memory crate (SQLite)researchResearch-driven improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions