Tutorial

Building AI Agents with Real-Time Web Access

Learn how to give your AI agents the ability to search the web, extract content, and conduct research using UnSearch.

Prerequisites

  • Python 3.9+ or Node.js 18+
  • An UnSearch API key (get one free at unsearch.dev)

Setting Up

Install the UnSearch SDK and start building agents that can search the web in real-time. Our Tavily-compatible endpoints mean you can switch existing agents with a single import change.

Python Quick Start

First, install the SDK:

pip install unsearch

Then create a simple search agent:

from unsearch import UnSearch client = UnSearch(api_key="your-api-key") results = client.search("latest AI research papers", max_results=5)

Example: Research Agent

Build a research agent that can search multiple sources, extract relevant content, and synthesize findings into a comprehensive report. With UnSearch's Research API, you can automate multi-step research workflows that would take hours manually.

Using with LangChain

UnSearch provides Tavily-compatible endpoints, so you can use it as a drop-in replacement in your existing LangChain agents. Simply change the base URL and API key — no other code changes needed.