Most AI agents need to search the web. The standard approach — wrapping a Google or Bing search API, extracting URLs, fetching pages — works but produces keyword-matched results optimised for advertising rather than relevance to a reasoning task. Exa (formerly Metaphor) takes a different approach: instead of matching keywords, it retrieves content that is similar to your query in meaning and context.
For agents doing research, competitive analysis, or any task where the goal is “find the most relevant documents on this topic,” that distinction matters.
What Exa Actually Does
Exa is a search API built around embeddings. When you query Exa, it performs semantic similarity search against an index of the web rather than lexical matching. The result is that it finds content that is topically and contextually related to your query, not just pages that contain your exact search terms.
This is particularly useful for AI agent research workflows because agents typically issue queries derived from a reasoning process — often phrased as statements or questions rather than optimised search strings. A keyword search API rewards the user who knows how to phrase queries; Exa rewards the content that matches the intent.
Exa offers four search modes:
Neural (default): Embedding-based semantic search. Best for open-ended research where you want conceptually related documents.
Keyword: Traditional keyword matching. Better when you know exactly what you’re looking for — a specific product name, a known entity, an exact phrase.
Auto: Exa’s router selects neural or keyword based on the query type. Generally the right default for agent tools where you don’t control query phrasing.
Category: Restricts results to a specific content type — research papers, news articles, GitHub repos, Twitter/X posts, PDFs.
Pricing runs from $5 per 1,000 neural searches to $15 per 1,000 for content retrieval (fetching the full text of results). For agent workflows processing hundreds of research queries, costs add up, but are typically lower than the alternative of fetching and parsing raw web pages.
Exa vs. Traditional Search APIs
The practical difference shows up clearly in research-oriented queries. Ask a keyword search engine “what are the limitations of RAG for long-document retrieval” and you’ll get pages that rank for SEO on those keywords — often overview articles, listicles, and vendor marketing. Ask Exa the same query and you get research papers, blog posts from practitioners, and technical discussions that actually address the question.
Exa does not replace keyword search for everything. If an agent needs to find “the current EUR/USD exchange rate” or “OpenAI’s latest pricing page,” keyword search wins on precision. The Auto mode handles this reasonably well but is not perfect.
The content retrieval feature is what makes Exa particularly useful for agents. Rather than getting a list of URLs and having to fetch each one, parse HTML, and extract text, Exa can return cleaned page content directly — similar to what Firecrawl does, but integrated into the search step.
Integration Patterns
Direct API in Python
from exa_py import Exa
exa = Exa(api_key="your-api-key")
# Search and retrieve content in one call
results = exa.search_and_contents(
"limitations of RAG for long-document retrieval in production",
num_results=5,
type="auto",
text={"max_characters": 2000}
)
for result in results.results:
print(f"Title: {result.title}")
print(f"URL: {result.url}")
print(f"Content: {result.text[:500]}")
print()
The search_and_contents method combines search and retrieval in a single API call. For agent tools, this is the right pattern — one call returns everything the LLM needs.
As an Agent Tool
from exa_py import Exa
from anthropic import Anthropic
exa = Exa(api_key="your-exa-key")
client = Anthropic()
def search_web(query: str, num_results: int = 5) -> str:
results = exa.search_and_contents(
query,
num_results=num_results,
type="auto",
text={"max_characters": 1500},
highlights={"num_sentences": 3}
)
output = []
for r in results.results:
output.append(f"**{r.title}** ({r.url})\n{r.text}")
return "\n\n---\n\n".join(output)
tools = [
{
"name": "search_web",
"description": "Search the web for current information on a topic. Returns relevant articles and their content.",
"input_schema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The research question or topic to search for"
}
},
"required": ["query"]
}
}
]
The highlights parameter is useful here — it asks Exa to return the most relevant sentences from each page alongside the full text, giving the LLM a quick summary before it decides whether to read further.
MCP Integration
Exa publishes an official MCP server, which means you can connect it directly to Claude Desktop, Claude Code, or any MCP-compatible agent framework without writing any glue code. The server exposes Exa’s search and content retrieval as tools that the LLM can call natively.
For teams using LangChain, LlamaIndex, or CrewAI, there are also maintained community integrations that wrap Exa as a standard tool.
Date-Filtered Research
One of the more useful features for agents doing news monitoring or competitive intelligence is date-based filtering:
from datetime import datetime, timedelta
results = exa.search_and_contents(
"enterprise AI agent deployments production challenges",
num_results=10,
type="neural",
start_published_date=(datetime.now() - timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ"),
text={"max_characters": 2000}
)
This restricts results to content published in the last 30 days — essential for research agents that need current information rather than evergreen content.
Finding Similar Content
Exa’s find_similar endpoint is a useful capability with no equivalent in traditional search APIs. Given a URL, it finds web content that is most similar:
similar = exa.find_similar_and_contents(
"https://some-relevant-research-paper.com",
num_results=5,
text={"max_characters": 1500}
)
For agents building literature reviews, tracking competitors, or following specific research threads, this turns a single good source into a starting point for a broader corpus.
When to Use Exa vs. Alternatives
Exa’s neural search wins when:
- The query is a natural-language research question rather than a search string
- You want semantic relevance over SEO ranking
- You need content retrieval without a separate scraping step
- You’re finding expert or practitioner content rather than popular/evergreen pages
Stick with traditional search APIs when:
- Precision on known entities matters (specific company names, products, official pages)
- You need news results from the last few hours
- SEO-ranked “best” results are actually what you want (top tools lists, tutorials)
For most research-oriented agent workflows, the combination works better than either alone: use Exa for open-ended research queries, use a keyword search API for lookup tasks.