Skip to content

Add SearXNG support to web_search tool #545

@mouyase

Description

@mouyase

Description

Add support for SearXNG (https://github.com/searxng/searxng) as a search backend for the
web_search tool. SearXNG is a free, open-source metasearch engine that aggregates results from
multiple sources without tracking users.

Use Case

  1. Privacy: Users can use self-hosted or trusted SearXNG instances instead of proprietary APIs
  2. Self-hosting: Organizations running Oh My Pi can use their own search infrastructure
  3. Cost: No API keys or usage limits for self-hosted instances
  4. Compliance: SearXNG can be configured to respect regional data regulations

Use Case

  1. Privacy: Users can use self-hosted or trusted SearXNG instances instead of proprietary APIs
  2. Self-hosting: Organizations running Oh My Pi can use their own search infrastructure
  3. Cost: No API keys or usage limits for self-hosted instances
  4. Compliance: SearXNG can be configured to respect regional data regulations

Area

Tools

Proposed Solution

Allow configuring web_search to use a SearXNG instance via skill configuration or settings:

  web_search:
    provider: searxng
    endpoint: https://searx.example.com
    params:
      categories: general
      language: zh-CN
      headers:
        X-Custom-Header: value
      auth:
        username: user
        password: pass
      token: your-bearer-token-here

SearXNG provides a simple JSON API:

  • Endpoint: /search
  • Required params: q (query), format=json
  • Response: JSON with results array containing title, url, content

Reference: https://docs.searxng.org/dev/search_api.html

Alternatives Considered

  • Using existing search tools with API keys: requires third-party accounts and has usage limits
  • Proxying through custom middleware: adds unnecessary complexity when direct API support is
    straightforward
  • Manual fetch calls in user scripts: loses the structured output and error handling of the
    web_search tool

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions