← Back to the demo list
Episodic Memory Chains and Priority
EpisodicMemory_getChainPriorityStimulusSet · OR · FO

Tape of Episodes from the end: consecutive frames with a non-zero actionImageId form a tail suffix. If its length is ≥ EpisodicMemory_chainPriorityMinFrames (default 2), stimuli from these frames receive priority in OR and in the main FO loop.

Frame Tape (Scheme)
#k−3
Response ✓
#n−2
Response ✓
#n−1
Response ✓
#n
Response ✓

Tail: three consecutive reaction frames make the chain longer than the minimum; the priority set includes stimulusImageId and non-zero responseStimulusImageId of those frames.

Why the Minimum Is 2 Frames
One completed suffix frame with actionImageId is not enough: otherwise any single reaction episode would get priority without the meaningful “scenario link”. Two or more consecutive frames at the end indicate a stable chain of actions and replies.
Priority in OR and in FO
Orientation Reflex (findMostActualStimulus): for the priority candidate from the chain’s priority set, hysteresis is not subtracted relative to the previous winner; relevance is amplified (in code: scaling and shifting) so the EM scenario continuation does not lose to “random” active stimuli.
Main FO loop (stimuls_consciousness): for chain-priority stimuli, lowering multipliers are not applied (topic/situation mismatch, ImportantProblem); the interruption threshold for the current thinking matches “equal relevance” (coefficient 1.0). The OR winner is marked in context separately and is not cut off by the “thought silence” threshold.
Foreign Stimuli
A foreign active stimulus with no recorded reaction in the chain and not continuing the waiting-for-reply scenario should not “override” the development of the linked episode. Chain priority keeps attention on stimuli already included in the reaction tail, so the chain does not break due to foreign clicks.
In the chain (FinalImage A / response B) Foreign stimulus (not in the suffix)