feat: add Exa semantic search tool & enable Jina Reader free mode#1
Open
ignorejjj wants to merge 1 commit into
Open
feat: add Exa semantic search tool & enable Jina Reader free mode#1ignorejjj wants to merge 1 commit into
ignorejjj wants to merge 1 commit into
Conversation
- Add ExaSearchTool (src/tools/exa_search.py) using Exa's official MCP endpoint via Streamable HTTP transport (JSON-RPC). Works without API key; set EXA_API_KEY for higher rate limits. - Update Jina Reader to properly support free mode (20 RPM without key). Change startup log from WARNING to INFO since Jina works without a key. - Register ExaSearchTool in build_default_registry() with try/except guard. - Add exa_search config (default/max results) to settings.yaml and router. - No new dependencies required (uses existing httpx).
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.
Add Exa semantic search & enable Jina Reader free mode
Summary
This PR adds Exa Search as a new search tool and updates the Jina Reader integration to properly support free-mode usage (no API key required). Both changes are non-breaking — they extend the existing architecture without modifying any core interfaces.
Motivation
Search diversity: SearchClaw currently relies on Serper (Google) as its primary web search, falling back to DuckDuckGo HTML scraping when no API key is set. Adding Exa provides a complementary semantic search engine with different ranking and coverage, improving research quality — especially for natural-language queries and topic-focused searches.
Zero-config web fetching: The original code treated
JINA_API_KEYas effectively required — without it, the warning message implied Jina was unavailable and the system fell back to direct HTTP fetch (which can't handle JS-rendered pages or PDFs). In reality, Jina Reader works without an API key at 20 RPM. This PR makes that explicit, so SearchClaw works better out of the box.Changes
New:
src/tools/exa_search.pyA new
ExaSearchToolthat calls the official Exa MCP endpoint (https://mcp.exa.ai/mcp) using Streamable HTTP transport (JSON-RPC over HTTP). Key design decisions:httpx(already a project dependency) to send JSON-RPC requests directly. No MCP client library ormcporterCLI needed.EXA_API_KEYis set, it's appended to the URL for higher limits.Toolinterface as all other tools (input_schema,prompt(),validate_input(),call()). Registered as an optional tool inbuild_default_registry()with atry/except ImportErrorguard.research paper,news,company,personal site) for focused searches.is_concurrency_safe = True, consistent with other search tools.Modified:
src/tools/web_fetch.py_fetch_via_jina()docstring to document both modes: free mode (20 RPM, no key) and authenticated mode (200 RPM, withJINA_API_KEY).debug-level log when running in free mode for observability.Modified:
src/core/tool.pyExaSearchToolregistration tobuild_default_registry(), following the same optional-tool pattern used byAcademicSearchTool,NewsSearchTool, andWeChatSearchTool.Modified:
src/web/router.py_exa_search_default_resultsand_exa_search_max_resultsconfig variables (with defaults).build_default_registry().Modified:
src/main.pyJINA_API_KEYmissing log fromWARNINGtoINFO, clarifying that Jina still works in free mode.Modified:
config/settings.yamlexa_search_default_resultsandexa_search_max_resultsundertools:.OPTIONAL(wasRECOMMENDED), with a note that it works without a key. AddedEXA_API_KEYdocumentation.Files changed
src/tools/exa_search.pysrc/tools/web_fetch.pysrc/core/tool.pysrc/web/router.pysrc/main.pyconfig/settings.yamlHow to test
Non-breaking guarantees
web_search,web_fetch, and all other tools work exactly as before.httpxwhich is already inpyproject.toml.Toolbase class,ToolRegistry, or agent loop.settings.yamlfiles continue to work without changes.