Tardis Docs

Tardis Runtime Docs

Practical reference for the AI SDK, ingestion pipeline, and Runtime API.

This repository is split into three boundaries:

  • AI SDK (packages/ai): provider-agnostic inference interface.
  • Runtime API (apps/server): Conversation + Turn orchestration over HTTP.
  • DB/Ingestion layer (packages/db): persists Messages, Turns, Inference Requests, and inference lifecycle events.

Domain model at a glance

  • A Conversation contains many Messages and many Turns.
  • A Turn starts from one user Message and may execute one or more Inference Requests.
  • Each Turn records one Committed Assistant Message (the reply shown to the user).
  • An Inference Request stores attempt-level telemetry and status.

Data flow

  1. Client calls POST /conversations/:id/messages (or /stream) on the Runtime API.
  2. Runtime persists the user Message and creates a pending Turn.
  3. Runtime builds request context from Conversation Message history.
  4. Runtime invokes aiSdk.stream(...).
  5. Canonical stream events are normalized and persisted as inference_events.
  6. Runtime finalizes the Inference Request, writes the Committed Assistant Message, and completes the Turn.
  7. Inspection endpoints expose request/event history and latency metrics.

On this page