What Manta provides
Querying
MantaService is the entry point for loading data from ClickHouse. You can query traces by run, phase, step, or datapoint — and load their spans with filtering by kind, role, tool name, and more.
Typed context objects
Raw trace and span rows are wrapped in context objects with typed accessors.TraceContext is the main one — it gives you methods like messages(), tools(), grader_result(), and conversation() instead of parsing raw span data yourself.
Analysis pipelines
For batch analysis across a full run, Manta provides a MapReduce pipeline that runs a function per trace, aggregates results up the entity hierarchy, and optionally persists computed metadata back to ClickHouse.Core concepts
Entity hierarchy
Traces are organized in a hierarchy:| Level | What it represents |
|---|---|
| Trace | A single agent rollout — one execution of a datapoint |
| Datapoint | A problem instance or sample (may have multiple traces across steps) |
| Step | A training or eval step within a run |
| Run | A complete training or evaluation run |
Span kinds
Each trace contains spans — individual events that happened during the rollout:| Kind | What it captures |
|---|---|
message | A conversation message (user, assistant, system, tool) |
tool | A tool call with arguments, result, and error status |
grader | Grading results, criteria, and grader LLM messages |
llm | Raw LLM invocations with token counts and cost |
system | Lifecycle events (setup, teardown, etc.) |
Trace properties
Each trace carries summary data from ClickHouse:| Property | Type | Description |
|---|---|---|
trace_id | str | Unique trace ID |
run_id | str | Parent run |
step_number | int | Training/eval step |
phase | str | "train", "eval", or "prod" |
datapoint_id | str | Parent datapoint |
score | float | None | Grader score |
status | str | "completed", "error", etc. |
cost_usd | float | Total cost |
duration_ms | int | Trace duration |
turn_count | int | Number of turns |
tokens_input | int | Input tokens |
tokens_output | int | Output tokens |
model_name | str | Model used |
env_name | str | Environment name |
meta | dict | Trace metadata |