Build a deep ideal customer profile from product description and market signals with firmographics, pain points, buying triggers, and TAM estimate.
You are an ICP (Ideal Customer Profile) architect. You help founders move from vague "everyone with a website" targeting to a sharp, defensible ICP. WORKFLOW: 1. Call research_market to gather signals on the product category. 2. Call analyze_buyers on early customers, churned users, and lost deals. 3. Synthesize into 1 primary ICP and up to 2 adjacent segments via generate_icp. 4. Score each segment with score_segment on (fit, urgency, willingness-to-pay, accessibility). RULES: - Refuse to produce an ICP without at least 5 buyer data points. - Express firmographics as ranges, not point estimates. - Always name 3 buying triggers and 3 disqualifying signals. - Pitch the ICP in one sentence the founder could repeat verbatim on a call.
import { agent, tool } from "@agent-sdk"
import Exa from "exa-js"
import { z } from "zod"
const researchMarketInput = z.object({
category: z.string(),
competitors: z.array(z.string()).default([]),
})
const analyzeBuyersInput = z.object({
buyers: z.array(z.object({
company: z.string(),
role: z.string(),
outcome: z.enum(["won", "lost", "churned"]),
notes: z.string().optional(),
})).min(5),
})
export default agent({
model: "claude-sonnet-4-6",
permissionMode: "bypassPermissions",
maxTurns: 20,
systemPrompt: `...`, // see System Prompt section above
tools: {
research_market: tool({
description: "Pull market signals (size, growth, comp landscape)",
inputSchema: researchMarketInput,
execute: async ({ category, competitors }) => {
const exa = new Exa(process.env.EXA_API_KEY)
return exa.search(`${category} market size buyer profile`, { numResults: 10 })
},
}),
analyze_buyers: tool({
description: "Cluster buyers by shared traits and outcomes",
inputSchema: analyzeBuyersInput,
execute: async ({ buyers }) => {
// returns { clusters, dominantTraits, riskFlags }
},
}),
generate_icp: tool({
description: "Synthesize signals into a structured ICP card",
inputSchema: z.object({ signals: z.any() }),
execute: async ({ signals }) => {
// returns { firmographics, pains, triggers, disqualifiers, oneLiner }
},
}),
score_segment: tool({
description: "Score a segment on fit/urgency/wtp/accessibility (0-10)",
inputSchema: z.object({ segment: z.any() }),
execute: async ({ segment }) => {
// returns { fit, urgency, wtp, accessibility, total }
},
}),
},
})EXA_API_KEYExa.ai key for market and buyer researchAGENT_API_KEYServer-side API key for token exchangeA bad ICP burns six figures of GTM spend. This agent compresses 3 weeks of customer research into one structured artifact you can defend to investors.