Deterministic by design: the Agent Stack

Sessions as event logs, a pure handler, explicit effects, and a person in front of every write.

Converge Team, 2026-10-29

Language models are not deterministic. The systems around them can be. When we built the Agent Stack, the runtime behind every agent in Converge, we wanted one property above all: given the same history, an agent session always arrives at the same state, and nothing it does to the world happens without a record and, for writes, a person's decision.

A session is an append-only log

An agent session is not a mutable object. It is a sequence of events: the session was created, the user sent a message, the model replied, a tool returned a result, a reviewer decided, an error occurred, the user cancelled. Events are only ever appended. Each gets the next sequence number under a per-session lock, so two requests never interleave.

Clients can add exactly three kinds of event: a user message, a review decision and a cancel. Everything else is produced by the runtime itself.

Events go in, the pure handler computes the next state, and effects carry out the I/O.

One pure handler

At the centre is a single function that takes the current state and one event and returns three things: the state changes, the new items to show, and the effects to perform. It does no I/O. It does not call a model, read a database or touch the network.

handle_event(state, event) -> (state_updates, new_items, effects)

Because the handler is pure, a session can be rebuilt at any point by replaying its events. Debugging becomes reading a log, and the handler can be tested exhaustively without a model in the loop.

The model decides what it would like to do. The handler decides what is allowed to happen next.

Effects are where the world changes

There are three effects: call the model, run a tool, and execute an approved write. A driver performs each one as the session's owner and reports the outcome back as a new event, which goes through the same handler. Bounds live in the handler too: a single user turn may call the model at most eight times, which stops runaway tool loops.

A person in front of every write

When the model asks for a write tool, such as applying an ontology action or sending a message through a connector, the handler does not emit a write effect. It moves the session to awaiting_review and records a review request containing the proposed call. Only a review-decided event that approves it produces the write.

Write tools are always in confirm mode; there is no setting that lets an agent write unattended. Preview sessions go one step further: write calls are validated and recorded as skipped, never run.

Inputs are data

Session inputs are interpolated into the agent's instructions by name, but their values travel to the model in a separate block marked untrusted. Tool output from external connectors is labelled the same way. The model is told to treat both as data, never as instructions.

What this buys

  • Auditability. Every state a session was ever in can be reconstructed from its events.
  • Safety. Writes are a separate effect that only a human decision can unlock.
  • Operability. Agent Manager shows each session step by step, including what is waiting for a decision.

The Agent Stack documentation lists the states, events and endpoints in full.

Converge