Skip to content

feat: add Exa AI-powered search tool#164

Open
tgonzalezc5 wants to merge 1 commit into
dzhng:mainfrom
tgonzalezc5:feat/exa-search
Open

feat: add Exa AI-powered search tool#164
tgonzalezc5 wants to merge 1 commit into
dzhng:mainfrom
tgonzalezc5:feat/exa-search

Conversation

@tgonzalezc5

Copy link
Copy Markdown

Summary

Adds Exa as an alternative search provider alongside the existing Firecrawl integration. Exa is a neural search API designed for AI agents and exposes useful knobs for research workflows (search type, category filtering, domain filtering, date ranges) that often improve quality on technical or research-paper queries.

  • Introduces a small SearchProvider abstraction in src/search.ts so additional providers can be added without touching deep-research.ts.
  • Selectable via SEARCH_PROVIDER env var (firecrawl | exa). Firecrawl remains the default — existing setups are unchanged.
  • Exposes Exa's search types, content modes (text + highlights + summary with cascading fallback), category filtering, domain filtering, and date-range filtering through optional environment variables.
  • Adds unit tests using the repo's existing node:test framework.

Usage

In .env.local:

SEARCH_PROVIDER="exa"
EXA_API_KEY="your_exa_key"

# Optional tuning:
# EXA_SEARCH_TYPE="auto"          # auto | neural | fast | deep | deep-lite | deep-reasoning | instant
# EXA_CATEGORY="research paper"   # company | research paper | news | pdf | personal site | financial report | people
# EXA_INCLUDE_DOMAINS="arxiv.org,nature.com"
# EXA_EXCLUDE_DOMAINS="reddit.com"
# EXA_START_PUBLISHED_DATE="2024-01-01"
# EXA_END_PUBLISHED_DATE="2026-12-31"

Then npm start as usual.

Files changed

  • src/search.ts — new provider abstraction (Firecrawl + Exa).
  • src/search.test.ts — unit tests for response parsing, content fallback cascade, env-driven filters, and disabled state.
  • src/deep-research.ts — switched the search call site from firecrawl.search(...) to the unified search(...). No behavioral change for default (Firecrawl) users.
  • .env.example — documented SEARCH_PROVIDER and Exa env vars.
  • README.md — added a short "Using Exa as the search provider" section.
  • package.json / package-lock.json — adds exa-js dependency.

Test plan

  • `npx tsc --noEmit` passes
  • `npx tsx --test src/search.test.ts` — 14/14 passing
  • Default Firecrawl path unchanged (no env var changes required)
  • End-to-end run with a live Exa API key (requires reviewer's key)

Adds Exa (https://exa.ai) as an alternative search provider alongside
the existing Firecrawl integration. Selectable via SEARCH_PROVIDER env
var; Firecrawl remains the default so existing setups are unchanged.

Exposes Exa search type, content modes (text + highlights + summary
with cascading fallback), category filtering, domain filtering, and
date range filtering through optional environment variables.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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