My App
AI System

Pipeline Overview

A chat turn in ClayDiary is a fixed decision tree, not a free-form agent loop. Each step is one narrow component with a defined input and output, and the orchestrator decides which step runs next.

ClayDiary chat pipeline: a question passes through the Classifier and Router, then either the SQL agent or Retrieval, and ends in the Generator. Questions that are not about pottery end in a refusal, and the SQL agent falls back to Retrieval when it produces no result.

Steps

StepWhat it doesDocumented in
ClassifierDecides whether the question is about pottery; if not, the turn ends with a refusalClassification Gate
RouterDecides whether the question is structured (counts, filters) or descriptiveQuestion Routing
SQL agentAnswers structured questions by querying the databaseText-to-SQL
RetrievalFinds the most relevant events with hybrid search and reranking, then groups them by pieceRAG Architecture
GeneratorWrites the answer from the SQL result or the retrieved context and names the pieces it usedAnswer Generation

Across the steps

Three outcomes. A turn ends in an answer, a refusal, or an error. Unexpected failures are handled in one place, and the frontend learns which path the turn took from the end of the streamed response.

One conversation history. Every step that calls a model sees the same clean conversation history.

One trace. The whole turn is recorded as a single trace, so each step and the prompt version it ran can be inspected together. See Monitoring.

On this page