Module math_engine

Module math_engine 

Source
Expand description

Mathematical engine for memory consolidation and recall probability calculations.

This module implements the exact formulas for memory consolidation based on cognitive science research, including the forgetting curve and consolidation strength updates. All calculations are optimized for performance with batch processing capabilities and strict mathematical accuracy requirements.

§Formulas Implemented

§Forgetting Curve

p(t) = [1 - exp(-r * e^(-t/gn))] / (1 - e^(-1))

Where:

  • p(t) = recall probability at time t
  • r = decay rate (based on access patterns)
  • t = time since last access (normalized)
  • gn = consolidation strength

§Consolidation Strength Update

gn = gn-1 + (1 - e^(-t)) / (1 + e^(-t))

Where:

  • gn = new consolidation strength
  • gn-1 = previous consolidation strength
  • t = recall interval (hours)

§Performance Requirements

  • <10ms per memory calculation
  • Mathematical accuracy within 0.001 tolerance
  • Batch processing for multiple memories
  • Edge case handling for new/never-accessed memories

Modules§

benchmarks
Performance benchmarking utilities
constants
Mathematical constants and default values

Structs§

BatchProcessingResult
Result of batch processing operation
ConsolidationUpdateResult
Result of consolidation strength update
MathEngine
Main mathematical engine for memory consolidation calculations
MathEngineConfig
Configuration for mathematical calculations
MemoryParameters
Memory parameters for mathematical calculations
RecallCalculationResult
Result of recall probability calculation

Enums§

MathEngineError
Errors that can occur during mathematical calculations

Type Aliases§

Result