Conversation lifecycle
What happens inside the engine on every turn: policy matching, routine advancement, tool execution, the iteration loop, and event emission.
The unit of work: a turn
Anatomy of a turn
incoming event
│
▼
┌─────────────────────────────────────────────────────┐
│ PREPARATION ITERATIONS (at most max_engine_iterations, default 5)
│ │
│ 1. Policy matching which policies apply now? │
│ 2. Routine evaluation which routine is active, │
│ which node comes next? │
│ 3. Tool / think calls execute tool nodes and │
│ think nodes; results join │
│ the conversation history │
│ │
│ └── tools ran? ──► loop: re-evaluate with results │
│ nothing left to prepare? ──► exit loop │
└─────────────────────────────────────────────────────┘
│
▼
RESPONSE GENERATION one chat-model call produces the reply,
honouring matched policies, the active
routine step, persona, and language
│
▼
EVENT EMISSION message / tool / status events appended
to the session and streamed to consumers1. Policy matching
2. Routine evaluation
3. Tool and think execution
The iteration cap
Response generation
Preambles
What consumers observe
Event kind
When
Timing and failure characteristics
See also
Last updated
Was this helpful?

