#16895: feat(web-search): add SearXNG as a search provider
gateway
agents
size: M
Cluster:
Web Search Provider Integrations
## Summary
- Adds SearXNG metasearch engine as a fourth `web_search` provider alongside Brave, Perplexity, and Grok
- SearXNG is self-hosted and privacy-respecting, ideal for local/homelab setups without commercial search API dependencies
- No API key required — just a reachable SearXNG instance
## Configuration
```jsonc
{
"tools": {
"web": {
"search": {
"provider": "searxng",
"searxng": {
"baseUrl": "http://localhost:8080",
"categories": "general"
}
}
}
}
}
```
Or via environment variable: `SEARXNG_URL=http://localhost:8080`
## Features
- Supports `categories`, `language`, `time_range`, and `freshness` filters (pd/pw/pm/py mapped to SearXNG time_range)
- Result caching consistent with other providers
- Returns structured results (title, url, description, siteName, engine) matching the Brave output format
- Graceful error messages guiding users to set `SEARXNG_URL` or config
## Test plan
- [ ] Verify `web_search` works with `provider: "searxng"` and a running SearXNG instance
- [ ] Verify freshness filters (pd/pw/pm/py) map correctly to SearXNG time_range
- [ ] Verify fallback error message when no baseUrl or SEARXNG_URL is configured
- [ ] Verify caching works (second identical query returns cached result)
- [ ] Verify existing providers (brave, perplexity, grok) are unaffected
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds SearXNG as a fourth web search provider alongside Brave, Perplexity, and Grok. The implementation is clean and follows existing patterns for other search providers.
**SearXNG Implementation:**
- Adds SearXNG metasearch engine support with no API key requirement (just needs a reachable instance URL)
- Configuration via `tools.web.search.searxng.baseUrl` or `SEARXNG_URL` environment variable
- Supports freshness filters (pd/pw/pm/py mapped to day/week/month/year)
- Returns structured results matching Brave's format (title, url, description, siteName, engine)
- Includes proper caching, error handling, and type definitions
**Additional Changes (Unrelated to SearXNG):**
- Adds customizable `greetingPrompt` configuration to SessionConfig, allowing users to override the default prompt when starting sessions with `/new` or `/reset`
- Refactors `BARE_SESSION_RESET_PROMPT` to `DEFAULT_GREETING_PROMPT` with backward compatibility
- Updates two integration points (`get-reply-run.ts` and `agent.ts`) to use the new configurable greeting prompt
The code follows existing patterns for provider integration, includes proper TypeScript types, and maintains consistency with Brave/Perplexity/Grok implementations.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk
- The SearXNG implementation follows established patterns from other search providers (Brave, Perplexity, Grok) with proper error handling, caching, and type safety. The greeting prompt customization is a straightforward config addition with backward compatibility. The code is well-structured and includes appropriate validation via Zod schemas. One point deducted because the PR mixes two unrelated features (SearXNG + greeting prompt) and lacks unit tests for the new SearXNG-specific functions.
- No files require special attention. The implementation is consistent and follows existing patterns.
<sub>Last reviewed commit: 177185c</sub>
<!-- 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%
#13665: feat(web-search): add SearXNG as a search provider
by sfo2001 · 2026-02-10
92.1%
#13334: add local SearxNG integration for free unlimited web search
by itsPremkumar · 2026-02-10
82.7%
#22989: feat(web-search): add Google Custom Search Engine provider
by Prakashmaheshwaran · 2026-02-21
79.4%
#19876: feat(web-search): add SerpAPI search provider support
by nksolar-tianjin · 2026-02-18
79.1%
#8717: feat(web-search): add Seltz as search provider
by WilliamEspegren · 2026-02-04
78.2%
#13814: feat(web-search): add ZAI Search (zsearch) provider
by strelov1 · 2026-02-11
77.5%
#12304: feat: add DeSearch as web_search provider
by tatjr13 · 2026-02-09
77.2%
#7738: feat(web-search): add provider fallback and Serper support
by garnetlyx · 2026-02-03
76.7%
#18167: feat(web-search): add baseUrl support for Brave Search provider
by jkoprax · 2026-02-16
76.3%