Sonar-via-OpenRouter Search Upgrade
Swap default agent web search for Perplexity Sonar Pro plus a deep-research escalation path.
Before & after
Same prompt, same agent — the only difference is the skill.
Hallucination on research questions usually happens when the model doesn't have good information to work with. Here are some approaches: - Make sure your agent actually has a web search tool configured - Improve your prompts to explicitly ask for sources and citations - Add instructions telling the model to say "I don't know" rather than guess - Consider using retrieval-augmented generation (RAG) with a curated knowledge base - Lower the temperature setting to make outputs more deterministic - Implement a verification step where a second call checks the claims You might also look into search APIs that return richer results than basic ones. Which of these would you like to explore?
The prompt isn't the problem. Thin search results are — the model fills gaps because the gaps are real. Route search through Sonar instead. TWO-TIER ROUTING Default → perplexity/sonar-pro (~$0.005/call) Contains trigger → perplexity/sonar-deep-research (~$0.30/call) Trigger phrase: "deep research" (configurable) SETUP 1. OpenRouter key at openrouter.ai/keys 2. Set the spend cap BEFORE the first call — deep research at $0.30 and an agent in a retry loop is a bad combination discovered late. Cap: $30/mo. Alert at 80%. 3. Store as OPENROUTER_API_KEY. Not in the agent config file. PATCH — tools.md Replace the default web_search entry with the sonar router so the routing survives a new session instead of living in one prompt. PATCH — memory.md + Research routing is permanent. Use sonar-pro for factual lookups. + Escalate to sonar-deep-research only on the trigger phrase. + Never answer a factual question from parametric memory when the + router is available — cite the returned sources. Second line is what actually stops the hallucination: without it the model still answers from memory when it feels confident. VERIFY — run both, confirm the split "What did Anthropic ship this week?" → sonar-pro, ~$0.005 "deep research: agent framework landscape 2026" → deep, ~$0.30 Both should return citations. No citations = routing didn't take. COST LOG Per call: timestamp, tier, tokens, cost, trigger matched y/n. Watch the tier split for a week. If deep-research is over 10% of calls, your trigger phrase is too common — make it more specific. FALLBACK Brave on 429 or timeout, so a Sonar outage degrades instead of failing the run.
About this skill
name: agent-sonar-search-upgrade description: Swap default agent web search for Perplexity Sonar Pro plus a deep-research escalation path. Use when working on sonar-via-openrouter search upgrade.
Sonar-via-OpenRouter Search Upgrade
The default search inside most autonomous agents returns thin results, so the agent hallucinates. This skill routes normal queries through Perplexity Sonar Pro and escalates to Sonar Deep Research whenever the prompt contains an explicit trigger. It writes the OpenRouter API key with a spend cap, updates tools.md and memory.md so the routing is permanent, and gives you a per-call cost log. Use to fix weak-research answers without switching platforms.
What you get
- OpenRouter setup steps
- Two-tier model routing rules
- Spend-cap configuration
- tools.md plus memory.md patches
- Test prompts and cost verification
- Per-call cost log
Customize your output
- Trigger phrase for deep research: default 'deep research', custom
- Monthly spend cap: $10, $30, $100
- Fallback model: Brave, Google, Bing
- Per-project override: yes, no
- Retention of results: 7, 30, 90 days
- Log format: markdown, CSV
Example output
'Routed default web search to perplexity/sonar-pro. Deep-research trigger deep research routes to perplexity/sonar-deep-research. OpenRouter key set with $30/mo cap. Verified test call cost $0.02.'
Best for
Anyone whose agent already runs but returns weak research or cites nothing.
Note: High confidence. Biggest single quality lever inside an agent.
SKILL.md preview
---
name: agent-sonar-search-upgrade
description: Use when an agent web search tool returns thin results and needs routing through Perplexity Sonar Pro with a deep-research escalation path.
version: 1.0.0
category: AI Systems
author: AgentVolt
license: proprietary
tags:
- ai-systems
- p4
---
# Sonar-via-OpenRouter Search Upgrade
Replaces a default agent's weak web search with Perplexity Sonar Pro, escalating to Sonar Deep Research on an explicit trigger, with permanent routing and cost logging.
## When to use
… (sign up to view the full skill)