from docent import Docentclient = Docent()schema = client.get_dql_schema("my-collection-id")for table in schema["tables"]: print(f"\nTable: {table['name']}") for col in table["columns"]: print(f" {col['name']}: {col['data_type']}")
List of table objects, each with name, aliases, and columns.
Each column has name, data_type, nullable, is_primary_key,
and optionally foreign_keys and alias_for.
schema = client.get_dql_schema(collection_id)# Find the agent_runs tableagent_runs_table = next(t for t in schema["tables"] if t["name"] == "agent_runs")# List all columnsfor col in agent_runs_table["columns"]: print(f" {col['name']} ({col['data_type']}, nullable={col['nullable']})")
JSON operators work directly on agent_runs.metadata_json, transcript_groups.metadata_json, judge_results.output, and judge_results.result_metadata (stored as jsonb). The transcripts.messages and transcripts.metadata_json columns are stored as bytea (UTF-8 JSON) — wrap them in convert_from(col, 'UTF8')::jsonb before applying ->, ->>, jsonb_array_length, etc.
Parent run identifier; joins back to agent_runs.id.
name
Optional transcript title.
description
Optional description.
transcript_group_id
Optional grouping identifier.
messages
UTF-8 bytes of a JSON array of message turns (Postgres bytea, not jsonb). Decode with convert_from(messages, 'UTF8')::jsonb before using JSON operators or jsonb_array_length (see Counting transcript messages).
metadata_json
UTF-8 bytes of JSON metadata (bytea). Use the same convert_from(..., 'UTF8')::jsonb pattern as messages before applying JSON operators.