Ultron

Cold Outreach Writer

Research a prospect and draft three cold-email variants with subject lines scored by predicted reply rate before you send.

Next.jsTypeScriptExa.aiAgentMailZod

Capabilities

Research any prospect for a real, name-able outreach trigger
Draft three structurally different cold-email variants per prospect
Score 5 subject-line candidates by predicted reply rate
Refuse to write when no usable trigger exists, preventing slop email
System Prompt
You are a senior outbound copywriter. You write cold emails that get replies because they sound human, name a real trigger, and ask one specific question.

WORKFLOW:
1. Call research_prospect on the target's name, role, company, and any URL.
2. Call draft_variants to produce three emails: opener (curiosity), value-led (concrete proof), breakup (last attempt).
3. For each, call score_subject_lines to rank 5 candidate subject lines by predicted reply rate.
4. Optional: call send_test to send the chosen variant to the user's inbox for QA.

RULES:
- Every email must reference one specific trigger (hire, funding, post, launch, integration).
- No more than 90 words per email body.
- Never use "I hope this email finds you well" or any AI-tell phrase.
- Subject lines max 6 words, no question marks unless asking something specific.
- If research returns nothing usable, refuse to write the email.
Agent Source
import { agent, tool } from "@agent-sdk"
import Exa from "exa-js"
import { z } from "zod"

const researchInput = z.object({
  name: z.string(),
  company: z.string(),
  role: z.string().optional(),
  url: z.string().url().optional(),
})

const draftInput = z.object({
  research: z.any(),
  offer: z.string(),
  cta: z.string(),
})

export default agent({
  model: "claude-sonnet-4-6",
  permissionMode: "bypassPermissions",
  maxTurns: 15,
  systemPrompt: `...`, // see System Prompt section above
  tools: {
    research_prospect: tool({
      description: "Find a real trigger to reference",
      inputSchema: researchInput,
      execute: async ({ name, company, role, url }) => {
        const exa = new Exa(process.env.EXA_API_KEY)
        const q = `${name} ${company} ${role ?? ""}`.trim()
        return exa.search(q, { numResults: 6, contents: { text: true } })
      },
    }),
    draft_variants: tool({
      description: "Produce opener, value-led, and breakup variants",
      inputSchema: draftInput,
      execute: async ({ research, offer, cta }) => {
        // returns { opener, valueLed, breakup }
      },
    }),
    score_subject_lines: tool({
      description: "Rank 5 candidate subject lines by predicted reply rate",
      inputSchema: z.object({ candidates: z.array(z.string()).length(5) }),
      execute: async ({ candidates }) => {
        // returns ranked array with predicted reply rate
      },
    }),
    send_test: tool({
      description: "Send chosen variant to the user's own inbox for QA",
      inputSchema: z.object({ to: z.string().email(), variant: z.any() }),
      execute: async ({ to, variant }) => {
        // POST to AgentMail send
      },
    }),
  },
})

File Structure

agents/
cold-outreach-writer.ts
lib/outreach/
triggers.ts
scoring.ts
templates.ts
app/api/outreach/
route.ts
Setup
$ npm install
$ cp .env.example .env.local
# Add EXA_API_KEY and AGENTMAIL_API_KEY
$ npm run dev

Environment Variables

EXA_API_KEYExa.ai key for prospect research
AGENTMAIL_API_KEYAgentMail key for QA test sends
AGENTMAIL_INBOX_IDSender inbox ID

Sell This Agent

An SDR costs $7k/mo loaded and writes 30 emails a day with worse triggers than this agent. Replace the writing, keep the human for replies.

Setup fee
$2,800
Monthly retainer
$450/mo
Target marketOutbound SDR teams, Founder-led sales, Agencies

Included

Full agent source code
Trigger-required guardrail
Subject-line scoring model
Connect to Ultron pipelineUnlock
Sequence builder + reply detectionUnlock
Turn views into income.Drop your video link, get paid as the view count climbs.
Submit a video