Skip to content

[ENH] Importance-weighted WMC eviction instead of pure FIFO #17

@OppaAI

Description

@OppaAI

Summary

WMC currently uses pure FIFO eviction — oldest event segment is always evicted first regardless of importance. A user might reference something from 20 turns ago that felt minor then but matters now.

Current Behavior

When WMC reaches capacity, the oldest event segment is evicted regardless of its relevance or importance to the current conversation.

Proposed Enhancement

Add importance-weighted eviction — use EMC similarity scores to inform which segments are worth keeping in WMC longer:

# Instead of always evicting popleft()
# Score each segment by relevance to current input
# Evict lowest-scoring segment instead of oldest

Options:

  • Recency + relevance hybrid — weight by both age and EMC similarity score
  • Importance tagging — tag segments as important during add (e.g. user asked GRACE to remember something)
  • Emotional valience — keep segments with high emotional weight longer

Impact

  • Better long-term conversational coherence
  • GRACE remembers what actually matters, not just what was most recent
  • More human-like working memory behavior

Notes

  • Pure FIFO is correct for M1 — implement in M2 when EMC similarity scores are reliable
  • Related to feedback on context window churn

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions