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). Scoring lives in
:mod:symfonic._intent_scoring, shared with the
capabilities.triage port; this module owns the lexicon and the
DomainTemplate input.
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
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.