feat: add Xquik as X/Twitter search engine for online research#1308
Open
kriptoburak wants to merge 1 commit intokhoj-ai:masterfrom
Open
feat: add Xquik as X/Twitter search engine for online research#1308kriptoburak wants to merge 1 commit intokhoj-ai:masterfrom
kriptoburak wants to merge 1 commit intokhoj-ai:masterfrom
Conversation
Adds search_with_xquik as a sixth search engine alongside Serper,
Exa, Firecrawl, Google, and SearXNG. Activates when XQUIK_API_KEY
env var is set. Returns results in the same {organic} format.
Adds real-time social media perspectives (tweets, expert opinions,
community sentiment) to research results — a dimension currently
missing from web-only search engines.
aa09eb2 to
a97a412
Compare
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
Adds Xquik as a sixth search engine for Khoj's online research, alongside Serper, Exa, Firecrawl, Google, and SearXNG. Set
XQUIK_API_KEYto activate. Returns results in the same{organic: [...]}format - zero changes needed elsewhere.This adds a social media dimension to research. Currently all five search engines return web pages (articles, docs, blogs). Xquik searches X/Twitter - real-time perspectives, expert opinions, community sentiment, and breaking news that hasn't been written about yet.
Why this is useful
Research questions like "What do developers think about X?" or "What's the reaction to Y?" currently only return web articles. With Xquik, Khoj can now surface the actual discussion happening on X/Twitter - primary sources, not just secondary reporting.
Each result includes:
content(available for extraction/summarization)Configuration
# Add to your .env XQUIK_API_KEY=xk_your_key_hereGet a key at xquik.com. $0.00015 per tweet read.
Xquik is registered as a fallback search engine (appended after existing engines). If Serper/Exa/etc. return results first, Xquik won't be called. To use Xquik as the primary engine, set only
XQUIK_API_KEYwithout other search engine keys.Changes
1 file changed -
src/khoj/processor/tools/online_search.py:XQUIK_API_KEY = os.getenv("XQUIK_API_KEY")constant (line 50)search_with_xquikto thesearch_engineslist when env var is set (line 119)search_with_xquik()async function following the exact same pattern assearch_with_exa,search_with_firecrawl, etc.Pattern compliance
The function follows the exact interface of every other search engine in the file:
search_with_exa,search_with_serper, etc.(query, {"organic": [...]})(query, {})aiohttp.ClientSessionlike all other enginesWEBPAGE_REQUEST_TIMEOUTconstantTest plan
python -m py_compile src/khoj/processor/tools/online_search.py- syntax valid{"organic": [...]}structureXQUIK_API_KEY- behavior 100% unchanged (not added to engine list)Built with Claude Code