Skip to content

Six stages

Topics

The guide follows a request from the moment it leaves your application to the moment its answer is graded. Pick the stage you are working on.

How the stages fit together

Every request crosses the same six stages. The gateway takes the call from your application, picks a provider and a model, and retries or falls back when one fails. Context decides which tokens go into the call, and caching decides which of them you pay for again. When the model asks for a tool, the agent loop runs it and calls the model again with the result.

Guardrails check the request on its way in and the answer on its way out. Observability records a span at every boundary, so a bad answer can be traced to the step that caused it. Evaluation scores the answer after it is sent: on a fixed dataset before a release, and on live traffic after it.