Available Tables and Columns
| Table | Description |
|---|---|
agent_runs | Information about each agent run in a collection. |
transcripts | Individual transcripts tied to an agent run; stores serialized messages and per-transcript metadata. |
transcript_groups | Hierarchical groupings of transcripts for runs. |
judge_results | Scored rubric outputs keyed by agent run and rubric version. |
agent_runs
| Column | Description |
|---|---|
id | Agent run identifier (UUID). |
collection_id | Collection that owns the run |
name | Optional user-provided display name. |
description | Optional description supplied at ingest time. |
metadata_json | User supplied metadata, stored as JSON. |
created_at | When the run was recorded in Docent. |
transcripts
| Column | Description |
|---|---|
id | Transcript identifier (UUID). |
collection_id | Collection that owns the transcript. |
agent_run_id | Parent run identifier; joins back to agent_runs.id. |
name | Optional transcript title. |
description | Optional description. |
transcript_group_id | Optional grouping identifier. |
messages | Binary-encoded JSON payload of message turns. |
metadata_json | Binary-encoded metadata describing the transcript. |
created_at | Timestamp recorded during ingest. |
transcript_groups
| Column | Description |
|---|---|
id | Transcript group identifier. |
collection_id | Collection that owns the transcript. |
agent_run_id | Parent run identifier; joins back to agent_runs.id. |
name | Optional name for the group. |
description | Optional descriptive text. |
parent_transcript_group_id | Identifier of the parent group (for hierarchical groupings). |
metadata_json | JSONB metadata payload for the group. |
created_at | Timestamp recorded during ingest. |
judge_results
| Column | Description |
|---|---|
id | Judge result identifier. |
agent_run_id | Run scored by the rubric. |
rubric_id | Rubric identifier. |
rubric_version | Version of the rubric used when scoring. |
output | JSON representation of rubric outputs. |
result_metadata | Optional JSON metadata attached to the result. |
result_type | Enum describing the rubric output type. |
JSON Metadata Paths
Docent stores user-supplied metadata as JSON, and can be access in Postgres style. Here are some examples:Access Patterns
Allowed Syntax
DQL supported keywords:| Feature | |
|---|---|
SELECT, DISTINCT, FROM, WHERE, subqueries | |
JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN | |
WITH (CTEs) | |
UNION [ALL], INTERSECT, EXCEPT | |
GROUP BY, HAVING | |
Aggregations (COUNT, AVG, MIN, MAX, SUM, STDDEV_POP, STDDEV_SAMP, VAR_POP, VAR_SAMP, ARRAY_AGG, STRING_AGG, JSON_AGG, JSONB_AGG, JSON_OBJECT_AGG, PERCENTILE_CONT, PERCENTILE_DISC (WITHIN GROUP)) | |
Window functions (ROW_NUMBER, RANK, DENSE_RANK, NTILE, LAG, LEAD, FIRST_VALUE, LAST_VALUE, NTH_VALUE, PERCENT_RANK, CUME_DIST) | |
ORDER BY, LIMIT, OFFSET | |
Conditional & null helpers (CASE, COALESCE, NULLIF) | |
Boolean logic (AND, OR, NOT) | |
Comparison operators (=, !=, <, <=, >, >=, IS, IS NOT, IS DISTINCT FROM, IN, BETWEEN, LIKE, ILIKE, EXISTS, SIMILAR TO, ~, ~*, !~, !~*) | |
Arithmetic & math (+, -, *, /, %, POWER, ABS, SIGN, SQRT, LN, LOG, EXP, GREATEST, LEAST, FLOOR, CEIL, ROUND, RANDOM) | |
String helpers (SUBSTRING, LEFT, RIGHT, LENGTH, UPPER, LOWER, INITCAP, TRIM, REPLACE, SPLIT_PART, POSITION, CONCAT, CONCAT_WS, STRING_AGG) | |
JSON operators & functions (->, ->>, #>, #>>, @>, ?, `? | , ?&, jsonb_build_object, jsonb_build_array, json_agg, jsonb_agg, json_object_agg, jsonb_set, jsonb_path_query, jsonb_path_exists`) |
Date/time basics (CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, NOW(), EXTRACT, DATE_TRUNC, AGE, AT TIME ZONE, timezone()) | |
Interval arithmetic (timestamp +/- INTERVAL, INTERVAL literals, MAKE_INTERVAL, JUSTIFY_DAYS, JUSTIFY_HOURS, JUSTIFY_INTERVAL) | |
Construction & conversion (MAKE_DATE, MAKE_TIME, MAKE_TIMESTAMP, MAKE_TIMESTAMPTZ, TO_CHAR, TO_DATE, TO_TIMESTAMP, DATE_PART) | |
Array helpers (ARRAY[...], array_cat, array_length, cardinality, unnest, ARRAY(SELECT ...), = ANY, = ALL, array_position, array_remove) | |
Type helpers (CAST, ::) |
*, user-defined functions, and any DDL or DML commands.
Examples
Recent Runs
Transcript Counts per Group
Flagged Judge Results
Completion Rate by Environment
Aggregates per-environment success rates by normalizing metadata into a CTE.Latest Rubric Scores by Model
Pulls the most recent rubric result per run, then joins runs to surface the model responsible for the score.Transcript Coverage Audit
Finds transcript groups that are marked asmust_have but have no associated transcripts.
Restrictions and Best Practices
- Read-only: Only
SELECT-style queries are permitted. Use bulk exports or ingestion utilities to modify data outside of DQL. - Single statement: Batches or multiple statements are rejected to avoid mixed workloads.
- Explicit projection: Wildcard projections (
*) are disallowed. List the columns you need so downstream tooling (schema builders, type generation) stays predictable. - Collection scoping: A single query can only access data within a single collection.
- Limit enforcement: Every query is capped at 10,000 rows by the server. If you omit
LIMITor request more, Docent automatically applies the cap—use pagination (OFFSET/LIMIT) or offline exports for larger result sets. - JSON performance: Metadata fields are stored as JSON; heavy traversal across large collections can be slower than filtering on indexed scalar columns. Prefer top-level fields when available.
- Type awareness: The registry tracks datatypes for JSON metadata paths. When a path supports multiple types Docent may fall back to string comparisons, so cast where precision matters (e.g.,
CAST(metadata_json->>'duration_ms' AS BIGINT)).

