Skip to content

feat(ai): add the SearXNG search provider #3927

Closed

Description

@dan-petty

Problem

Once SearXNG runs in the cluster (the manifest item), the chain of providers needs a client for it. A model chooses the query, and SearXNG reads a query that starts with ! as an engine or bang selector and can answer with a redirect (searx/webapp.py at commit 629368e40, read by the researcher on 2026-11-07). SearXNG also reports a suspended engine only in the field unresponsive_engines, with a result list that can be empty.

Expected

A provider searxng for the chain. Setting search.searxng_url with no default; with it empty the provider is not configured and is skipped. It sends GET {url}/search with q, format=json, language from search.language, categories (general,it,science, read from the engine files at the pinned commit; #3929 checks it live) and pageno=1, through http_client(level=configured_level()). It does not follow redirects. It reads at most a byte cap. It maps results[] to SearchHit (url, title, content as the snippet, provider="searxng"). It sets allows_keep=True. A reply with no result and a non-empty unresponsive_engines is the result degraded. A reply with another status than 200 is a failure with its status as the result. k8s/devops/configmap.example.yaml names the cluster value http://searxng.devops.svc.cluster.local:8080, and the settings docs name the workstation value http://127.0.0.1:8080 (with kubectl port-forward -n devops svc/searxng 8080:8080).

Acceptance criteria

  • Tests with the HTTP fake fail on the base: a good reply gives hits with the provider tag. The fixture of the reply holds the shape that the SearXNG search API documents (keys query, results, answers, corrections, infoboxes, suggestions, unresponsive_engines). The manifest item (feat(k8s): run SearXNG in namespace devops #3924) is not merged, so no live pod exists. Moved to test(k8s): live check of the SearXNG service #3929: replace the fixture with a reply saved from the pinned digest, and check the categories value of the request against the kept engines.
  • A test: HTTP 403 (json not in search.formats), 429 and 5xx each give a failure with the status as the result.
  • A test: an empty results with a non-empty unresponsive_engines gives degraded; an empty results with an empty unresponsive_engines gives empty.
  • A test: a 302 reply is a failure and no second request is sent.
  • A test: with search.searxng_url empty the provider is not configured; the error text of a direct call names the setting.
  • A test: a workstation URL on loopback works with no ai.allow_private_network; a cluster Service URL needs the flag (the existing configured_level rule).
  • The generated settings docs list search.searxng_url.

Existing tool considered

The project's http_client and configured_level; the SearXNG JSON API (docs/dev/search_api.rst). Rejected: a Python SearXNG client package (none read; the JSON is one request); the pydantic-ai search tool (no transport, skips the egress check).

Related

Depends on the chain item and the SearXNG manifest item (for the saved reply). Related: #3877, #3243, #3915.

Part of the search provider plan of 2026-11-07 (SearXNG; the Brave Search API was dropped by the owner on 2026-11-07).

Activity

  1. added
    source/agent
    type/feature
    scope/ai
    status/new
    value/medium
    effort/medium
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/ai. The (ai) scope of the title gives the scope.
    • Priority: P2-Medium. It is a planned feature that depends on two other open items before it can be delivered.
    • Value: Medium. It adds a second search path that reduces reliance on a single keyed provider.
    • Effort: Medium. It needs a new provider, redirect handling, degraded-state logic, fixture tests, and doc updates.
    • Related: feat(ai): search the web through a chain of providers #3925, which asks for a different change. Both concern the search provider chain; #3925 builds the chain mechanism while this candidate adds one specific provider to it.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 7, 2026
  5. removed
    status/in-progress
    owner/agent
    on Nov 7, 2026
  6. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-07 15:32 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/aisource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions