# Web search The `web-search` extension supplies the Python kernel's `web_search` function. It depends on `python` and delegates searches to eligible provider extensions. See [`extension.gleam`](../src/albedo/harness/extensions/web_search/extension.gleam) and the [web client](web.md). ## Search interface `await web_search(query, limit=8)` returns a record with `answer` and `sources`. Each source has `title`, `url`, `snippet`, and `published`. The host rejects a blank query and limits outside 1 through 50. [`web_search.py`](../priv/python/albedo_plugins/web_search.py) formats the result and records a `web` trace activity. The provider response is external content. ## Provider order [`order.gleam`](../src/albedo/harness/extensions/web_search/order.gleam) reads `order` and `off` from the `web-search` settings section. Named providers come first in saved order. Omitted providers follow in registry order. Providers in `off` are skipped. [`search`](../src/albedo/harness/extensions/web_search/extension.gleam) tries the next provider when one fails or returns an empty answer and no sources. If none answers, it returns an `unavailable` error with the failures or an instruction to enable a provider. ## Settings service [`service.gleam`](../src/albedo/harness/extensions/web_search/service.gleam) exposes `/extensions/web-search/providers` and provider changes. The `/web-search` command opens the provider selection in the [terminal client](tui.md). The web client has a corresponding settings section. Provider availability depends on the extensions loaded for the session. ## Related pages - [All topics](README.md) - [Change guidance](contributing.md) - [Extensions](extensions.md) - [Model authentication](auth.md)