Implementation:CrewAIInc CrewAI Exa Search Tool
| Knowledge Sources | |
|---|---|
| Domains | Tools, Web_Search, AI_Services |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Searches the internet using Exa.ai's semantic search API with configurable filters and content retrieval options.
Description
EXASearchTool extends BaseTool to provide semantic internet search through the exa_py library. It initializes an Exa client with optional api_key and base_url (loaded from EXA_API_KEY and EXA_BASE_URL environment variables). The tool supports date range filtering via start_published_date and end_published_date, domain filtering via include_domains, and configurable search type (default: auto). When content mode is enabled, the tool uses search_and_contents() to fetch full page content with optional summary generation. The tool handles automatic installation of the exa_py package via uv if missing.
Usage
Use this tool when a CrewAI agent needs to access real-time internet information through semantic search. Suitable for research agents, fact-checking systems, and knowledge gathering workflows that need current web data with quality controls such as date ranges and domain filtering.
Code Reference
Source Location
- Repository: CrewAI
- File:
lib/crewai-tools/src/crewai_tools/tools/exa_tools/exa_search_tool.py - Lines: 1-135
Signature
class EXASearchTool(BaseTool):
name: str = "EXASearchTool"
description: str = "Search the internet using Exa"
args_schema: type[BaseModel] = EXABaseToolSchema
client: Any | None = None
content: bool | None = False
summary: bool | None = False
type: str | None = "auto"
api_key: str | None = ...
base_url: str | None = ...
def __init__(self, content: bool | None = False, summary: bool | None = False,
type: str | None = "auto", **kwargs): ...
def _run(self, search_query: str, start_published_date: str | None = None,
end_published_date: str | None = None,
include_domains: list[str] | None = None) -> Any: ...
Import
from crewai_tools import EXASearchTool
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| search_query | str | Yes | The semantic search query |
| start_published_date | str | No | Start date filter for results |
| end_published_date | str | No | End date filter for results |
| include_domains | list[str] | No | List of domains to restrict search results to |
| content | bool | No | Whether to fetch full page content (constructor param, default: False)
|
| summary | bool | No | Whether to include content summaries (constructor param, default: False)
|
| type | str | No | Search type (constructor param, default: auto)
|
Outputs
| Name | Type | Description |
|---|---|---|
| _run() returns | Any | Exa search results object; includes content and summaries if those modes are enabled |
Usage Examples
Basic Search
from crewai_tools import EXASearchTool
tool = EXASearchTool()
result = tool.run(search_query="latest advances in AI agents")
Search with Content and Filters
from crewai_tools import EXASearchTool
tool = EXASearchTool(content=True, summary=True)
result = tool.run(
search_query="machine learning best practices",
start_published_date="2025-01-01",
include_domains=["arxiv.org", "openai.com"],
)