detect_chains
Analyzes observation logs to identify and record recurring sequential patterns between tools, enabling automated learning of behavioral chains based on repeated usage patterns.
Instructions
Mine the observation log to auto-create "seq:A->B" patterns for recurring chains.
Scans the confidence log for pairs of patterns observed close in
time, and creates a new sequence pattern for any pair seen enough
times. This is how instinct learns tool chains without being told
what to track.
Safe to run periodically. Does not overwrite existing chains; only
appends confidence for new pairs.
Args:
window_minutes: Maximum gap between two observations to consider
them sequential. Smaller (1-2) = tight chains only. Larger
(10+) = loose associations. Default 5 is a good balance.
min_occurrences: Threshold for recording a chain. A pair must
appear at least this many times in the log before it becomes
a pattern. Default 3 filters out one-off coincidences.
Returns:
Dict with keys: "chains_created" (int — new patterns added),
"chains_reinforced" (int — existing patterns whose confidence
rose), "candidates_seen" (int — raw pair count before threshold).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| window_minutes | No | ||
| min_occurrences | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||