DQL (Docent Query Language) lets you query agent runs, metadata, and evaluation results using a SQL-like syntax.Documentation Index
Fetch the complete documentation index at: https://docs.transluce.org/llms.txt
Use this file to discover all available pages before exploring further.
For the conceptual overview of DQL, see Structured queries (DQL). For the column schema of each table, see DQL schema reference.
Execute a Query
Parameters
ID of the collection to query.
The DQL query string.
Returns
Query result.
Errors
ValueError—dqlis emptyHTTPError— Invalid DQL syntax or collection not found
Convert Results to Dicts
Parameters
A result dict returned by
execute_dql.Returns
List of dictionaries, one per row, with column names as keys.
Common Query Patterns
Filter by metadata
Join with evaluation results
Count and aggregate
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, 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 (->, ->>, #>, #>>, @>, ?, `? | , ?&, json_agg, jsonb_agg, json_object_agg`) |
Date/time basics (CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, NOW(), EXTRACT, DATE_TRUNC, AT TIME ZONE) | |
Interval arithmetic (timestamp +/- INTERVAL, INTERVAL literals) | |
Construction & conversion (MAKE_DATE, MAKE_TIME, MAKE_TIMESTAMP, TO_CHAR) | |
Array helpers (array_cat, unnest) | |
Type helpers (CAST, ::) |
* in SELECT clauses (e.g., SELECT *, COUNT(*)), user-defined functions, and any DDL or DML commands.
SQL patterns
Bare DQL snippets for common tasks.Filter by metadata field
Filter by date range
Count by category
Check if a metadata field exists
Numeric comparison on a JSON field
Cast JSON for aggregation
Join transcripts with agent runs
Transcript counts per group
Transcript coverage audit
Finds transcript groups that are marked asmust_have but have no associated transcripts.
Flagged judge results
Common gotchas
”column X does not exist”
- DQL requires explicit column selection. Wildcards (
*) are not supported. - Check the schema using
client.get_dql_schema(collection_id)to see available columns.
Numeric comparisons not working as expected
JSON fields are strings by default. Cast them for numeric operations:Query returns no results but data exists
- Check that you’re querying the correct collection
- Verify metadata field names are exact matches (case-sensitive)
- Use
?operator to check if a field exists before filtering on it
Results truncated unexpectedly
DQL caps results at 10,000 rows. UseLIMIT and OFFSET for pagination:
“syntax error” on valid-looking SQL
Some SQL features aren’t supported in DQL:- No
*wildcard in SELECT - No
INSERT,UPDATE,DELETE - No user-defined functions

