Prerequisites
The following examples require theexa-py library and an API key which can be obtained from Exa.
Example
The following agent will search Exa for AAPL news and print the response.cookbook/tools/exa_tools.py
Toolkit Functions
| Function | Description | 
|---|---|
| search_exa | Searches Exa for a query with optional category filtering | 
| get_contents | Retrieves detailed content from specific URLs | 
| find_similar | Finds similar content to a given URL | 
| exa_answer | Gets an AI-powered answer to a question using Exa search results | 
Toolkit Parameters
| Parameter | Type | Default | Description | 
|---|---|---|---|
| search | bool | True | Enable search functionality | 
| get_contents | bool | True | Enable content retrieval | 
| find_similar | bool | True | Enable finding similar content | 
| answer | bool | True | Enable AI-powered answers | 
| text | bool | True | Include text content in results | 
| text_length_limit | int | 1000 | Maximum length of text content per result | 
| highlights | bool | True | Include highlighted snippets | 
| summary | bool | False | Include result summaries | 
| num_results | Optional[int] | None | Default number of results | 
| livecrawl | str | "always" | Livecrawl behavior | 
| start_crawl_date | Optional[str] | None | Include results crawled after date (YYYY-MM-DD) | 
| end_crawl_date | Optional[str] | None | Include results crawled before date (YYYY-MM-DD) | 
| start_published_date | Optional[str] | None | Include results published after date (YYYY-MM-DD) | 
| end_published_date | Optional[str] | None | Include results published before date (YYYY-MM-DD) | 
| use_autoprompt | Optional[bool] | None | Enable autoprompt features | 
| type | Optional[str] | None | Content type filter (e.g., article, blog, video) | 
| category | Optional[str] | None | Category filter (e.g., news, research paper) | 
| include_domains | Optional[List[str]] | None | Restrict results to these domains | 
| exclude_domains | Optional[List[str]] | None | Exclude results from these domains | 
| show_results | bool | False | Log search results for debugging | 
| model | Optional[str] | None | Search model to use (‘exa’ or ‘exa-pro’) | 
Categories
Available categories for filtering:- company
- research paper
- news
- github
- tweet
- personal site
- linkedin profile
- financial report