Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
docs: update Exa Search Tool page with improved naming, description, and configuration options (#4800)
Tanishq0b07b4c45fc5
diff --git a/docs/en/tools/search-research/exasearchtool.mdx b/docs/en/tools/search-research/exasearchtool.mdxindex fe180baef..3136cdcbb 100644--- a/docs/en/tools/search-research/exasearchtool.mdx+++ b/docs/en/tools/search-research/exasearchtool.mdx@@ -1,53 +1,110 @@----title: EXA Search Web Loader-description: The `EXASearchTool` is designed to perform a semantic search for a specified query from a text's content across the internet.-icon: globe-pointer+title: "Exa Search Tool"+description: "Search the web using the Exa Search API to find the most relevant results for any query, with options for full page content, highlights, and summaries."+icon: "magnifying-glass"mode: "wide"----# `EXASearchTool`--## Description--The EXASearchTool is designed to perform a semantic search for a specified query from a text's content across the internet.-It utilizes the [exa.ai](https://exa.ai/) API to fetch and display the most relevant search results based on the query provided by the user.+The `EXASearchTool` lets CrewAI agents search the web using the [Exa](https://exa.ai/) search API. It returns the most relevant results for any query, with options for full page content and AI-generated summaries.## Installation-To incorporate this tool into your project, follow the installation instructions below:+Install the CrewAI tools package:```shellpip install 'crewai[tools]'```-## Example+## Environment Variables++Set your Exa API key as an environment variable:++```bash+export EXA_API_KEY='your_exa_api_key'+```-The following example demonstrates how to initialize the tool and execute a search with a given query:+Get an API key from the [Exa dashboard](https://dashboard.exa.ai/api-keys).-```python Code+## Example Usage++Here's how to use the `EXASearchTool` within a CrewAI agent:++```python+import os+from crewai import Agent, Task, Crewfrom crewai_tools import EXASearchTool-# Initialize the tool for internet searching capabilities-tool = EXASearchTool()+# Initialize the tool+exa_tool = EXASearchTool()++# Create an agent that uses the tool+researcher = Agent(+ role='Research Analyst',+ goal='Find the latest information on any topic',+ backstory='An expert researcher who finds the most relevant and up-to-date information.',+ tools=[exa_tool],+ verbose=True+)++# Create a task for the agent+research_task = Task(+ description='Find the top 3 recent breakthroughs in quantum computing.',+ expected_output='A summary of the top 3 breakthroughs with source URLs.',+ agent=researcher+)++# Form the crew and kick it off+crew = Crew(+ agents=[researcher],+ tasks=[research_task],+ verbose=True+)++result = crew.kickoff()+print(result)```-## Steps to Get Started+## Configuration Options++The `EXASearchTool` accepts the following parameters during initialization:++- `type` (str, optional): The search type to use. Defaults to `"auto"`. Options: `"auto"`, `"instant"`, `"fast"`, `"deep"`.+- `content` (bool, optional): Whether to include full page content in results. Defaults to `False`.+- `summary` (bool, optional): Whether to include AI-generated summaries of each result. Requires `content=True`. Defaults to `False`.+- `api_key` (str, optional): Your Exa API key. Falls back to the `EXA_API_KEY` environment variable if not provided.+- `base_url` (str, optional): Custom API server URL. Falls back to the `EXA_BASE_URL` environment variable if not provided.++When calling the tool (or when an agent invokes it), the following search parameters are available:-To effectively use the EXASearchTool, follow these steps:+- `search_query` (str): **Required**. The search query string.+- `start_published_date` (str, optional): Filter results published after this date (ISO 8601 format, e.g. `"2024-01-01"`).+- `end_published_date` (str, optional): Filter results published before this date (ISO 8601 format).+- `include_domains` (list[str], optional): A list of domains to restrict the search to.-<Steps>- <Step title="Package Installation">- Confirm that the `crewai[tools]` package is installed in your Python environment.- </Step>- <Step title="API Key Acquisition">- Acquire a [exa.ai](https://exa.ai/) API key by registering for a free account at [exa.ai](https://exa.ai/).- </Step>- <Step title="Environment Configuration">- Store your obtained API key in an environment variable named `EXA_API_KEY` to facilitate its use by the tool.- </Step>-</Steps>+## Advanced Usage++You can configure the tool with custom parameters for richer results:++```python+# Get full page content with AI summaries+exa_tool = EXASearchTool(+ content=True,+ summary=True,+ type="deep"+)++# Use it in an agent+agent = Agent(+ role="Deep Researcher",+ goal="Conduct thorough research with full content and summaries",+ tools=[exa_tool]+)+```-## Conclusion+## Features-By integrating the `EXASearchTool` into Python projects, users gain the ability to conduct real-time, relevant searches across the internet directly from their applications.-By adhering to the setup and usage guidelines provided, incorporating this tool into projects is streamlined and straightforward.+- **Semantic Search**: Find results based on meaning, not just keywords+- **Full Content Retrieval**: Get the full text of web pages alongside search results+- **AI Summaries**: Get concise, AI-generated summaries of each result+- **Date Filtering**: Limit results to specific time periods with published date filters+- **Domain Filtering**: Restrict searches to specific domains