
Exa AI — User Guide
Semantic search API for apps.
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.
Basic semantic search
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()Returns 5 semantically related web pages,
Better understanding of query intent than keyword search,
The results are of higher quality.
use_autoprompt=True lets Exa automatically optimize the query, usually giving better results.
Get the complete content of the web page
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()Get the full article content,
Can be used directly in RAG systems,
No additional web scraping steps required.
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.
Using Exa in LangChain Agent
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 listAgent 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.
Limit the number of results per search (3-5) to avoid exceeding the context limits of LLM.
Compared with similar tools
| Tool | Strength | Best for | Pricing |
|---|---|---|---|
| Exa AI This tool | Get complete content with high-quality semantic search designed for AI applications | AI developer, build RAG system, AI Agent search tool | Free 1000 times/month / Paid version |
| Tavily | Specially optimized for AI Agent, the return format is more friendly | LangChain/LlamaIndex integration, Agent search | Free quota/paid version |
| SerpAPI | Google search results, broad coverage | Requires Google search results | pay per view |
| Perplexity API | AI comprehensive answers, not just search results | Searches that require comprehensive AI analysis | Paid version |
Sources & references:
- Exa AI official website (2025-03)
- Exa Python SDK documentation (2025-03)