# Minimal Web-Connected AI Agent in TypeScript

> TypeScript snippet to build a web-searching agent using Vercel AI SDK and Exa

A concise code recipe demonstrating how to wire an LLM to live web search using Vercel AI SDK and the Agentic Exa integration. It serves as a minimal boilerplate for building tool-calling agents in TypeScript with minimal configuration.

## How it works

Full code shown in the screenshot:

import "dotenv/config";

import { openai } from "@ai-sdk/openai";

import { ExaClient } from "@agentic/exa";

import { generateText } from "ai";

import { createAISDKTools } from "@agentic/ai-sdk";

async function main() {

const exa = new ExaClient();

const result = await generateText({

model: openai("gpt-4o-2024-05-13"),

tools: createAISDKTools(exa),

prompt: "What is founder mode and why is everyone talking about it?",

maxToolRoundtrips: 2,

});

console.log(result.text);

}

main().catch(console.error);

Stack: Vercel AI SDK (@ai-sdk/openai, ai), Exa (@agentic/exa), agentic (@agentic/ai-sdk by @transitive\_bs).

## What it is for

- Bootstrap a web-browsing AI agent in TypeScript
- Integrate Exa search tools into the Vercel AI SDK
- Reference minimal tool-calling setup with generateText

## Key points

- Uses Vercel AI SDK generateText with maxToolRoundtrips
- Integrates ExaClient via @agentic/exa for real-time web querying
- Uses createAISDKTools from @agentic/ai-sdk to automatically adapt client methods into model tools
- Configured for OpenAI GPT-4o with minimal boilerplate

## Pricing

Free

## Details

- Type: Tip
- Category: [Development](https://xiry.app/topics/development.md)
- Topic: [AI Agents](https://xiry.app/topics/ai/ai-agents.md)
- Open source: yes
- Platforms: Code library
- For: TypeScript and Node.js developers building AI agents
- Alternative to: LangChain, LlamaIndex
- Tags: typescript, ai agents, vercel ai sdk, exa, openai, code snippet

## Why it was saved

- [@nicoalbanese10, 2 September 2024](https://x.com/nicoalbanese10/status/1830643647811055853): A copy-paste starting point for tool-calling agents with web search.

## Compare

- [Alternatives to LangChain](https://xiry.app/alternatives/langchain.md)
- [Alternatives to LlamaIndex](https://xiry.app/alternatives/llamaindex.md)

## Related

- [Skills.sh](https://xiry.app/resources/skills-sh): Open directory and CLI for discovering and installing AI agent skills (Web app, Free)
- [Odin AI](https://xiry.app/resources/odin-ai): Enterprise platform to build autonomous AI agents and automated business workflows. (Web app, Paid)
- [ai-agent-cognitivedriftt](https://xiry.app/resources/ai-agent-cognitivedriftt): Starter repository for building an autonomous social AI agent with Eliza (GitHub repo, Open source)
- [Botpress](https://xiry.app/resources/botpress): AI agent and chatbot platform for automated customer support and workflows. (Web app, Freemium)
- [Browser Use Box](https://xiry.app/resources/browser-use-box): Always-on cloud agent box with preinstalled browser and Telegram interface (Web app, Paid)
- [Browser Use WebUI](https://xiry.app/resources/browser-use-webui): Open-source graphical interface for running autonomous AI browser agents locally. (Web app, Open source)

Updated 11 October 2026. Page: https://xiry.app/resources/minimal-web-connected-ai-agent-in-typescript

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
