#13665: feat(web-search): add SearXNG as a search provider
docs
agents
size: M
trusted-contributor
Cluster:
Web Search Provider Integrations
Add SearXNG as a fourth web search provider alongside Brave, Perplexity, and Grok. SearXNG is a self-hosted metasearch engine that aggregates results from multiple search engines without requiring an API key.
- Add SearXNG provider to search resolution, config schema, and TS types
- Add runSearxngSearch() with format=json API, language passthrough
- Base URL resolution: config > SEARXNG_BASE_URL env > localhost:8888
- Wrap untrusted SearXNG results with EXTERNAL_UNTRUSTED_CONTENT markers
- Early return for SearXNG (no API key required)
- Reject unsupported freshness parameter for SearXNG
- Cache key includes searxngBaseUrl
- Add unit tests (baseUrl resolution) and integration tests (mock fetch)
- Add config validation tests (schema acceptance/rejection)
- Update docs/tools/web.md with SearXNG setup guide
Closes #2317
Closes #11127
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds SearXNG as a self-hosted web search provider alongside Brave, Perplexity, and Grok. SearXNG is a metasearch engine that aggregates results from multiple search engines without requiring an API key.
**Key changes:**
- Added SearXNG to provider types, config schema, and resolution logic
- Implemented `runSearxngSearch()` using format=json API with language passthrough
- Base URL resolution follows config > `SEARXNG_BASE_URL` env > `http://localhost:8888` default
- Wrapped SearXNG results (title, description) with `EXTERNAL_UNTRUSTED_CONTENT` markers for security
- Early return path for SearXNG (no API key validation required)
- Properly rejects unsupported `freshness` parameter for SearXNG with clear error message
- Cache key includes `searxngBaseUrl` for proper invalidation
- Added comprehensive unit tests for baseUrl resolution
- Added integration tests covering format=json calls, language parameter, security wrapping, and freshness rejection
- Added config validation tests ensuring schema accepts/rejects appropriate keys
- Documentation includes Docker setup guide with YAML config, troubleshooting, and integration examples
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation is thorough and well-tested. All changes follow existing patterns for web search providers (mirroring the Perplexity/Grok implementations). Security is properly handled with EXTERNAL_UNTRUSTED_CONTENT wrapping. The code includes comprehensive test coverage (unit tests for config resolution, integration tests for API calls, and config schema validation tests). Documentation is clear and complete. No breaking changes or risky patterns detected.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#22626: feat(search): add support for SearXNG as a search provider
by sarveshgandhi · 2026-02-21
92.3%
#16895: feat(web-search): add SearXNG as a search provider
by rustyorb · 2026-02-15
92.1%
#13334: add local SearxNG integration for free unlimited web search
by itsPremkumar · 2026-02-10
83.4%
#19876: feat(web-search): add SerpAPI search provider support
by nksolar-tianjin · 2026-02-18
79.0%
#22989: feat(web-search): add Google Custom Search Engine provider
by Prakashmaheshwaran · 2026-02-21
78.7%
#8717: feat(web-search): add Seltz as search provider
by WilliamEspegren · 2026-02-04
78.3%
#14445: feat: add SerpApi search provider plugin with vertical search support
by xiaoyaner0201 · 2026-02-12
76.1%
#7738: feat(web-search): add provider fallback and Serper support
by garnetlyx · 2026-02-03
75.9%
#13814: feat(web-search): add ZAI Search (zsearch) provider
by strelov1 · 2026-02-11
75.9%
#13075: [Feature]: Add Gemini (Google Search grounding) as web_search provider
by akoscz · 2026-02-10
75.6%