Skip to main content

Core Concepts

Trainly’s observability model is built on five primitives.

Traces

A trace is a single recorded AI interaction — one input in, one output out. Every trace captures:

Spans

A span is a sub-unit of work within a trace. Use spans to instrument multi-step pipelines — each step gets its own timing, attributes, and output.
Span kinds: chain, retrieval, tool, agent, llm, embedding.

Sessions

A session groups multiple traces into a single agent run. All traces within a session share a session_id for end-to-end correlation.

Scores

Scores attach evaluation metrics to traces. Use them for human feedback, automated checks, or LLM-as-judge evaluation.

Versions

Versions tag your pipeline configuration with semver strings. Publish a version, compare performance across versions, and rollback instantly.

Projects

A project is an isolated environment for traces. Each project has its own API key (tk_), project ID (proj_), and trace store. Use separate projects for different apps, environments, or teams.