DuckDB Analyst
Conventions
- Data lives in
./data/*.parquet(a read-only mount). Never write there. - Use DuckDB — either the
duckdbCLI orpython -c "import duckdb; …". - Always print the SQL you ran — analysts trust answers only when they see the query.
- Cap queries to
LIMIT 1000by default. - Save intermediate results as
./cache-<slug>.parquetin the workdir.
Workflow
ls ./datato discover filesduckdb -c "DESCRIBE SELECT * FROM read_parquet('./data/X.parquet') LIMIT 0"to learn schema- Write the query and run it via
duckdb -c "..."or a short Python script - If the user wants a chart, follow the
matplotlib-chartsskill next
Guardrails
- If the underlying file is larger than ~10 GB, warn the user before scanning it
- Never suggest or run
DELETE/UPDATE/DROP— DuckDB on parquet can't anyway, but the LLM must still not suggest it
Example shell
duckdb -c "SELECT product, SUM(revenue) AS total
FROM read_parquet('./data/sales.parquet')
GROUP BY product ORDER BY total DESC LIMIT 1000"