> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swarms.world/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Search with Exa

> Give your agents real-time web search using the Exa API for up-to-date knowledge.

Exa is a powerful web search API that provides real-time access to current web information. It allows AI agents to search the internet and retrieve up-to-date information on any topic, making it an essential tool for agents that need current knowledge beyond their training data.

Key features of Exa:

| Feature                    | Description                                                   |
| -------------------------- | ------------------------------------------------------------- |
| **Real-time search**       | Access the latest information from the web                    |
| **Semantic search**        | Find relevant results using natural language queries          |
| **Comprehensive coverage** | Search across billions of web pages                           |
| **Structured results**     | Get clean, formatted search results for easy processing       |
| **API integration**        | Simple REST API for seamless integration with AI applications |

## Install

```bash theme={null}
pip3 install -U swarms swarms-tools
```

## ENV

```txt theme={null}
# Get your API key from exa
EXA_SEARCH_API=""

OPENAI_API_KEY=""

WORKSPACE_DIR=""
```

## Code

```python theme={null}
from swarms import Agent
from swarms_tools import exa_search


agent = Agent(
    name="Exa Search Agent",
    llm="gpt-5.4",
    tools=[exa_search],
)

out = agent.run("What are the latest experimental treatments for diabetes?")
print(out)
```
