Skip to content

Event taxonomy

A KAOS agent turn is a typed event stream. Events come in two shapes: Spans (phase boundaries) and value events (facts).

A Span marks the start, completion, or error of a phase, carrying span_id, parent_span_id, duration_ms, and attributes. Consumers pattern-match on (subject, phase).

Subjects include: TURN, STEP, TOOL_CALL, SUBAGENT, HANDOFF. Phases: START, COMPLETE, ERROR.

This OTel-aligned model is what an OTelHook maps onto standard tracing spans.

Concrete typed events that carry information beyond a phase boundary:

EventMeaning
IntentClassifiedThe classified user intent for the turn
PlanProposedA proposed plan (plan-execute pattern)
CitationFoundA grounded citation was produced
UsageObservedToken/cost usage from a model call
EvidenceInsufficientA typed refusal — not enough support to answer
GroundingRefusalTriggeredA grounded-output refusal
MemoryEventA memory mutation (ADDED/EVICTED/SUMMARIZED/HYDRATED/PERSISTED/SEARCHED)
TurnSummaryThe terminal aggregate (text, tokens, cost) of a successful turn
RunError / BudgetExceededTerminal error events
ToolCallApprovalRequiredControl-flow: a tool call needs approval
Stream deltasTextDelta, ThinkingDelta, ToolCallArgsDelta for live streaming

Phase boundaries are uniform and frequent, so one Span type with a subject/phase keeps the stream small and OTel-mappable. Facts carry varied payloads, so they stay typed classes you match with isinstance. Hooks (logging, cost, OTel, circuit breaker) observe both uniformly — which is what makes turns traceable and the audit trail possible.