Fix Missing Web Search Capability
Date: 2026-04-25
Goal: Enable a reliable web search backend using the user's existing Perplexity API key instead of the currently unconfigured native tool.
Current Context
- The user's Perplexity API key is available but never persisted for security.
- My
config.yamlhas no search provider configured (no SerpAPI, Brave, Google CSE, etc.). - My enabled toolsets are only
hermes-cliandhermes-telegram— there is nowebtoolset loaded. - Attempting
web_searchcalls will either fail or silently fall back to slow browser-based scraping. - We inspected
pplx-cli(a local RAG wrapper around Perplexity) and concluded it is overkill for this need.
Assumptions
- Hermes supports a
webtoolset that can be enabled inconfig.yamlundertoolsets. - The
webtoolset supports a configurable provider backend (e.g., SerpAPI, Brave, or a custom OpenAI-compatible endpoint). - Perplexity's Sonar models (
sonar,sonar-pro,sonar-reasoning) accept amessagespayload viahttps://api.perplexity.ai/chat/completionsand return grounded, cited web search results.
Proposed Approach
Use the Perplexity API as the web search backend rather than installing pplx-cli.
Two viable paths exist; Path A is preferred for simplicity.
Path A — Native web Toolset + Perplexity Provider (Preferred)
Wire the native web_search tool to call Perplexity's chat completions endpoint directly.
If Hermes' web toolset expects a traditional search API (10-blue-links style), we can proxy through a lightweight shell wrapper instead.
- Inspect available toolsets to confirm the exact name of the web search skill (e.g.,
web,search,web_search). - Enable the toolset in
~/.hermes/config.yamlundertoolsets:. - Configure the provider:
- If the toolset supports a generic
openai_compatibleprovider, pointbase_urltohttps://api.perplexity.aiand supply the API key. - If it only supports traditional search APIs (SerpAPI, Brave, etc.), create a micro-wrapper script that translates
web_searchqueries into Perplexity API calls and returns structured results.
- If the toolset supports a generic
- Test with a simple query like "current weather in Tokyo" and verify citations are returned.
Path B — Lightweight Shell Wrapper (Fallback)
If Path A is blocked by toolset limitations, create a minimal wrapper script.
- Write
~/.hermes/scripts/perplexity_search.shthat:- Accepts a query string.
- Calls
curltohttps://api.perplexity.ai/chat/completionswith modelsonar. - Returns top citations + a short summary in JSON.
- Register this script as a custom Hermes hook or alias so I can invoke it transparently when web context is needed.
- Document usage in a skill note.
Step-by-Step Plan
| Step | Action | Details |
|---|---|---|
| 1 | Discover toolset | Run skills_list or inspect ~/.hermes/skills/ for a web / search skill |
| 2 | Inspect skill config | Load the skill with skill_view to learn its provider schema |
| 3 | Configure config.yaml | Add the skill to the toolsets: array; add provider block under providers: or auxiliary: if needed |
| 4 | Set API key | Either export PERPLEXITY_API_KEY in shell env, or add it to providers.perplexity.api_key in config |
| 5 | Validate | Run a live web_search query and confirm results with citations |
| 6 | (Fallback) Write wrapper | If native integration fails, create perplexity_search.sh and test it manually |
Files Likely to Change
~/.hermes/config.yaml— add toolset + provider configuration~/.hermes/scripts/perplexity_search.sh— only if Path A is blocked~/.bashrcor~/.profile— to exportPERPLEXITY_API_KEYpersistently
Tests / Validation
- Basic search: Query "who won the last FIFA world cup" and expect a grounded answer with citation URLs.
- Edge case: Query with special characters (
C++,&,-vflags) to ensure proper URL encoding. - Error handling: Temporarily break the key and confirm a graceful failure message instead of a crash.
Risks, Tradeoffs, and Open Questions
| Risk | Mitigation |
|---|---|
| Perplexity API key is rate-limited / metered | Use the cheapest Sonar model (sonar) for search; reserve sonar-pro for deep queries |
Native web toolset may not support custom endpoints | Fall back to Path B wrapper script |
| Citations format from Perplexity may not match what other search providers return | Normalize the response JSON in the wrapper |
Open question: Does Hermes have a native-mcp or built-in MCP client that could expose Perplexity as a tool more cleanly? Worth checking ~/.hermes/skills/mcp/ if Path A stalls.
Decision
Proceed with Path A first.
If the native web toolset cannot ingest Perplexity directly, pivot to Path B and document the wrapper as a new skill for future reuse.