Cognitive Memory
Memory Types
Section titled “Memory Types”Inspired by cognitive science (Tulving’s taxonomy), YantrikDB supports four memory types:
| Type | What it stores | Example |
|---|---|---|
| Episodic | Events, experiences with context | ”User had a rough day at work on Feb 20” |
| Semantic | Facts, knowledge, abstractions | ”User is a software engineer who likes AI” |
| Procedural | Strategies, behaviors, what worked | ”User prefers concise answers with code examples” |
| Emotional | Valence-weighted memories | ”Dog’s death → high emotional weight → never forget” |
Memory Lifecycle
Section titled “Memory Lifecycle”Every memory goes through a lifecycle:
- Active — recently created or accessed, high importance
- Warm — moderate age, decaying importance
- Consolidation candidate — similar memories detected, ready to merge
- Consolidated — merged with related memories into a summary
- Archived — very old, low importance, compressed storage
- Tombstoned — explicitly forgotten or superseded
Temporal Decay
Section titled “Temporal Decay”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
Consolidation
Section titled “Consolidation”When multiple memories about the same topic accumulate, YantrikDB automatically:
- Clusters similar memories by embedding similarity
- Extracts a summary that captures the essential information
- Creates a consolidated memory with higher importance
- Tombstones the original fragments (preserving them for audit)
This mirrors how human memory works — individual episodes compress into general knowledge over time.
Contradiction Detection
Section titled “Contradiction Detection”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.