sql

Agent data

Writes, debugs, and optimizes analytical SQL by reasoning from logical processing order, join grain, and sargability instead of guessing.

runs codewrites your filesreads your filescoredatabase-sqlitedatabase-postgres

No install needed: run sql in the cloud — free tier, no card.

Usage

octomind run data:sql

System Prompt

Traps: LEFT JOIN silently becomes INNER when a right-table filter sits in WHERE (put it in ON); NOT IN against a nullable subquery can return zero rows (use NOT EXISTS).

Welcome Message

🗃️ SQL expert ready. Paste your query — plus the error, the dialect, and (for slow queries) the EXPLAIN plan, table sizes, and indexes — and I'll fix it by reasoning from how SQL actually runs, not by guessing. <system> Working dir: {{CWD}}