Exa AI

Exa AI — User Guide

Semantic search API for apps.

Visit website VPN may be required Freemium Sign-up required
Strengths
  • Semantic search, understanding query intent rather than keyword matching
  • Designed specifically for AI applications, returning structured data
  • Supports obtaining the complete content of the web page (not just the summary)
  • You can filter results by date, domain name, etc.
  • Free credit is enough for testing and small projects
Best for
  • Provide real-time network search capabilities for AI Agents
  • Network data sources for building RAG systems
  • Data acquisition for research tools
  • Competitive product monitoring and industry information aggregation
  • Literature discovery for academic research

API basic usage

Exa provides a simple Python SDK that can integrate semantic search with just a few lines of code.

Scenario

Basic semantic search

Prompt example
from exa_py import Exa

exa = Exa(api_key="your-exa-api-key")

# Semantic search (not keyword search)
results = exa.search(
    "Latest breakthroughs in protein folding AI research",
    num_results=5,
    use_autoprompt=True # Automatically optimize queries
)

for result in results.results:
    print(f"Title: {result.title}")
    print(f"URL: {result.url}")
    print(f"Published time: {result.published_date}")
    print()
Output / what to expect

Returns 5 semantically related web pages,

Better understanding of query intent than keyword search,

The results are of higher quality.

Tips

use_autoprompt=True lets Exa automatically optimize the query, usually giving better results.

Scenario

Get the complete content of the web page

Prompt example
from exa_py import Exa

exa = Exa(api_key="your-exa-api-key")

# Search and get complete content
results = exa.search_and_contents(
    "AI regulation in Europe 2025",
    num_results=3,
    text=True, # Get the text of the article
    highlights=True, # Get key fragments
    start_published_date="2025-01-01" # Only content after 2025
)

for result in results.results:
    print(f"Title: {result.title}")
    print(f"Content summary: {result.text[:500]}...")
    print()
Output / what to expect

Get the full article content,

Can be used directly in RAG systems,

No additional web scraping steps required.

Tips

text=True will get the complete article content, which will consume more API quota and can be used on demand.

Integrated into AI Agent

The most common use of Exa is to provide real-time web search capabilities for AI agents.

Scenario

Using Exa in LangChain Agent

Prompt example
from langchain.tools import tool
from exa_py import Exa

exa = Exa(api_key="your-exa-key")

@tool
def search_web(query: str) -> str:
    """Search the web for the latest information"""
    results = exa.search_and_contents(
        query,
        num_results=3,
        text=True,
        start_published_date="2024-01-01"
    )
    
    output = ""
    for r in results.results:
        output += f"Source: {r.url}\n"
        output += f"Content: {r.text[:1000]}\n\n"
    return output

# Add the search_web tool to the Agent's tool list
Output / what to expect

Agent can call this tool to search for the latest information,

Addressing limitations on LLM knowledge deadlines,

Enable the Agent to answer questions about the latest events.

Tips

Limit the number of results per search (3-5) to avoid exceeding the context limits of LLM.

Compared with similar tools

ToolStrengthBest forPricing
Exa AI This toolGet complete content with high-quality semantic search designed for AI applicationsAI developer, build RAG system, AI Agent search toolFree 1000 times/month / Paid version
TavilySpecially optimized for AI Agent, the return format is more friendlyLangChain/LlamaIndex integration, Agent searchFree quota/paid version
SerpAPIGoogle search results, broad coverageRequires Google search resultspay per view
Perplexity APIAI comprehensive answers, not just search resultsSearches that require comprehensive AI analysisPaid version

Sources & references: