Exa

ExaTools enable an Agent to search the web using Exa, retrieve content from URLs, find similar content, and get AI-powered answers.

Prerequisites

The following examples require the exa-py library and an API key which can be obtained from Exa.

1uv pip install -U exa-py
1export EXA_API_KEY=***

Example

The following agent will search Exa for AAPL news and print the response.

1from kern.agent import Agent
2from kern.tools.exa import ExaTools
3
4agent = Agent(
5 tools=[ExaTools(
6 include_domains=["cnbc.com", "reuters.com", "bloomberg.com"],
7 category="news",
8 show_results=True,
9 text_length_limit=1000,
10 )],
11 )
12agent.print_response("Search for AAPL news", markdown=True)

Toolkit Functions

FunctionDescription
search_exaSearches Exa for a query with optional category filtering
get_contentsRetrieves detailed content from specific URLs
find_similarFinds similar content to a given URL
exa_answerGets an AI-powered answer to a question using Exa search results

Toolkit Params

ParameterTypeDefaultDescription
enable_searchboolTrueEnable search functionality
enable_get_contentsboolTrueEnable content retrieval
enable_find_similarboolTrueEnable finding similar content
enable_answerboolTrueEnable AI-powered answers
enable_researchboolTrueEnable research functionality
allboolFalseEnable all functionality
textboolTrueInclude text content in results
text_length_limitint1000Maximum length of text content per result
highlightsboolTrueInclude highlighted snippets
summaryboolFalseInclude result summaries
num_resultsOptional[int]NoneDefault number of results
livecrawlstr"always"Livecrawl behavior
start_crawl_dateOptional[str]NoneInclude results crawled after date (YYYY-MM-DD)
end_crawl_dateOptional[str]NoneInclude results crawled before date (YYYY-MM-DD)
start_published_dateOptional[str]NoneInclude results published after date (YYYY-MM-DD)
end_published_dateOptional[str]NoneInclude results published before date (YYYY-MM-DD)
use_autopromptOptional[bool]NoneEnable autoprompt features
typeOptional[str]NoneContent type filter (e.g., article, blog, video)
categoryOptional[str]NoneCategory filter (e.g., news, research paper)
include_domainsOptional[List[str]]NoneRestrict results to these domains
exclude_domainsOptional[List[str]]NoneExclude results from these domains
show_resultsboolFalseLog search results for debugging
modelOptional[str]NoneSearch model to use ('exa' or 'exa-pro')

Categories

Available categories for filtering:

  • company
  • research paper
  • news
  • pdf
  • github
  • tweet
  • personal site
  • linkedin profile
  • financial report

Developer Resources