问题所在
LLM幻觉过时定价、已弃用API和错误版本号因为训练数据是数月前的。自信的错误答案比"我不知道"更糟糕。
Scavio 解决方案
在LLM生成前将实时搜索结果注入上下文窗口。Scavio返回结构化SERP数据包含AI Overview、知识图谱和自然搜索结果。
之前
LLM自信地说Stripe API是v2023-10-16收费2.9%+30美分。两个在2026年都是错的。
之后
生成前搜索确认Stripe API是v2026-04-01收费2.7%+30美分。LLM引用来源。用户信任回答。
适用人群
构建需要事实准确回答的聊天机器人、副驾驶和代理的AI工程师。
核心优势
- 消除幻觉的定价和版本号
- 结构化结果vs原始HTML减少token浪费
- AI Overview提取用于快速事实支撑
- 每个任务3-5次搜索总计$0.015-0.025
- 通过简单上下文注入兼容任何LLM
Python 示例
Python
import requests, os
API_KEY = os.environ["SCAVIO_API_KEY"]
def ground_with_search(query: str) -> str:
"""Fetch live search data to ground LLM responses."""
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
json={"query": query, "country_code": "us"},
timeout=10,
)
data = resp.json()
context_parts = []
if data.get("ai_overview"):
context_parts.append(f"AI Overview: {data['ai_overview'].get('text', '')}")
if data.get("knowledge_graph"):
kg = data["knowledge_graph"]
context_parts.append(f"Knowledge Graph: {kg.get('title', '')} - {kg.get('description', '')}")
for r in data.get("organic_results", [])[:5]:
context_parts.append(f"[{r.get('position')}] {r.get('title', '')}: {r.get('snippet', '')}")
return "\n".join(context_parts)
# Inject into LLM prompt
grounding = ground_with_search("stripe api pricing 2026")
prompt = f"Based on this current data:\n{grounding}\n\nAnswer: What is Stripe's current API version and pricing?"
print(prompt)JavaScript 示例
JavaScript
const H = {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'};
async function groundWithSearch(query) {
const r = await fetch('https://api.scavio.dev/api/v1/search', {method:'POST', headers:H, body:JSON.stringify({query, country_code:'us'})});
const d = await r.json();
const parts = [];
if (d.ai_overview) parts.push('AI Overview: ' + d.ai_overview.text);
for (const r of (d.organic_results||[]).slice(0,5)) parts.push('[' + r.position + '] ' + r.title + ': ' + r.snippet);
return parts.join('\n');
}
const grounding = await groundWithSearch('stripe api pricing 2026');
console.log('Grounding context:\n' + grounding);使用的平台
包含知识图谱、PAA和AI概览的网页搜索