Skip to content

feat(search): add Exa AI as web search provider#265

Open
6tizer wants to merge 1 commit into
nashsu:mainfrom
6tizer:feat/add-exa-search-provider
Open

feat(search): add Exa AI as web search provider#265
6tizer wants to merge 1 commit into
nashsu:mainfrom
6tizer:feat/add-exa-search-provider

Conversation

@6tizer
Copy link
Copy Markdown

@6tizer 6tizer commented May 26, 2026

Summary

  • Add Exa as a web search provider option for Deep Research
  • Exa returns full page content via its contents.text API, giving the LLM synthesis stage richer material than short snippets from other providers

Changes

  • src/stores/wiki-store.ts — Add "exa" to SearchProvider type union
  • src/lib/web-search.ts — Implement exaSearch() function using x-api-key header auth, contents: { text: true } request; add switch case and API key validation
  • src/components/settings/sections/web-search-section.tsx — Add Exa entry to SEARCH_PROVIDERS array (API key only, no additional config needed)
  • src/lib/web-search.test.ts — Update validation error message assertion

Technical Details

  • Auth: x-api-key header (not in request body, not Bearer token)
  • Endpoint: POST https://api.exa.ai/search
  • Response mapping: r.text || r.highlights?.[0] || r.summary || "" → snippet fallback chain
  • Error handling: Dedicated 401 auth error, network error via isFetchNetworkError(), generic HTTP error with status code

Test plan

  • TypeScript compilation passes with 0 errors
  • web-search.test.ts — 12/12 tests pass
  • Manual: Settings → Web Search → Exa appears as provider option
  • Manual: Configure Exa API key → run Deep Research → verify results with full page content
  • Verify no regressions in existing Tavily/SerpApi/SearXNG/Ollama providers

🤖 Generated with Claude Code
via Happy

Add Exa (exa.ai) as a search provider option for Deep Research.
Exa returns full page content via its contents API, giving the
LLM synthesis stage richer material than short snippets.

Changes:
- Add "exa" to SearchProvider type union
- Implement exaSearch() with x-api-key auth, contents.text request
- Add Exa entry to Settings UI provider list
- Update validation error messages and test assertions

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
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.

1 participant