Web research agent with search, answer, deep research, browser automation (Anchor), and websets via Exa.
Try a capability
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 for a live agent with your API keys in .env.local:
cd examples/agent-ui-template
pnpm install
pnpm dev:embedpnpm dlx agentcn@latest add web-agent
Create app/api/chat/route.ts in your Next.js app:
import { webAgent } from "@/agents/web";
import { convertToModelMessages, type UIMessage } from "ai";
export async function POST(req: Request) {
const { messages }: { messages: UIMessage[] } = await req.json();
const result = webAgent(await convertToModelMessages(messages));
return result.toUIMessageStreamResponse();
}The CLI adds a @/agents/* path alias pointing at ./ai/agents/* in your tsconfig.json.
The web agent needs live provider API keys — there is no mock or offline fallback. Set these in .env.local before testing:
Environment 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 websets