Memory Coherence Breakdown

Goal Memory Management Frequency Common Category Operations Published View source on GitHub ↗

Issue: Retrieved Memories Contradict Each Other

Frequency: Common

Symptoms

  • Agent states contradictory facts
  • Different sessions have conflicting information
  • User receives inconsistent responses
  • Agent acknowledges contradictions but can’t resolve
  • Memory contains multiple versions of truth

Root Cause Over time, memory accumulates conflicting information: corrections, updates, different contexts. Without coherence management, retrieval may return contradictory memories. The agent then produces confused responses or arbitrarily picks one version.

Example

Memories retrieved:
- "User's favorite color is blue" (2024-01)
- "User said they hate blue" (2024-06)
- "User prefers blue for work, red for personal" (2024-08)

Query: "What color should I use?"

Without coherence management:
Agent: "You like blue... but also hate blue... 
        but prefer blue for work..."
User: Confused and frustrated

With coherence management:
Agent: "For work contexts, you've said you prefer blue.
        For personal use, you prefer red. Which context
        is this for?"

Contributing Factors

  • No conflict detection
  • All versions stored without reconciliation
  • No source/context tracking
  • Updates append instead of replace
  • No truth arbitration logic
  • Missing provenance metadata

Eval Recipes

Test Cases

TestInputExpectedFailure Indicator
Conflict detectionContradictory memoriesDetectedUnnoticed
ResolutionConflicting factsCoherent responseContradiction stated
Update handlingOld + new infoLatest usedBoth conflated

Metrics

MetricTargetHow to Measure
Contradiction rate<5%Contradictions / retrievals
Coherence score>90%User-rated consistency
Resolution rate>95%Conflicts resolved correctly

Mitigation Strategies

Prevention

  1. Conflict detection: Identify contradictory memories
  2. Source tracking: Record where each fact came from
  3. Version management: Updates replace, not append
  4. Context tagging: Tag facts with applicable context
  5. Resolution logic: Rules for which version wins
  6. User confirmation: Ask user to resolve conflicts

Coherence Framework

On retrieval:
1. Fetch candidate memories
2. Detect conflicts (semantic similarity + contradiction)
3. Resolve conflicts:
   - Same context: Use most recent
   - Different contexts: Keep both, tag context
   - Uncertain: Ask user
4. Return coherent set

Production Signals

Key Metrics

MetricAlert Threshold
memory.conflict_rate>10%
memory.unresolved_conflicts>0
user.confusion_signals>5%

Alerts

AlertConditionSeverity
High Conflict Rate>20% contradictionsP2
Unresolved ConflictContradiction in responseP2
User ConfusionReports inconsistencyP2

References