Expand description
Memory-Aware Retrieval System for Story 9
This module implements enhanced memory-aware retrieval with cognitive principles including recently consolidated memory boosting, reflection/insight inclusion, memory lineage tracking, query pattern caching, and performance optimizations.
§Cognitive Science Foundation
§Research Basis
- Strengthening Bias (Bjork & Bjork, 1992): Recently strengthened memories have enhanced retrieval
- Elaborative Processing (Craik & Lockhart, 1972): Deep processing creates retrievable cues
- Spreading Activation (Anderson, 1983): Related concepts activate each other
- Recognition Heuristic (Goldstein & Gigerenzer, 2002): Familiarity aids recall
- Memory Palace Effect (Yates, 1966): Structured relationships aid retrieval
§Key Features
§Recently Consolidated Memory Boosting
- 2x boost for memories with recent consolidation activity
- Exponential decay based on time since consolidation
- Consolidation strength weighting
§Reflection/Insight Integration
- Automatic inclusion of insight memories in search results
- Meta-memory identification and special scoring
- Cross-referenced with original source memories
§Memory Lineage Tracking
- 3-level depth traversal of memory relationships
- Parent-child memory chains
- Bidirectional relationship mapping
- Provenance metadata inclusion
§Query Pattern Caching
- Semantic hash-based cache keys
- Configurable TTL and invalidation policies
- LRU eviction with memory pressure awareness
- Cache hit ratio optimization
§Performance Optimizations
- Batch database operations
- Index-optimized queries
- Async result streaming
- P95 latency target: <200ms
Structs§
- Boost
Explanation - Explanation of score boosting applied
- Cache
Entry - Query cache entry
- Cache
Operation Metrics - Cache operation metrics
- Consolidation
Event - Consolidation event in memory history
- Enhanced
Retrieval Config - Configuration for memory-aware retrieval
- Memory
Ancestor - Ancestor memory in lineage chain
- Memory
Aware Retrieval Engine - Main memory-aware retrieval engine
- Memory
Aware Search Request - Enhanced search request with memory-aware features
- Memory
Aware Search Response - Enhanced search response with memory-aware features
- Memory
Aware Search Result - Enhanced search result with memory-aware features
- Memory
Descendant - Descendant memory in lineage chain
- Memory
Lineage - Memory lineage information
- Modification
Record - Modification record for provenance
- Performance
Metrics - Performance metrics for monitoring
- Provenance
Metadata - Provenance metadata for memory lineage
- Quality
Indicators - Quality indicators for memory assessment
- Query
Pattern Cache - Query pattern cache implementation
Enums§
- Relationship
Type - Types of memory relationships