Skip to content

Add SerpKite online search provider - #1447

Closed
Nolikzero wants to merge 1 commit into
khoj-ai:masterfrom
SerpKite:add-serpkite-search
Closed

Nolikzero wants to merge 1 commit into
khoj-ai:masterfrom
SerpKite:add-serpkite-search

Conversation

@Nolikzero

Copy link
Copy Markdown

Summary

Add SerpKite as an opt-in online-search provider for self-hosted Khoj. Setting SERPKITE_API_KEY enables it in the existing provider fallback chain and web-search availability check.

The async adapter POSTs to https://api.serpkite.com/v1/search with Bearer authentication and a 60-second timeout. It maps SerpKite's own {request, results, meta} response into Khoj's internal organic format. Missing links are skipped, empty/error responses allow the existing fallback flow, and country localization follows LocationData.

Queries above the API's 2,048-character limit are shortened only for the outbound request. The original query remains the returned dictionary key. Error logs contain only HTTP status, without raw response text, API keys or query contents.

Setup documentation is included. The service and adapter are maintained by the SerpKite team; I am submitting on its behalf. API docs, pricing/free account.

Validation

  • Seven mocked async tests pass for Bearer/payload/timeout, result mapping, optional fields, empty results, HTTP errors, missing credentials, query length and network failure propagation.
  • ruff check passes for all touched Python files; ruff format --check passes.
  • Command: PYTHONPATH=src python -m unittest tests.test_serpkite_search -v.
  • No live API calls or credentials are used by the tests.
  • The full Django/database/model test suite was not run in the isolated checkout.

Google is a trademark of Google LLC; SerpKite is not affiliated with Google.

@debanjum

Copy link
Copy Markdown
Member

Please don't open PRs soliciting new web search providers. It wouldn't be accepted

@debanjum debanjum closed this Oct 20, 2026
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.

2 participants