Skip to content

Cognitive Memory

Inspired by cognitive science (Tulving’s taxonomy), YantrikDB supports four memory types:

TypeWhat it storesExample
EpisodicEvents, experiences with context”User had a rough day at work on Feb 20”
SemanticFacts, knowledge, abstractions”User is a software engineer who likes AI”
ProceduralStrategies, behaviors, what worked”User prefers concise answers with code examples”
EmotionalValence-weighted memories”Dog’s death → high emotional weight → never forget”

Every memory goes through a lifecycle:

  1. Active — recently created or accessed, high importance
  2. Warm — moderate age, decaying importance
  3. Consolidation candidate — similar memories detected, ready to merge
  4. Consolidated — merged with related memories into a summary
  5. Archived — very old, low importance, compressed storage
  6. Tombstoned — explicitly forgotten or superseded

Memories decay over time using a half-life model:

decay_score = importance * (0.5 ^ (elapsed / half_life))
  • High-importance memories decay slowly (long half-life)
  • Low-importance memories fade quickly
  • Accessing a memory reinforces it (spaced repetition)
  • Emotional valence modulates decay — emotionally significant memories persist longer

When multiple memories about the same topic accumulate, YantrikDB automatically:

  1. Clusters similar memories by embedding similarity
  2. Extracts a summary that captures the essential information
  3. Creates a consolidated memory with higher importance
  4. Tombstones the original fragments (preserving them for audit)

This mirrors how human memory works — individual episodes compress into general knowledge over time.

When YantrikDB detects conflicting memories (e.g., “user works at Google” vs “user works at Meta”), it creates a conflict segment:

  • Identity facts — flagged immediately (critical)
  • Preferences — resolved naturally in conversation
  • Temporal conflicts — prefer most recent, flag if uncertain
  • Minor contradictions — keep both, resolve lazily

Conflicts are resolved conversationally, not programmatically — the AI asks the user.