Adds Exa as an additional option for web search and Google Scholar
search in inference/, alongside the existing Serper backend. Behavior
is selected at runtime via the SEARCH_PROVIDER environment variable
and defaults to "serper" so existing deployments are unaffected.
- inference/tool_exa.py: Exa client wrapper, typed ExaResult dataclass,
shared snippet/result formatting helpers used by both tool_search
and tool_scholar
- inference/tool_search.py: route to Exa when SEARCH_PROVIDER=exa
- inference/tool_scholar.py: route to Exa (research-paper category)
when SEARCH_PROVIDER=exa
- requirements.txt: add exa-py>=2.0.0
- .env.example: document SEARCH_PROVIDER and EXA_API_KEY
- inference/tests/test_tool_exa.py: unit tests for response parsing,
snippet fallback, integration header, and missing-key behavior
Summary
Adds Exa as an additional option for web search and Google Scholar search in inference/, alongside the existing Serper backend. Selection is runtime via the SEARCH_PROVIDER environment variable and defaults to serper, so existing deployments are unaffected.
Usage
# .env SEARCH_PROVIDER=exa EXA_API_KEY=your_exa_keyWhen SEARCH_PROVIDER is unset or set to serper, the existing Serper code path is used unchanged.
Files changed
Test plan