/** * The four mutually exclusive routes the router can pick. * * - `NONE` — skip recall entirely. Used for heartbeats, cron, * agent meta-questions, system tests. Saves the * cost of an irrelevant retrieval AND avoids * polluting the prompt with off-topic memories. * - `EXPERIENCE_ONLY` — recall only conversational `experience` facts. * Useful for "do you remember when…" style turns * where stable `world` facts add no value. * - `WORLD_ONLY` — recall only stable `world` facts. Useful for * "what is X's birthday" style lookups where the * conversational history is irrelevant. * - `ALL` — recall every type configured by the operator * (`recallTypes` config). The current default * behavior; preserved when the router is disabled. * * Note: `observation` (consolidated facts) is NOT a router output. Whether * observations are recalled is controlled by `recallTypes` config and not * by the router. If observations are in `recallTypes` AND the router picks * `ALL`, observations flow through; otherwise they are filtered out by the * type-narrowing logic in the hook. */ export type Route = "NONE" | "WORLD_ONLY" | "EXPERIENCE_ONLY" | "ALL"; /** Source of a router decision — used in logs to trace the reasoning path. */ export type RouterReason = "router_disabled" | "heuristic_trigger" | "heuristic_meta" | "heuristic_short" | "heuristic_ephemeral" | "classifier_hit" | "classifier_low_confidence" | "classifier_fallback" | "classifier_error"; export interface RouterDecision { route: Route; reason: RouterReason; /** Confidence in [0, 1] when the classifier produced a score, else null. */ score: number | null; }