Web Agent

Web research agent with search, answer, deep research, browser automation (Anchor), and websets via Exa.

Installation

pnpm dlx agentcn@latest add web-agent

Usage

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 handler

Configuration

Environment variables required by web-agent.

Tools

The agent exposes these tools (see ai/agents/web/tools/toolset.ts):

  • web_search — search the web for up-to-date information
  • answer_question — answer a question with source-backed evidence
  • deep_research — longer investigations using web sources
  • use_browser — automate tasks on websites when interaction is required
  • create_webset — comprehensive entity collection via Exa websets