← Back to PRs

#16895: feat(web-search): add SearXNG as a search provider

by rustyorb open 2026-02-15 06:48 View on GitHub →
gateway agents size: M
## 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