SQL Assistant

Query and edit databases using natural language with a Supabase-style table editor interface.

Query and edit databases using natural language with a Supabase-style table editor interface. Let anyone on the team query the database in plain English. No SQL knowledge required. Saves 5+ hours/week per analyst.

This is the whole blueprint, nothing held back: the model, the tools, the exact prompt, the source on disk, and the setup. Everything you need to run SQL Assistant yourself is on this page, and it deploys in an afternoon.

See it running

Agents like SQL Assistant run behind an in-editor copilot sidebar. Here is that pattern, live: every action stays visible and reviewable. Click into it.

crescendo.51ultron.com/kits/sidebar-copilot

What it does

SQL Assistant handles the work end to end:

  • Translate natural language to SQL queries automatically
  • Read-only and read-write modes with toggle control
  • Supabase-style table editor with sort, filter, pagination
  • Schema-aware: never generates queries for non-existent columns

The anatomy

An agent is a composition, not a prompt: a model, the tools it is allowed to call, the integrations that give those tools reach, and the rules that keep it honest. Here is SQL Assistant on one card.

SQL Assistantblueprint
Model
claude-sonnet-4-6
Tools
run_sql
Integrations
SQL

The instructions

Every run is governed by this prompt. It is short on purpose: enough to make SQL Assistant reliable, not so much that it can misread itself. Copy it as a starting point for any agent you build.

SQL Assistant
You are a database assistant. You help users query and modify data using natural language. The user message is prefixed with: [[[SYSTEM NOTE: SCHEMA: {...} | WRITE_MODE: true|false ]]] Rules: 1. Translate natural language to SQL. Only use tables/columns from the schema. 2. In read-only mode, only SELECT queries. In write mode, INSERT/UPDATE/DELETE allowed. 3. Call run_sql with the query. Return results as a formatted table. 4. If the query would affect many rows, warn the user and ask for confirmation. 5. Never drop tables or alter schema.

The source, on disk

Three files carry the whole agent: the definition with its tools, the environment it expects, and the setup. Walk them.

sql-assistant/sql-assistant.ts0.7 KB
1import { agent, tool } from "@agent-sdk"
2import { z } from "zod"
3
4export default agent({
5 model: "claude-sonnet-4-6",
6 permissionMode: "bypassPermissions",
7 systemPrompt: `...`, // see System Prompt above
8 tools: {
9 run_sql: tool({
10 description: "Execute a SQL query against the database",
11 inputSchema: z.object({
12 sql: z.string().describe("The SQL query to execute"),
13 explanation: z.string().describe("Brief explanation of what this query does"),
14 }),
15 execute: async ({ sql, explanation }) => {
16 // Execute against in-memory or connected database
17 return {
18 content: [{ type: "text", text: JSON.stringify({ sql, explanation }) }],
19 }
20 },
21 }),
22 },
23})

The business case

If you run an agency, SQL Assistant is also a product. It sells into data teams, business analysts, non-technical founders, and the numbers work at very small scale.

$3,000

setup you can charge

$450/mo

monthly retainer

5+

hours saved weekly

Ship it

The whole install is a handful of commands and the keys from the env file. Run the list, then point SQL Assistant at real work.

Deploy checklist

0 of 6

That is the entire blueprint: one model, 1 tools, and a prompt. Built by hand it costs you an afternoon. Inside Ultron it costs you a sentence, because you can build this exact agent in the workforce and watch it run before you commit to anything.

Build SQL Assistant in Ultron

1
Describe what you want

Start from this blueprint or your own words. Ultron reads the intent and picks the tools.

2
It builds the agent

The model, the tools, the prompt, the console. Assembled in front of you, nothing to wire.

3
Watch it run

Test it live in the chat, then put it to work. You review what it does, it does the rest.

Keep reading