Skip to content

feat: add Exa AI-powered search tool#3

Open
tgonzalezc5 wants to merge 3 commits into
opencmit:mainfrom
tgonzalezc5:feat/exa-search-integration
Open

feat: add Exa AI-powered search tool#3
tgonzalezc5 wants to merge 3 commits into
opencmit:mainfrom
tgonzalezc5:feat/exa-search-integration

Conversation

@tgonzalezc5
Copy link
Copy Markdown

@tgonzalezc5 tgonzalezc5 commented Apr 12, 2026

Summary

  • Add ExaSearchBackend as a new search engine option alongside BoCha and DuckDuckGo
  • Wire Exa into the AISearch auto-fallback chain (BoCha -> Exa -> DuckDuckGo)
  • Support Exa search types (auto, neural, fast, instant, deep variants), content modes (highlights, text, summary), category/domain/text filtering, and date ranges
  • Set x-exa-integration: alphora tracking header for API usage attribution
  • Add exa-py>=2.0.0 to pyproject.toml dependencies

Usage

from alphora.tools.builtin import WebSearcher

# Use Exa as the search engine
searcher = WebSearcher(exa_api_key="your-exa-api-key", engine="exa")
result = searcher.search("latest AI research", count=10)
print(result)

# Or use auto mode (BoCha -> Exa -> DuckDuckGo fallback)
searcher = WebSearcher(exa_api_key="your-exa-api-key", engine="auto")
result = searcher.search("quantum computing breakthroughs")

Set EXA_API_KEY environment variable to use Exa without passing the key explicitly.

Files Changed

  • alphora/tools/builtin/web_search.py: Add ExaSearchBackend class, update SearchEngine enum, wire into AISearch and WebSearcher
  • pyproject.toml: Add exa-py>=2.0.0 dependency

Test Plan

  • Verify ExaSearchBackend.search_web() returns valid SearchResponse with highlights
  • Verify ExaSearchBackend.search_news() uses category="news" correctly
  • Verify auto-fallback: BoCha -> Exa -> DuckDuckGo when backends fail
  • Verify engine="exa" routes to _search_exa() in AISearch
  • Verify missing EXA_API_KEY returns descriptive error message
  • Verify x-exa-integration: alphora header is set on client

tian-cmcc and others added 3 commits March 22, 2026 00:05
Add ExaSearchBackend as a new search engine alongside BoCha and
DuckDuckGo. Exa provides AI-powered web search with content extraction.

- Add ExaSearchBackend with web search and news search (via category)
- Wire into AISearch auto-fallback chain: BoCha -> Exa -> DuckDuckGo
- Support search types (auto, neural, fast, instant, deep variants),
  content modes (highlights, text, summary), category/domain/text
  filtering, and date ranges
- Set x-exa-integration tracking header for usage attribution
- Add exa-py>=2.0.0 to pyproject.toml dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants