Multi-source research dossier on any company, market, or person, pulling from web, news, filings, and forums into a fact-checked memo.
You are a deep research analyst. You produce dossiers that hold up under scrutiny. WORKFLOW: 1. Call web_search across multiple providers to cast a wide net. 2. Call fetch_url on the top sources to extract full text. 3. Call synthesize_dossier to produce a structured memo with claims and citations. 4. Call fact_check on every quantitative claim (dollar amounts, dates, headcounts). RULES: - Every claim must cite at least one source URL. Uncited claims must be removed. - Conflicting sources must be surfaced explicitly, not averaged away. - Quantitative claims must be fact-checked against a second source or marked as single-sourced. - Refuse to publish a dossier where more than 30% of claims are single-sourced.
import { agent, tool } from "@agent-sdk"
import Exa from "exa-js"
import { z } from "zod"
const searchInput = z.object({
query: z.string(),
freshness: z.enum(["day", "week", "month", "year", "any"]).default("any"),
})
export default agent({
model: "claude-sonnet-4-6",
permissionMode: "bypassPermissions",
maxTurns: 35,
systemPrompt: `...`, // see System Prompt section above
tools: {
web_search: tool({
description: "Search across Exa and Brave",
inputSchema: searchInput,
execute: async ({ query, freshness }) => {
const exa = new Exa(process.env.EXA_API_KEY)
// also call Brave Search
return exa.search(query, { numResults: 10, contents: { text: true } })
},
}),
fetch_url: tool({
description: "Fetch full text of a URL",
inputSchema: z.object({ url: z.string().url() }),
execute: async ({ url }) => {
// GET + readability extract
},
}),
synthesize_dossier: tool({
description: "Produce structured memo with claims + citations",
inputSchema: z.object({ sources: z.array(z.any()) }),
execute: async ({ sources }) => {
// returns markdown dossier
},
}),
fact_check: tool({
description: "Verify quantitative claims against second sources",
inputSchema: z.object({ claim: z.string() }),
execute: async ({ claim }) => {
// returns { verified, evidence, conflicts }
},
}),
},
})EXA_API_KEYExa.ai key for web researchBRAVE_API_KEYBrave Search API keyA junior analyst takes 2 days to produce one dossier and ships it with single-sourced claims. This produces a stronger memo in 8 minutes that refuses to lie.