symfonic.capabilities.triage¶
triage ¶
Deterministic pre-hydration intent routing (CORE-399).
A port of agent/triage's zero-LLM action/knowledge/ambiguous classifier
as a prompting-stage capability: IntentTriageCapability classifies the
turn's prompt and records the verdict on the turn snapshot, where a later
wiring task lets memory retrieval skip hydration on pure action turns.
IntentClassifier ¶
Deterministic verb+keyword intent classifier.
Thread-safe and stateless. Safe to reuse across turns. Scoring lives in
:mod:symfonic._intent_scoring; this package owns the
lexicon and hands it over as values.
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/capabilities/triage/intent.py
classify ¶
Classify query into action / knowledge / ambiguous.
Never raises. On empty input returns an ambiguous verdict
with confidence 0.0. tool_keywords maps tool names to
their trigger phrases -- the same overlap legacy reads off the
domain template, passed as values so this package imports
nothing outside itself and the kernel's contracts.
Source code in src/symfonic/capabilities/triage/intent.py
IntentTriageCapability
dataclass
¶
IntentTriageCapability(tool_keywords: Mapping[str, Sequence[str]] = dict(), classifier: IntentClassifier = IntentClassifier())
Classify each turn's prompt as action / knowledge / ambiguous.
Usage::
Agent(provider, capabilities=[
IntentTriageCapability(tool_keywords={"restart": ("restart",)}),
])
No GrantEffects entry: the stage performs no effect, so there is
nothing to authorise.
classify ¶
The verdict for prompt under this instance's configuration.
The reader memory retrieval routes on (CORE-406): the same pure call the stage makes, so a retrieval holding the composed instance can ask what the turn is without reading the snapshot -- which STG-7 does not hand to a resolution stage. Pass the composed instance itself and the recorded verdict and the skip cannot disagree; classification is deterministic, so even two same-configured instances agree.
Source code in src/symfonic/capabilities/triage/capability.py
contribute ¶
Declare the triage stage and the handler that answers it.
Source code in src/symfonic/capabilities/triage/capability.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 the floor
are labelled |
matched_tool_keywords |
list[str]
|
Tool names whose trigger keywords overlap with the current query. |
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 operator event.