Web research agent with search, answer, deep research, browser automation (Anchor), and websets via Exa.
Install the agent in your project, then configure environment variables in the Installation section below.
pnpm dlx agentcn@latest add web-agentRun the demo app locally (requires API keys in .env.local):
cd examples/agent-ui-template
pnpm install
pnpm dev:embedpnpm dlx agentcn@latest add web-agent
import { webAgent } from "@/ai/agents/web";import type { ModelMessage } from "ai";
const messages: ModelMessage[] = [
{ role: "user", content: "Search for the latest news on AI agents." },
];
const result = await webAgent(messages);
// Returns a streamText result — wire into your API route or chat handlerEnvironment variables required by web-agent.
| Prop | Type | Default |
|---|---|---|
string | - | |
string | - | |
string | - |
The agent exposes these tools (see ai/agents/web/tools/toolset.ts):
web_search — search the web for up-to-date informationanswer_question — answer a question with source-backed evidencedeep_research — longer investigations using web sourcesuse_browser — automate tasks on websites when interaction is requiredcreate_webset — comprehensive entity collection via Exa websetsOn This Page