Skip to content

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

docs(embed): add web search integration page to nav

Steven Enamakelb87de11e216d
diff --git a/docs/gitbooks/en/SUMMARY.md b/docs/gitbooks/en/SUMMARY.md
index ea87ad6cfd..9a8645ad1b 100644
--- a/docs/gitbooks/en/SUMMARY.md
+++ b/docs/gitbooks/en/SUMMARY.md
@@ -123,6 +123,7 @@
- [Local and custom models](developing/embed/integrations/local-models.md)
- [MCP servers](developing/embed/integrations/mcp.md)
- [Composio](developing/embed/integrations/composio.md)
+ - [Web search](developing/embed/integrations/web-search.md)
- [Storage drivers](developing/embed/integrations/storage-drivers.md)
- [Channels](developing/embed/integrations/channels.md)
- [Cookbook](developing/embed/cookbook.md)
diff --git a/docs/gitbooks/en/developing/embed/integrations/README.md b/docs/gitbooks/en/developing/embed/integrations/README.md
index 4168ac50f5..fc709a519a 100644
--- a/docs/gitbooks/en/developing/embed/integrations/README.md
+++ b/docs/gitbooks/en/developing/embed/integrations/README.md
@@ -12,6 +12,7 @@ An embedded runtime composes the capabilities its host supplies. Start with the
- [Local models](local-models.md)
- [MCP servers](mcp.md)
- [Composio](composio.md)
+- [Web search](web-search.md)
- [Storage drivers](storage-drivers.md)
- [Channels](channels.md)
diff --git a/docs/gitbooks/en/developing/embed/integrations/web-search.md b/docs/gitbooks/en/developing/embed/integrations/web-search.md
new file mode 100644
index 0000000000..5cd3321bd2
--- /dev/null
+++ b/docs/gitbooks/en/developing/embed/integrations/web-search.md
@@ -0,0 +1,27 @@
+---
+description: "Pin a web-search provider key per agent, held only in memory."
+icon: code
+---
+
+# Web search
+
+An agent's web-search tools (`web_search_tool`, `web_answer_tool`, `web_contents_tool`) run through the process-wide TinySearch module. Several agents in one runtime can each search with their own provider key: pin it on that agent's config, and it is never written to `config.toml`, the environment, or a log.
+
+```rust
+use openhuman_embed::SearchHostCredential;
+
+let spec = spec.config(|config| {
+ config
+ .search
+ .pin_host_credential("brave", SearchHostCredential::new(brave_key))
+ .expect("brave takes an API key");
+});
+```
+
+`pin_host_credential` accepts `brave`, `exa`, `gemini`, `parallel`, `querit`, `tavily` and `tinyfish`, and refuses any other provider with `UnknownKeyedSearchProvider`. It turns search on and puts that provider on its direct route, the route a key authenticates; a pinned `gemini` key also serves deep research. `SearchHostCredential::with_base_url` sends the provider's calls to another endpoint, such as a proxy or a local stand-in under test.
+
+While an agent's config carries a pinned key, its search calls run under that config instead of a reload of the runtime's `config.toml`. The module is reconfigured whenever the next call needs a different configuration, and calls take turns, so one agent's call never runs with another agent's key. Agents without a pinned key keep the runtime's settings, environment and default managed routing.
+
+Provider order per role still comes from `search.roles` and TinySearch's defaults. A runtime signed in to the managed backend serves the managed providers first; set `search.roles` on the agent to put the pinned provider first.
+
+The repository's [pinned-key integration test](https://github.com/tinyhumansai/openhuman/blob/main/tests/search_pinned_keys_e2e.rs) runs two agents with different keys against a loopback provider. It checks each call's outgoing key, and that no key reaches the environment, a file or a log line.
diff --git a/gitbooks/SUMMARY.md b/gitbooks/SUMMARY.md
index 8e6d7a2fd3..35d157bc8f 100644
--- a/gitbooks/SUMMARY.md
+++ b/gitbooks/SUMMARY.md
@@ -123,6 +123,7 @@
- [Local and custom models](developing/embed/integrations/local-models.md)
- [MCP servers](developing/embed/integrations/mcp.md)
- [Composio](developing/embed/integrations/composio.md)
+ - [Web search](developing/embed/integrations/web-search.md)
- [Storage drivers](developing/embed/integrations/storage-drivers.md)
- [Channels](developing/embed/integrations/channels.md)
- [Cookbook](developing/embed/cookbook.md)
diff --git a/gitbooks/developing/embed/integrations/README.md b/gitbooks/developing/embed/integrations/README.md
index 4168ac50f5..fc709a519a 100644
--- a/gitbooks/developing/embed/integrations/README.md
+++ b/gitbooks/developing/embed/integrations/README.md
@@ -12,6 +12,7 @@ An embedded runtime composes the capabilities its host supplies. Start with the
- [Local models](local-models.md)
- [MCP servers](mcp.md)
- [Composio](composio.md)
+- [Web search](web-search.md)
- [Storage drivers](storage-drivers.md)
- [Channels](channels.md)
diff --git a/gitbooks/developing/embed/integrations/web-search.md b/gitbooks/developing/embed/integrations/web-search.md
new file mode 100644
index 0000000000..5cd3321bd2
--- /dev/null
+++ b/gitbooks/developing/embed/integrations/web-search.md
@@ -0,0 +1,27 @@
+---
+description: "Pin a web-search provider key per agent, held only in memory."
+icon: code
+---
+
+# Web search
+
+An agent's web-search tools (`web_search_tool`, `web_answer_tool`, `web_contents_tool`) run through the process-wide TinySearch module. Several agents in one runtime can each search with their own provider key: pin it on that agent's config, and it is never written to `config.toml`, the environment, or a log.
+
+```rust
+use openhuman_embed::SearchHostCredential;
+
+let spec = spec.config(|config| {
+ config
+ .search
+ .pin_host_credential("brave", SearchHostCredential::new(brave_key))
+ .expect("brave takes an API key");
+});
+```
+
+`pin_host_credential` accepts `brave`, `exa`, `gemini`, `parallel`, `querit`, `tavily` and `tinyfish`, and refuses any other provider with `UnknownKeyedSearchProvider`. It turns search on and puts that provider on its direct route, the route a key authenticates; a pinned `gemini` key also serves deep research. `SearchHostCredential::with_base_url` sends the provider's calls to another endpoint, such as a proxy or a local stand-in under test.
+
+While an agent's config carries a pinned key, its search calls run under that config instead of a reload of the runtime's `config.toml`. The module is reconfigured whenever the next call needs a different configuration, and calls take turns, so one agent's call never runs with another agent's key. Agents without a pinned key keep the runtime's settings, environment and default managed routing.
+
+Provider order per role still comes from `search.roles` and TinySearch's defaults. A runtime signed in to the managed backend serves the managed providers first; set `search.roles` on the agent to put the pinned provider first.
+
+The repository's [pinned-key integration test](https://github.com/tinyhumansai/openhuman/blob/main/tests/search_pinned_keys_e2e.rs) runs two agents with different keys against a loopback provider. It checks each call's outgoing key, and that no key reaches the environment, a file or a log line.