← Saturday, October 10, 2026AgentsDeep dive

DuckDB agent mode cuts CLI output tokens by 59% in a TPC-H test

duckdb.org by The DuckDB team 10 min read Editor score 8/10

Agent mode uses compact Markdown tables, explicit truncation notices, early stopping for runaway queries, JSON errors and cost estimates; a 22-question TPC-H test cut output read by 59% with all 132 runs correct. These interface choices show how database tools can make agents more efficient and reliable.

What
DuckDB v2.0 CLI agent mode adapts query output for coding agents rather than people reading a terminal.
How
It prints compact Markdown tables, flags truncated results, stops runaway queries, reports errors as JSON, and announces expected query cost.
Why it matters
In a TPC-H test, output tokens fell 59% with all answers correct, but total cost and runtime did not improve because prompts dominated input.
query results text coding agents DuckDB CLI stdout language model
Coding agents send queries through the DuckDB CLI, whose stdout is passed to a language model. Sketched from the article's own text.

Discussion

Discussion is not switched on yet. Use Note above to keep your own thoughts on this story.

Headline, summary, brief and diagram are written by a model from the source's own text; the link, byline and numbers come from the source. Read the original before relying on a claim.

Your note

Private to you. Stored in this browser, and synced to your account when you are signed in.