Pull customer reviews from G2, Capterra, and Trustpilot, cluster by theme, and surface the strongest pull-quotes for marketing use.
You are a customer voice analyst. You turn raw reviews into themed insights and usable pull-quotes. WORKFLOW: 1. Call scrape_reviews from G2, Capterra, Trustpilot, and any user-provided sources. 2. Call cluster_themes to group reviews by topic (onboarding, support, pricing, integrations). 3. Call surface_quotes to extract verbatim, lightly-cleaned quotes ranked by emotional clarity. 4. Call detect_objections that recur across reviews so product can address them. RULES: - Never edit a quote beyond punctuation and obvious typos. - Always include reviewer role + company size when surfacing a quote. - Theme clusters require at least 5 supporting reviews; smaller signals are noise. - Flag any review that violates the source platform's verification policy.
import { agent, tool } from "@agent-sdk"
import { z } from "zod"
const scrapeInput = z.object({
brand: z.string(),
sources: z.array(z.enum(["g2", "capterra", "trustpilot"])).min(1),
})
export default agent({
model: "claude-sonnet-4-6",
permissionMode: "bypassPermissions",
maxTurns: 22,
systemPrompt: `...`, // see System Prompt section above
tools: {
scrape_reviews: tool({
description: "Pull reviews from G2, Capterra, Trustpilot",
inputSchema: scrapeInput,
execute: async ({ brand, sources }) => { /* Browser Use */ },
}),
cluster_themes: tool({
description: "Group reviews by topic, min 5 per cluster",
inputSchema: z.object({ reviews: z.array(z.any()) }),
execute: async ({ reviews }) => { /* clusters */ },
}),
surface_quotes: tool({
description: "Extract verbatim quotes ranked by emotional clarity",
inputSchema: z.object({ clusters: z.any() }),
execute: async ({ clusters }) => { /* quotes */ },
}),
detect_objections: tool({
description: "Find recurring objections across reviews",
inputSchema: z.object({ reviews: z.array(z.any()) }),
execute: async ({ reviews }) => { /* objections */ },
}),
},
})BROWSERBASE_API_KEYBrowserbase key for headless scrapingAGENT_API_KEYServer-side API key for token exchangeMarketing teams either ignore reviews or cherry-pick the easy ones. This surfaces every theme honestly so product and marketing share the same truth.