MH-FLOCKE MH-FLOCKE
HomeDocsGitHubBlogPaperYouTubeReddit𝕏

Episodic Memory

Sensomotor Episodic Memory

The creature records short sensor-motor-reward sequences as episodes, indexed by emotional valence (Damasio somatic markers). Important moments are preferentially retained.

Recording

Every 20 steps (fragment_length), accumulated sensor/motor/reward data is stored as an Episode. Emotionally significant episodes (high |valence| + arousal) survive eviction when memory fills up.

Recall

Similarity-based retrieval via cosine similarity on sensor patterns. Emotional bonus: high-valence episodes are slightly favored in recall. Retrieved motor patterns can prime SNN output neurons (top-down motor bias at 15% strength).

Consolidation

During dream phases, redundant episodes (similar pattern_hash) are deduplicated — only the most emotionally significant survives. Frequent patterns are extracted for synaptogenesis.

References

  • Tulving (1972). Episodic and semantic memory. Organization of Memory
  • Damasio (1994). Descartes’ Error. Putnam

API Reference

SensomotorMemory(max_episodes=500, fragment_length=20, n_sensors, n_motors)

record_step(sensors, motors, reward, valence, arousal)

Accumulate one step. Auto-stores fragment when buffer is full.

recall_similar(current_sensors, k=3) → list[Episode]

Top-k episodes by cosine similarity + emotional bonus.

recall_by_emotion(target_valence, k=3) → list[Episode]

Find episodes with similar emotional signature.

consolidate() → dict

Dream-phase deduplication. Returns consolidated, kept, frequent_patterns.

Episode

sensor_seq:   ndarray (T, n_sensors)
motor_seq:    ndarray (T, n_motors)
reward_seq:   ndarray (T,)
valence:      float  (-1 to +1)
total_reward: float