From 93ab087cba48abe389cb2e93da8b2c52074e001a Mon Sep 17 00:00:00 2001 From: Kesku Date: Sun, 25 Jan 2026 15:02:55 -0800 Subject: [PATCH] cleanup --- docs/tools/web.md | 93 +++++++++++++------------------ src/commands/configure.wizard.ts | 2 - src/wizard/onboarding.finalize.ts | 6 +- 3 files changed, 41 insertions(+), 60 deletions(-) diff --git a/docs/tools/web.md b/docs/tools/web.md index acbff9cdc..acb0d8672 100644 --- a/docs/tools/web.md +++ b/docs/tools/web.md @@ -9,7 +9,7 @@ read_when: Clawdbot ships two lightweight web tools: -- `web_search` — Search the web via Perplexity Search API (recommended) or Brave Search API. +- `web_search` — Search the web using Perplexity Search API or Brave Search API. - `web_fetch` — HTTP fetch + readable extraction (HTML → markdown/text). These are **not** browser automation. For JS-heavy sites or logins, use the @@ -18,20 +18,11 @@ These are **not** browser automation. For JS-heavy sites or logins, use the ## How it works - `web_search` calls your configured provider and returns results. - - **Perplexity** (recommended): returns structured results (title, URL, snippet) for fast research. - - **Brave**: returns structured results (title, URL, snippet) with free tier available. - Results are cached by query for 15 minutes (configurable). - `web_fetch` does a plain HTTP GET and extracts readable content (HTML → markdown/text). It does **not** execute JavaScript. - `web_fetch` is enabled by default (unless explicitly disabled). -## Choosing a search provider - -| Provider | Pros | Cons | API Key | -|----------|------|------|---------| -| **Perplexity** (recommended) | Fast, structured results, high-quality results | Requires Perplexity API access | `PERPLEXITY_API_KEY` | -| **Brave** | Structured results, free tier available | Traditional search results | `BRAVE_API_KEY` | - See [Perplexity Search setup](/perplexity) and [Brave Search setup](/brave-search) for provider-specific details. Set the provider in config: @@ -41,60 +32,42 @@ Set the provider in config: tools: { web: { search: { - provider: "brave" // or "perplexity" + provider: "perplexity" // or "brave" } } } } ``` -Example: switch to Perplexity Search: +## Setting up web search -```json5 -{ - tools: { - web: { - search: { - provider: "perplexity", - perplexity: { - apiKey: "pplx-..." - } - } - } - } -} -``` +Use `clawdbot configure --section web` to set up your API key and choose a provider. -## Getting a Brave API key - -1) Create a Brave Search API account at https://brave.com/search/api/ -2) In the dashboard, choose the **Data for Search** plan (not “Data for AI”) and generate an API key. -3) Run `clawdbot configure --section web` to store the key in config (recommended), or set `BRAVE_API_KEY` in your environment. - -Brave provides a free tier plus paid plans; check the Brave API portal for the -current limits and pricing. - -### Where to set the key (recommended) - -**Recommended:** run `clawdbot configure --section web`. It stores the key in -`~/.clawdbot/clawdbot.json` under `tools.web.search.apiKey`. - -**Environment alternative:** set `BRAVE_API_KEY` in the Gateway process -environment. For a gateway install, put it in `~/.clawdbot/.env` (or your -service environment). See [Env vars](/help/faq#how-does-clawdbot-load-environment-variables). - -## Using Perplexity Search - -Perplexity Search API returns structured search results (title, URL, snippet) for fast research. -It's the recommended provider for web search. - -### Getting a Perplexity API key +### Perplexity Search 1) Create a Perplexity account at https://www.perplexity.ai/settings/api 2) Generate an API key in the dashboard -3) Run `clawdbot configure --section web` to store the key in config (recommended), or set `PERPLEXITY_API_KEY` in your environment. +3) Run `clawdbot configure --section web` to store the key in config, or set `PERPLEXITY_API_KEY` in your environment. -### Setting up Perplexity search +Perplexity provides $5 in API credits on a monthly rolling basis to Perplexity Pro subscribers. Check the Perplexity API docs for current limits and pricing. + +### Brave Search + +1) Create a Brave Search API account at https://brave.com/search/api/ +2) In the dashboard, choose the **Data for Search** plan (not "Data for AI") and generate an API key. +3) Run `clawdbot configure --section web` to store the key in config, or set `BRAVE_API_KEY` in your environment. + +Brave provides a free tier plus paid plans; check the Brave API portal for the current limits and pricing. + +### Where to store the key + +**Via config (recommended):** run `clawdbot configure --section web`. It stores the key under `tools.web.search.perplexity.apiKey` or `tools.web.search.apiKey`. + +**Via environment:** set `PERPLEXITY_API_KEY` or `BRAVE_API_KEY` in the Gateway process environment. For a gateway install, put it in `~/.clawdbot/.env` (or your service environment). See [Env vars](/help/faq#how-does-clawdbot-load-environment-variables). + +### Config examples + +**Perplexity Search:** ```json5 { @@ -112,7 +85,21 @@ It's the recommended provider for web search. } ``` -**Environment alternative:** set `PERPLEXITY_API_KEY` in the Gateway environment. For a gateway install, put it in `~/.clawdbot/.env`. +**Brave Search:** + +```json5 +{ + tools: { + web: { + search: { + enabled: true, + provider: "brave", + apiKey: "BSA..." // optional if BRAVE_API_KEY is set + } + } + } +} +``` ## web_search diff --git a/src/commands/configure.wizard.ts b/src/commands/configure.wizard.ts index aee3d650c..b8ca3403c 100644 --- a/src/commands/configure.wizard.ts +++ b/src/commands/configure.wizard.ts @@ -132,12 +132,10 @@ async function promptWebToolsConfig( { value: "perplexity", label: "Perplexity Search", - hint: "Recommended - structured results, fast", }, { value: "brave", label: "Brave Search", - hint: "Structured results, free tier available", }, ], initialValue: existingProvider, diff --git a/src/wizard/onboarding.finalize.ts b/src/wizard/onboarding.finalize.ts index 796485bc4..63e052ba6 100644 --- a/src/wizard/onboarding.finalize.ts +++ b/src/wizard/onboarding.finalize.ts @@ -454,11 +454,7 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption "Docs: https://docs.clawd.bot/tools/web", ].join("\n") : [ - "If you want your agent to be able to search the web, you’ll need an API key.", - "", - "Clawdbot supports two web search providers:", - "- Perplexity Search (recommended) - structured results, fast", - "- Brave Search - structured results, free tier available", + "To enable web search, your agent will need an API key for either Perplexity Search or Brave Search.", "", "Set it up interactively:", `- Run: ${formatCliCommand("clawdbot configure --section web")}`,