Ultron

Support Bot

Answer customer questions from your docs with automatic email escalation for unanswered queries.

Next.jsTypeScriptResend

Capabilities

Answer questions from any documentation set automatically
Smart keyword search across docs without reading full files
Cite source URLs for every answer provided
Escalate unanswered questions to your team via Resend email
System Prompt
You are a support agent. Your primary job is to answer user questions using the product documentation loaded into your workspace. When you cannot find an answer in the docs, offer to forward the question to the team via email.

RULES:
1. Documentation files are available locally:
   - /workspace/llms.txt — index of all doc pages with links
   - /workspace/llms-full.txt — full documentation content
2. ALWAYS search local files first using grep. Do NOT read the entire file.
3. Use grep with relevant keywords to find the right sections.
4. When answering, cite the relevant documentation page URLs.
5. Be concise and accurate. Provide code examples from the docs when relevant.

ESCALATION — when to use send_email:
- You searched the docs thoroughly and could not find a relevant answer.
- The user explicitly asks to contact the team or get human help.
- The question involves account-specific issues, billing, or bugs.
When sending an email, include the full conversation context.
Agent Source
import { agent, tool, Sandbox } from "@agent-sdk"
import { z } from "zod"

export default agent({
  runtime: "claude-code",
  model: "claude-sonnet-4-6",
  permissionMode: "bypassPermissions",
  maxTurns: 25,
  systemPrompt: `...`, // see System Prompt section above
  sandbox: Sandbox({
    setup: [
      // fetches docs from DOCS_URL into /workspace/llms.txt
    ],
  }),
  tools: {
    fetch_doc_page: tool({
      description: "Fetch a documentation page by URL",
      inputSchema: z.object({ url: z.string().url() }),
      execute: async ({ url }) => {
        const res = await fetch(url)
        return { content: [{ type: "text", text: await res.text() }] }
      },
    }),
    send_email: tool({
      description: "Escalate unanswered question via email",
      inputSchema: z.object({
        to: z.string().email(),
        subject: z.string(),
        body: z.string(),
      }),
      execute: async ({ to, subject, body }) => {
        // POST to Resend API
      },
    }),
  },
})

File Structure

agents/support-agent/
index.ts
app/
page.tsx
layout.tsx
globals.css
app/api/agent/
sandbox/route.ts
threads/route.ts
token/route.ts
Setup
$ npm install
$ cp .env.example .env.local
# Set env vars: DOCS_URL, RESEND_API_KEY, SUPPORT_EMAIL
$ npm run deploy
$ npm run dev

Environment Variables

AGENT_API_KEYServer-side API key for token exchange
DOCS_URLBase URL of your documentation site
RESEND_API_KEYResend API key for email escalation
SUPPORT_EMAILTeam email for forwarded questions

Sell This Agent

Cut support ticket volume by 60%. Answers from docs in seconds, escalates what it cannot solve.

Setup fee
$3,000
Monthly retainer
$500/mo
Target marketSaaS, Developer tools, Fintech

Included

Full agent source code
System prompt + workflow
Email escalation setup
Connect to Ultron pipelineUnlock
Custom response templatesUnlock
Turn views into income.Drop your video link, get paid as the view count climbs.
Submit a video