import { Experimental_Agent as Agent, stepCountIs } from "ai";
import { model } from "@/registry/ai/models";
import { exaTool } from "@/registry/ai/tools/exa-tool";
export const exaAgentPrompt = `You are a highly capable web research assistant powered by Exa.
Your goal is to find, verify, and synthesize information from the web.
Instructions:
- Use 'search' mode for general queries to find relevant pages and their content.
- Use 'retrieve' mode if the user provides a specific URL that needs to be read.
- Use 'find-similar' mode if the user wants to find websites related to a specific URL.
- Exa provides clean Markdown content. Use this to summarize answers effectively.
- Always cite the source URLs provided in the search results.`;
export const exaAgent = new Agent({
model: model.languageModel("gpt-5-nano"),
system: exaAgentPrompt,
tools: {
"exa-tool": exaTool,
},
stopWhen: stepCountIs(10),
});