Skip to content

feat(example): add Exa-powered web search via ChatService#279

Open
tgonzalezc5 wants to merge 1 commit intoFellouAI:mainfrom
tgonzalezc5:feature/exa-web-search
Open

feat(example): add Exa-powered web search via ChatService#279
tgonzalezc5 wants to merge 1 commit intoFellouAI:mainfrom
tgonzalezc5:feature/exa-web-search

Conversation

@tgonzalezc5
Copy link
Copy Markdown

Summary

  • Adds ExaChatService, a drop-in ChatService implementation powered by Exa (AI-native search engine) so Eko's built-in WebSearchTool returns real, structured search results instead of empty arrays
  • Uses the exa-js SDK v2 with search() + highlights for token-efficient agent pipelines
  • Includes the x-exa-integration: eko header for integration-level usage tracking (see also HKUDS/CLI-Anything#205 for the same pattern in another open-source integration)
  • Wires into the Node.js example with a single env var (EXA_API_KEY)

How it works

Eko's WebSearchTool delegates to global.chatService.websearch(), which currently returns [] in the example SimpleChatService. This PR provides a real implementation:

import { ExaChatService } from './exa-chat-service';
global.chatService = new ExaChatService(); // reads EXA_API_KEY from env

Exa results are mapped to Eko's WebSearchResult type (title, url, snippet, content), and highlights are used as the snippet for optimal token efficiency.

Files changed

File Change
example/nodejs/src/exa-chat-service.ts New ExaChatService implementation
example/nodejs/src/index.ts Wire up Exa when EXA_API_KEY is set
example/nodejs/package.json Add exa-js dependency

Test plan

  • Set EXA_API_KEY in .env and run the Node.js example
  • Verify WebSearchTool returns Exa results (title, url, snippet, content)
  • Verify example still works without EXA_API_KEY (graceful no-op)

Get an API key

Free keys available at dashboard.exa.ai/api-keys


Disclosure: I work at Exa. Happy to iterate on feedback.

Implements ExaChatService using the exa-js SDK so Eko's built-in
WebSearchTool returns real search results instead of empty arrays.
Includes the x-exa-integration header for usage tracking.

Co-Authored-By: Claude Opus 4.6 (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