feat(example): add Exa-powered web search via ChatService#279
Open
tgonzalezc5 wants to merge 1 commit intoFellouAI:mainfrom
Open
feat(example): add Exa-powered web search via ChatService#279tgonzalezc5 wants to merge 1 commit intoFellouAI:mainfrom
tgonzalezc5 wants to merge 1 commit intoFellouAI:mainfrom
Conversation
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>
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.
Summary
ExaChatService, a drop-inChatServiceimplementation powered by Exa (AI-native search engine) so Eko's built-inWebSearchToolreturns real, structured search results instead of empty arraysexa-jsSDK v2 withsearch()+ highlights for token-efficient agent pipelinesx-exa-integration: ekoheader for integration-level usage tracking (see also HKUDS/CLI-Anything#205 for the same pattern in another open-source integration)EXA_API_KEY)How it works
Eko's
WebSearchTooldelegates toglobal.chatService.websearch(), which currently returns[]in the exampleSimpleChatService. This PR provides a real implementation:Exa results are mapped to Eko's
WebSearchResulttype (title,url,snippet,content), and highlights are used as the snippet for optimal token efficiency.Files changed
example/nodejs/src/exa-chat-service.tsExaChatServiceimplementationexample/nodejs/src/index.tsEXA_API_KEYis setexample/nodejs/package.jsonexa-jsdependencyTest plan
EXA_API_KEYin.envand run the Node.js exampleWebSearchToolreturns Exa results (title, url, snippet, content)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.