symfonic.agent.triage.intent¶
intent ¶
IntentClassifier -- deterministic pre-hydration intent routing.
Routes each turn into one of three lanes so the hydration path can skip semantic retrieval on pure action turns:
action— the user is asking the agent to do something (run a tool, call an API, perform a mutation). Full hydration wastes tokens.knowledge— the user wants information or recall. Hydration is load-bearing.ambiguous— the signals are mixed; treat asknowledgeto stay safe (full hydration is the conservative fallback).
The classifier is deterministic by design in v7.0:
- English verb lexicon seeded from operational agent corpora (see
lexicon.py). - Overlap against
DomainTemplate.tool_trigger_keywords— the same map v6.1.8 uses for tool-manifest gating, so adopters already have it populated. - Zero LLM calls. An LLM fallback for
ambiguousturns is tracked for v7.1 (v7.0-plan.md§ 7).
The classifier emits an ExtensionEvent with type=
"intent_classified" through the engine's callback manager so
operators running in observe mode can tune before flipping to
enforce.
IntentClassifier ¶
Deterministic verb+keyword intent classifier.
Thread-safe and stateless. Safe to reuse across turns. Callers wire
this into the hydration path via FrameworkConfig.intent_filter_mode
(see engine.py).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ambiguity_confidence_floor
|
float
|
Verdicts below this confidence value
are labelled |
0.55
|
min_action_signals
|
int
|
Minimum number of distinct signals required
before |
2
|
Source code in src/symfonic/agent/triage/intent.py
classify ¶
Classify query into action / knowledge / ambiguous.
Never raises. On empty input returns an ambiguous verdict
with confidence 0.0.
Source code in src/symfonic/agent/triage/intent.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
IntentVerdict
dataclass
¶
IntentVerdict(
label: IntentLabel,
confidence: float,
matched_tool_keywords: list[str] = list(),
reasoning: str = "",
action_score: float = 0.0,
knowledge_score: float = 0.0,
)
Classifier verdict for a single turn.
Attributes:
| Name | Type | Description |
|---|---|---|
label |
IntentLabel
|
One of |
confidence |
float
|
0.0–1.0 heuristic confidence. Values below 0.55
are coerced to |
matched_tool_keywords |
list[str]
|
Tool names whose trigger keywords overlap
with the current query (per |
reasoning |
str
|
Short human-readable note — which signals fired. |
action_score |
float
|
Raw action-lane score prior to normalisation. |
knowledge_score |
float
|
Raw knowledge-lane score prior to normalisation. |
to_event_payload ¶
Return a minimal payload suitable for an ExtensionEvent.