Ultron

SQL Assistant

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

Next.jsTypeScriptSQL

Capabilities

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
System Prompt
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.
Agent Source
import { agent, tool } from "@agent-sdk"
import { z } from "zod"

export default agent({
  model: "claude-sonnet-4-6",
  permissionMode: "bypassPermissions",
  systemPrompt: `...`, // see System Prompt above
  tools: {
    run_sql: tool({
      description: "Execute a SQL query against the database",
      inputSchema: z.object({
        sql: z.string().describe("The SQL query to execute"),
        explanation: z.string().describe("Brief explanation of what this query does"),
      }),
      execute: async ({ sql, explanation }) => {
        // Execute against in-memory or connected database
        return {
          content: [{ type: "text", text: JSON.stringify({ sql, explanation }) }],
        }
      },
    }),
  },
})

File Structure

agents/
sql-agent.ts
app/
page.tsx
layout.tsx
globals.css
app/_components/
setup-checklist.tsx
app/api/agent/
sandbox/route.ts
threads/route.ts
token/route.ts
app/api/
run-sql/route.ts
lib/
sql-engine.ts
Setup
$ npm install
$ cp .env.example .env.local
# Add AGENT_API_KEY to .env.local
# Optional: Set DATABASE_URL for real database
$ npm run deploy
$ npm run dev

Environment Variables

AGENT_API_KEYServer-side API key for token exchange
DATABASE_URLOptional connection string for real database

Sell This Agent

Let anyone on the team query the database in plain English. No SQL knowledge required. Saves 5+ hours/week per analyst.

Setup fee
$3,000
Monthly retainer
$450/mo
Target marketData teams, Business analysts, Non-technical founders

Included

Full agent source code
SQL engine + sample data
Table editor UI
Connect to Ultron pipelineUnlock
Supabase/Postgres connectorUnlock
Turn views into income.Drop your video link, get paid as the view count climbs.
Submit a video