select_agent_run_ids), see Query Agent Runs.
When to use DQL
DQL is great for structured queries like getting the average reward by model, or identifying tasks where one model regressed compared to another. Ask the agent:A few illustrative queries
A simple SELECT
Aggregating with CTEs
Per-environment success rates, normalized via a CTE.Joining runs with judge results
Pulls the most recent rubric result per run, then joins to surface the model responsible for each score.What DQL does and doesn’t do
- Read-only. Only
SELECT-style queries are permitted. - Single statement. Batches and multiple statements are rejected.
- Explicit projection. Wildcard
*is disallowed; list columns explicitly so downstream tooling stays predictable. - Single-collection scope. A query runs against one collection at a time.
- 10,000 row cap. Every query is capped by the server. Use
LIMIT/OFFSETfor pagination, or export offline for larger sets. - JSON performance. Metadata is stored as JSON; heavy traversal across large collections is slower than filtering on indexed scalar columns.
- Type awareness. JSON paths expose a generic
jsontype. Cast explicitly (e.g.,CAST(metadata_json->>'duration_ms' AS BIGINT)) when precision matters.

