feat: add Exa as an optional search provider#1480
Open
tgonzalezc5 wants to merge 1 commit intoagent0ai:mainfrom
Open
feat: add Exa as an optional search provider#1480tgonzalezc5 wants to merge 1 commit intoagent0ai:mainfrom
tgonzalezc5 wants to merge 1 commit intoagent0ai:mainfrom
Conversation
When EXA_API_KEY is set, the search_engine tool uses Exa's neural search instead of SearXNG. Falls back to SearXNG automatically if the key is missing or if an Exa request fails. - Add helpers/exa_search.py with highlights-based content retrieval - Add exa-py to requirements.txt - Modify SearchEngine to check for Exa availability at call time Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds Exa as an optional, drop-in search provider for the
search_enginetool. WhenEXA_API_KEYis set in the environment (orusr/.env), the agent automatically uses Exa's neural search instead of SearXNG. If the key is absent or a request fails, it falls back to SearXNG transparently.Why Exa? Exa is an AI-native search engine built on neural embeddings. It returns semantically relevant results rather than keyword matches, which is a better fit for agent workloads where queries are natural-language questions. Highlights mode keeps token usage efficient.
Changes
helpers/exa_search.py(new) — Thin async wrapper around theexa-pySDK. Returns results in the same{title, url, content}format the existingformat_result_searxngexpects, so no prompt or downstream changes are needed.tools/search_engine.py— Checksexa_search.is_available()at call time. Routes to Exa when configured; falls back to SearXNG on missing key or request error.requirements.txt— Addsexa-py>=1.0.0.Design decisions
EXA_API_KEYsee no difference.models.get_api_key("exa")so it picks upAPI_KEY_EXA,EXA_API_KEY, orEXA_API_TOKENautomatically, consistent with how other API keys are managed in Agent Zero.x-exa-integration: agent-zeroheader for integration-level usage tracking on Exa's side. (See also: HKUDS/CLI-Anything#205 for the same pattern in another open-source integration.)Setup
# In usr/.env or your shell environment: EXA_API_KEY=your-key-hereGet a free key at https://dashboard.exa.ai/api-keys
Test plan
EXA_API_KEY: search works exactly as before (SearXNG)EXA_API_KEY: search returns Exa results (title/url/highlight)EXA_API_KEY: gracefully falls back to SearXNGpip install -r requirements.txtinstallsexa-pywithout conflicts