7.9 KiB
Exa API Options Audit
Date: 2025-01-29
Status: Comparison of Current Implementation vs Exa API Documentation
📊 Summary
This document compares our current Exa implementation with the official Exa API documentation to identify missing options and configuration gaps.
✅ Currently Supported Options
Main Search Parameters
-
✅
type- Search type (auto, neural, fast, deep)- Frontend:
exa_search_typedropdown - Backend:
config.exa_search_type→typeparameter - Status: Fully supported
- Frontend:
-
✅
category- Content category filter- Frontend:
exa_categorydropdown - Backend:
config.exa_category→categoryparameter - Status: Fully supported
- Frontend:
-
✅
numResults- Number of results (5-100)- Frontend:
exa_num_resultsinput (5-25 limit shown, but API supports up to 100) - Backend: Uses
config.max_sources(capped at 25), should useconfig.exa_num_results - Status: Partially supported (needs to use
exa_num_resultsinstead ofmax_sources)
- Frontend:
-
✅
includeDomains- Domain inclusion filter- Frontend:
exa_include_domainstext input - Backend:
config.exa_include_domains→include_domainsparameter - Status: Fully supported
- Frontend:
-
✅
excludeDomains- Domain exclusion filter- Frontend:
exa_exclude_domainstext input - Backend:
config.exa_exclude_domains→exclude_domainsparameter - Status: Fully supported
- Frontend:
Contents Parameters (Currently Hardcoded)
-
⚠️
text- Full page text retrieval- Current: Hardcoded to
{'max_characters': 1000} - Should be: Configurable via
exa_text_max_charactersandexa_text_include_html - Status: Needs configuration
- Current: Hardcoded to
-
⚠️
highlights- Text snippets extraction- Current: Hardcoded to
{'num_sentences': 2, 'highlights_per_url': 3} - Should be: Configurable via
exa_highlights_num_sentences,exa_highlights_per_url,exa_highlights_query - Status: Needs configuration (we have
exa_highlightsboolean but not the detailed config)
- Current: Hardcoded to
-
⚠️
summary- Webpage summary- Current: Hardcoded to
{'query': f"Key insights about {topic}"} - Should be: Configurable via
exa_summary_queryandexa_summary_schema - Status: Needs configuration
- Current: Hardcoded to
-
⚠️
context- Context string for RAG- Current: Not used (we have
exa_contextboolean in config but not applied) - Should be: Configurable via
exa_context(boolean) orexa_context_max_characters(object) - Status: Partially supported (config exists but not used)
- Current: Not used (we have
❌ Missing Options
Date Filters
-
❌
startPublishedDate- Filter by publish date (start)- Frontend: We have
exa_date_filterbut it's not being used - Backend: Not passed to Exa API
- Status: Config exists but not implemented
- Frontend: We have
-
❌
endPublishedDate- Filter by publish date (end)- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
startCrawlDate- Filter by crawl date (start)- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
endCrawlDate- Filter by crawl date (end)- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
Text Filters
-
❌
includeText- Text that must be present in results- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
excludeText- Text that must not be present in results- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
Advanced Options
-
❌
userLocation- Two-letter ISO country code- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
moderation- Content moderation filter- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
additionalQueries- Additional queries for deep search- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing (only works with
type="deep")
Contents Advanced Options
-
❌
livecrawl- Live crawling options (never, fallback, preferred, always)- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
livecrawlTimeout- Timeout for live crawling (ms)- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
subpages- Number of subpages to crawl- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
subpageTarget- Term to find specific subpages- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
-
❌
extras- Extra parameters (links, imageLinks)- Frontend: Not exposed
- Backend: Not implemented
- Status: Missing
🔧 Implementation Gaps
1. Date Filter Not Applied
- Issue:
exa_date_filterexists in config but is not passed to Exa API - Fix: Map
exa_date_filter→startPublishedDateinexa_provider.py
2. Context Not Applied
- Issue:
exa_contextboolean exists but is not used - Fix: Apply
contextparameter based onexa_contextvalue
3. Num Results Uses Wrong Field
- Issue: Uses
config.max_sourcesinstead ofconfig.exa_num_results - Fix: Use
config.exa_num_resultsif available, fallback tomax_sources
4. Contents Parameters Hardcoded
- Issue:
text,highlights,summaryare hardcoded - Fix: Make them configurable via ResearchConfig
📋 Recommended Priority
Priority 1: Fix Existing Config Not Applied
- ✅ Apply
exa_date_filter→startPublishedDate - ✅ Apply
exa_context→context - ✅ Use
exa_num_resultsinstead ofmax_sources
Priority 2: Make Contents Configurable
- ✅ Make
text.max_charactersconfigurable - ✅ Make
highlightsconfigurable (num_sentences, highlights_per_url, query) - ✅ Make
summary.queryconfigurable
Priority 3: Add Common Date Filters
- ✅ Add
endPublishedDatesupport - ✅ Add
startCrawlDate/endCrawlDatesupport (if needed)
Priority 4: Add Text Filters (If Needed)
- ✅ Add
includeText/excludeTextsupport (if needed)
Priority 5: Advanced Options (Low Priority)
- ✅ Add
userLocation,moderation,livecrawl,subpages,extras(if needed)
🎯 Current Status
Total Exa API Options: ~23 options
Currently Supported: 5 fully, 4 partially
Missing: 14 options
Hardcoded: 3 options (text, highlights, summary)
Recommendation: Focus on Priority 1 and 2 to make existing config work and make contents configurable.
✅ Recent Fixes (2025-01-29)
Fixed Critical Issues
- ✅ Updated
typeenum: Removeddeep, addedkeywordandfastto match latest API - ✅ Updated
categoryenum: Removedmovieandsong, keptlinkedin profile - ✅ Applied
exa_date_filter: Now maps tostart_published_dateparameter - ✅ Applied
exa_context: Now properly passed to Exa API when enabled - ✅ Fixed
exa_num_results: Now usesexa_num_resultsinstead ofmax_sources, supports up to 100 results - ✅ Updated frontend: Added
fastoption, updated category list, increased num_results limit to 100
Updated Files
backend/services/research/intent/unified_research_analyzer.py- Updated AI prompt enum valuesbackend/services/blog_writer/research/exa_provider.py- Applied date filter, context, and num_resultsfrontend/src/components/Research/steps/utils/constants.ts- Updated search types and categoriesfrontend/src/components/Research/steps/components/ExaOptions.tsx- Updated num_results limit and type handling