Tool

Search and Summarize Web Content with Exa

Search the web and retrieve highlighted content for LLM agents via the Exa search API.

Works with exaopenai

82
Spark score
out of 100
Updated 2 days ago
Version 0.14.23
Models

Add to Favorites

Why it matters

Leverage the Exa web search API to enable AI agents to search the internet, retrieve HTML content, and summarize findings. This integration allows for efficient information gathering and processing for complex queries.

Outcomes

What it gets done

01

Search the web using natural language queries via Exa.

02

Retrieve and process HTML content from search results.

03

Find similar documents based on provided URLs.

04

Summarize news and web content for agent consumption.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/li-tool-tools-exa | bash

Overview

LlamaIndex Tools Integration: Exa

A LlamaIndex tool for the Exa search API, covering web search, full document retrieval, highlight extraction, and a date utility. Use for time-relative web search where the agent needs current content, full documents, or short highlights.

What it does

The Exa LlamaIndex Tool connects an agent to Exa, described in the source as one of the best web search APIs for AI, letting the agent search the internet and pull HTML content from the results. The ExaToolSpec exposes five functions covering search, retrieval, and a small utility.

search searches the web using Exa for a list of articles relating to a natural-language query. retrieve_documents retrieves the full list of documents returned from a prior exa_search call. search_and_retrieve_highlights searches and retrieves query-relevant highlights from the results, rather than full documents. search_and_retrieve_documents combines search and document retrieval into one step, directly returning a list of documents related to a search. current_date is a small utility that gives the agent today's date, useful for grounding time-relative queries like "latest" or "last month".

When to use - and when NOT to

Use search when the agent just needs a list of relevant articles for a query. Use search_and_retrieve_documents when you want full document content in one call instead of a separate search-then-retrieve round trip. Use search_and_retrieve_highlights specifically when you want short, query-relevant excerpts rather than entire documents - useful for summarization tasks where full page content would be excessive. Pair with current_date whenever the query is time-relative, so the agent has a concrete reference point for "recent" or "latest". Do not use it for content that requires authentication or is behind a paywall - Exa searches and retrieves publicly accessible web content.

Capabilities

Five tools: search (article search by query), retrieve_documents (full documents from a prior search), search_and_retrieve_highlights (query-relevant excerpts), search_and_retrieve_documents (combined search and retrieval), and current_date (today's date for time-relative grounding).

How to install

An API key from the Exa developer dashboard is required before use, passed to ExaToolSpec or set as the EXA_API_KEY environment variable.

from llama_index.tools.exa import ExaToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

exa_tool = ExaToolSpec(
    api_key=os.environ["EXA_API_KEY"],
)
agent = FunctionAgent(
    tools=exa_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

Who it's for

Developers building LlamaIndex agents that need current web search results and content - full documents or short highlights - grounded in a real, dated query rather than the model's training data.

Source README

LlamaIndex Tools Integration: Exa

This tool connects to Exa, one of the best web search APIs for AI, to easily enable
your agent to search and get HTML content from the Internet.

To begin, you need to obtain an API key on the Exa developer dashboard.

Usage

This tool has more a extensive example usage documented in a Jupyter notebook here

Here's an example usage of the ExaToolSpec.

### %pip install llama-index llama-index-core llama-index-tools-exa

from llama_index.tools.exa import ExaToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

exa_tool = ExaToolSpec(
    api_key=os.environ["EXA_API_KEY"],
)
agent = FunctionAgent(
    tools=exa_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(
    await agent.run(
        "Can you summarize the news published in the last month on superconductors"
    )
)

search: Search the web using Exa for a list of articles relating to a natural language query

retrieve_documents: Retrieve a list of documents returned from exa_search.

search_and_retrieve_highlights: Search and retrieve query-relevant highlights from results.

search_and_retrieve_documents: Combines search and retrieve_documents to directly return a list of documents related to a search

current_date: Utility for the Agent to get todays date

This loader is designed to be used as a way to load data as a Tool in a Agent.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.