Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs: update search documentation to reflect new provider-based search architecture

Steven Enamakel1ea27f5fe3a5
diff --git a/crates/openhuman-core/src/config/ops/README.md b/crates/openhuman-core/src/config/ops/README.md
index 079ae786b3..b9e204f6df 100644
--- a/crates/openhuman-core/src/config/ops/README.md
+++ b/crates/openhuman-core/src/config/ops/README.md
@@ -18,7 +18,8 @@ fn, which returns `RpcOutcome<T>`.
| `model.rs` | AI-provider, memory, runtime, local-AI, and Composio-trigger settings. |
| `privacy.rs` | Privacy Mode (`[privacy]`) get/set. |
| `sandbox.rs` | Sandbox / Docker runtime (`[sandbox]`, `[runtime.docker]`) settings. |
-| `ui.rs` | Browser, analytics, search, dictation, voice-server, and onboarding-flag settings. |
+| `ui.rs` | Browser, analytics, dictation, voice-server, and onboarding-flag settings. |
+| `search.rs` | Search settings: providers, routes, role order, keys, limits, and the web-access allowlist. |
Each submodule follows the same shape: a `*SettingsPatch` struct with
`Option<T>` fields (`None` = unchanged); an `apply_*(&mut Config, patch)` fn
@@ -48,8 +49,9 @@ dictation and voice-server mutators exist only in `load_and_apply_*` form.
`apply_composio_trigger_settings`, `load_and_resolve_api_url`.
- `privacy.rs`: `apply_privacy_settings`, `get_privacy_mode`.
- `sandbox.rs`: `apply_sandbox_settings`, `get_sandbox_settings`.
+- `search.rs`: `apply_search_settings` / `get_search_settings`,
+ `search_settings_json`.
- `ui.rs`: `apply_browser_settings`, `apply_analytics_settings`,
- `apply_search_settings` / `get_search_settings`,
`load_and_apply_voice_server_settings` / `get_voice_server_settings`,
`load_and_apply_dictation_settings` / `get_dictation_settings`,
`set_onboarding_completed` / `get_onboarding_completed`,
@@ -58,15 +60,17 @@ dictation and voice-server mutators exist only in `load_and_apply_*` form.
## Search settings
-`apply_search_settings` accepts a global `enabled` switch, an explicit
-`enabled_providers` set, a presentation mode (`all_tools`, `router`, or
-`one_provider`), and direct/backend routes for Parallel and Gemini. Omitting
-`enabled_providers` migrates from saved keys, a current backend credential,
-and the separate TinyFish, Seltz, and SearXNG toggles. An explicit empty list
-selects no providers. The old `engine = "disabled"` setting still disables
-search. Both `get_search_settings` and the update response report only key
-presence booleans, never raw credentials. After saving, an already loaded
-TinySearch module is refreshed with a private configuration payload.
+`apply_search_settings` validates the whole patch before saving: a global
+`enabled` switch; per-provider `{enabled, route, api_key, base_url}` (routes a
+provider does not support are rejected, an empty key clears it); per-role
+provider order (`search`, `answer`, `contents`; a provider that cannot serve a
+role is rejected, an empty list restores the default); presentation; limits;
+and the web-access allowlist. The legacy `engine` field from older clients is
+still accepted (`SearchConfig::apply_legacy_engine`). The response and
+`get_search_settings` return the same view: each provider's resolved route,
+key presence, `usable` and status, the configured role order, and
+`effective_roles` (what serves each role right now). Keys are never returned.
+After saving, a loaded TinySearch module is refreshed privately.
## Security-relevant behavior
diff --git a/crates/openhuman-core/src/config/schema/README.md b/crates/openhuman-core/src/config/schema/README.md
index 5ad3f75b70..3c44dd87c4 100644
--- a/crates/openhuman-core/src/config/schema/README.md
+++ b/crates/openhuman-core/src/config/schema/README.md
@@ -62,12 +62,14 @@ is mounted as a submodule of `load/dirs.rs` via `#[path]`.
`mcp.rs` (`McpServerConfig`, `McpClientConfig`, `GitbooksConfig`),
`multimodal.rs` (`MultimodalConfig`, `MultimodalFileConfig`), `search.rs`
(`SearchConfig`, `WebSearchConfig`, `SearxngConfig`, `SeltzConfig`).
-`SearchConfig.enabled_providers` is an explicit provider set. When omitted,
-legacy settings enable providers with saved keys, the managed backend when a
-credential is available, and the separate TinyFish/Seltz/SearXNG toggles.
-`engine = "disabled"` still disables search. TinySearch uses one route per
-provider: explicit direct Parallel wins over managed backend Parallel when
-both are selected.
+`SearchConfig` (schema version 2) holds `providers` (enabled + `managed` /
+`direct` route per provider), `roles` (ordered providers per capability role),
+`presentation`, limits, and direct keys; fresh installs default to managed Exa
+and managed Gemini. Files without `schema_version` carry the single-engine
+format and are migrated on load (`tools/search_migrate.rs`,
+`load/migrate.rs::migrate_search_settings`); Parallel selections and keys are
+dropped. Seltz and SearXNG keep their options in their own sections, but only
+the `providers` map decides whether they are on.
Most sections have a matching `*_tests.rs` (some further split into several
`*_tests.rs` siblings, e.g. `types_model_pin_tests.rs`); this is the repo's
diff --git a/crates/openhuman-core/src/mcp/server/README.md b/crates/openhuman-core/src/mcp/server/README.md
index 72a381bd05..a3ac30efd1 100644
--- a/crates/openhuman-core/src/mcp/server/README.md
+++ b/crates/openhuman-core/src/mcp/server/README.md
@@ -1,6 +1,6 @@
# mcp/server
-Opt-in **Model Context Protocol (MCP) server** that exposes a curated, security-gated slice of OpenHuman's tool surface (memory-tree reads/writes, core/agent introspection, subagent execution, SearXNG search) and bundled prompt assets to external MCP clients (Claude Desktop, Cursor, Windsurf, …). Started via `openhuman-core mcp` — stdio transport by default, or `--transport http` for Streamable HTTP + SSE on a local bind address. It is a JSON-RPC dispatcher, not a registered RPC domain: it has no `schemas.rs`/controllers and is wired only through `crates/openhuman-core/src/core/cli.rs`, translating each MCP `tools/call` into an existing registered core RPC method.
+Opt-in **Model Context Protocol (MCP) server** that exposes a curated, security-gated slice of OpenHuman's tool surface (memory-tree reads/writes, core/agent introspection, subagent execution, web search) and bundled prompt assets to external MCP clients (Claude Desktop, Cursor, Windsurf, …). Started via `openhuman-core mcp` — stdio transport by default, or `--transport http` for Streamable HTTP + SSE on a local bind address. It is a JSON-RPC dispatcher, not a registered RPC domain: it has no `schemas.rs`/controllers and is wired only through `crates/openhuman-core/src/core/cli.rs`, translating each MCP `tools/call` into an existing registered core RPC method.
## Responsibilities
@@ -53,6 +53,8 @@ This module exposes **no** registered core RPC methods (no `schemas.rs`, no cont
| `tree.top_entities` | `openhuman.memory_tree_top_entities` |
| `tree.list_sources` | `openhuman.memory_tree_list_sources` |
| `memory.store` / `memory.note` / `tree.tag` | `openhuman.memory_doc_put` |
+| `web_search` | `openhuman.tools_web_search` |
+| `web_answer` | `openhuman.tools_web_answer` |
| `searxng_search` | `openhuman.tools_searxng_search` |
| `core.list_tools` / `core.tool_instructions` / `agent.list_subagents` / `agent.run_subagent` | (no RPC mapping — handled in-process via `Agent` / `AgentDefinitionRegistry`) |
@@ -60,7 +62,7 @@ This module exposes **no** registered core RPC methods (no `schemas.rs`, no cont
It does **not** own any agent tools in the `tools.rs`/`crates/openhuman-core/src/tools` sense. The "tools" here are **MCP-protocol tools** advertised to external clients:
-- Read-only (`ToolOperation::Read`): `core.list_tools`, `core.tool_instructions`, `agent.list_subagents`, `memory.search`, `memory.recall`, `tree.read_chunk`, `tree.browse`, `tree.top_entities`, `tree.list_sources`, `searxng_search` (config-gated on `searxng.enabled`).
+- Read-only (`ToolOperation::Read`): `core.list_tools`, `core.tool_instructions`, `agent.list_subagents`, `memory.search`, `memory.recall`, `tree.read_chunk`, `tree.browse`, `tree.top_entities`, `tree.list_sources`, `web_search`, `web_answer`, `searxng_search` (listed only when a search provider can serve them; `crate::search::providers`).
- Act-policy (`ToolOperation::Act`): `agent.run_subagent` (annotated destructive/open-world; rejects `integrations_agent`), and the write tools `memory.store`, `memory.note`, `tree.tag` (annotated destructive/idempotent, local-only).
Argument bounds enforced in-layer: `k`/limits capped at `MAX_LIMIT` (50), default 10; `tree.tag` capped at 50 tags / 128 bytes per tag; SearXNG `max_results` capped at `SEARXNG_MAX_RESULTS`. Write tools derive deterministic upsert keys (`mcp-store-<slug>`, `mcp-note-<chunk_id>`, `mcp-tag-<chunk_id>`).
@@ -82,7 +84,7 @@ No `store.rs`. The only durable side effect is the **MCP write-audit log**, writ
- `crate::agent` (`Agent`, `registry::agents::BUILTINS`, `harness::AgentDefinitionRegistry`) — build the orchestrator agent for `core.list_tools`/`core.tool_instructions`, list/run subagents, and cross-check the resource catalog.
- `tinyinference_llm::tool::ToolSchema` — directly materialize model-visible tool declarations for `core.tool_instructions`.
- `tinyagents_harness::tool::prompt_tool_instructions` — render the markdown tool-use instructions block for `core.tool_instructions`.
-- `crate::tools` (`SEARXNG_MAX_RESULTS`, `normalize_categories`) — SearXNG bounds + category normalization for `searxng_search`.
+- `crate::search::providers` — which search tools the config can serve (`tool_specs_for_config`).
- `crate::mcp::audit` (`record_write`, `NewMcpWriteRecord`, list/query helpers in tests) — durable write-audit log.
- `crate::mcp::http_client::McpHttpClient` — round-trip test harness for the HTTP transport (test-only).
- External crates: `axum`/`tokio`/`tokio-stream` (HTTP+SSE), `serde_json`, `uuid`, `sha2`/`hex` (session-id redaction, slug fallback hash), `chrono` (audit timestamps).
diff --git a/gitbooks/developing/mcp-server.md b/gitbooks/developing/mcp-server.md
index 1a5c98e48b..67784b64cd 100644
--- a/gitbooks/developing/mcp-server.md
+++ b/gitbooks/developing/mcp-server.md
@@ -38,6 +38,8 @@ controller registry plus the core security policy read gate:
| MCP tool | Backing RPC | Purpose |
| ------------------- | ------------------------------------ | ----------------------------------------------------------------------- |
+| `web_search`\* | `openhuman.tools_web_search` | Ranked web search through the configured providers, with fallback. |
+| `web_answer`\* | `openhuman.tools_web_answer` | Grounded answer with citations (Gemini with Google Search by default). |
| `searxng_search`\* | `openhuman.tools_searxng_search` | Search a configured self-hosted SearXNG instance. |
| `memory.search` | `openhuman.memory_tree_search` | Keyword search over memory-tree chunks. |
| `memory.recall` | `openhuman.memory_tree_recall` | Semantic recall over memory-tree summaries/chunks. |
@@ -46,20 +48,28 @@ controller registry plus the core security policy read gate:
| `tree.top_entities` | `openhuman.memory_tree_top_entities` | Most-referenced canonical entities, optionally filtered by kind. |
| `tree.list_sources` | `openhuman.memory_tree_list_sources` | Distinct ingest sources with chunk counts and last-activity timestamps. |
-- `searxng_search` is present only when SearXNG is enabled.
+- Tools marked \* are listed only when a provider can serve them: `web_search`
+ and `web_answer` when their search role has a usable provider (a signed-in
+ session, or a provider with your own key), `searxng_search` when SearXNG is
+ enabled in search settings.
-`searxng_search` is added to the MCP catalog when SearXNG is enabled. It accepts
-`query`, optional `categories` (`web`, `news`, `images`), optional `language`,
-and optional `max_results` (1-50).
+`web_search` accepts `query`, optional `max_results` (1-20) and optional
+`provider` (pins one provider and disables fallback). `web_answer` accepts
+`query` and optional `depth` (`quick` or `deep`). `searxng_search` accepts
+`query` and optional `max_results` (1-20).
`memory.search` and `memory.recall` accept `query` plus optional `k` (default
10, capped at 50). `tree.read_chunk` accepts `chunk_id`. `tree.browse` accepts
optional `source_kinds`, `source_ids`, `entity_ids`, `since_ms`, `until_ms`,
`query`, `k`, and `offset`. `tree.top_entities` accepts optional `kind` and
`k`. `tree.list_sources` accepts an optional `user_email_hint`.
-Enable SearXNG in `config.toml` or via environment:
+Enable SearXNG under Connections → Search, in `config.toml`, or via environment:
```toml
+[search.providers.searxng]
+enabled = true
+route = "direct"
+
[searxng]
enabled = true
base_url = "http://localhost:8080"