Description
Before triggering the VLM/LLM reasoning layer, the pipeline must determine
whether a track is important enough to reason about.
Without this gate, the VLM would run on every frame and significantly slow
down the pipeline.
Implement:
should_trigger_reasoning(seq: TrackSequence) -> bool
inside:
services/memory/trigger.py
Requirements
Return True only when ALL conditions are satisfied:
-
Track is inside a restricted zone
-
Dwell time exceeds configured threshold
-
At least one suspicious action exists:
LINGERING
NEAR_KEYPAD
REPEATED_APPROACH
-
Track is not inside cooldown window
Additional Function
Also implement:
reset_cooldown(track_id: int)
to clear cooldown state after reasoning completes.
Constraints
- Pure in-memory logic only
- No Redis calls
- Cooldown duration: 5 seconds
- Thresholds should come from centralized settings
Acceptance Criteria
Helpful Context
Relevant modules:
services/memory/trigger.py
services/memory/pipeline.py
libs/schemas/memory.py
Description
Before triggering the VLM/LLM reasoning layer, the pipeline must determine
whether a track is important enough to reason about.
Without this gate, the VLM would run on every frame and significantly slow
down the pipeline.
Implement:
inside:
Requirements
Return
Trueonly when ALL conditions are satisfied:Track is inside a restricted zone
Dwell time exceeds configured threshold
At least one suspicious action exists:
LINGERINGNEAR_KEYPADREPEATED_APPROACHTrack is not inside cooldown window
Additional Function
Also implement:
to clear cooldown state after reasoning completes.
Constraints
Acceptance Criteria
Helpful Context
Relevant modules: