The Problem
Firebase Genkit provides a framework for building AI features in Node.js and Go, but its built-in search grounding options are limited. Google's Vertex AI search grounding is enterprise-priced and requires Google Cloud setup. Developers building Genkit apps need a simple, affordable search tool that integrates as a Genkit tool definition. Without web grounding, Genkit flows produce outputs based solely on the model's training data.
The Scavio Solution
Create a Genkit tool definition that wraps Scavio's API. Register it as a tool in your Genkit flow, and the model can call it whenever it needs current web data. The tool returns structured search results that Genkit's tool-use pipeline handles natively. Works with any model provider (Gemini, Claude, OpenAI) through Genkit's model-agnostic tool system.
Before
Before adding Scavio as a Genkit tool, the flow's outputs were limited to the model's training data. Users asking about current pricing, recent events, or product availability got stale or hallucinated answers.
After
After adding the Scavio tool, the Genkit flow calls web search when it detects time-sensitive queries. Answers include cited sources from live search results. The tool integrates in under 20 lines of Genkit tool definition code.
Who It Is For
Developers building AI features with Firebase Genkit who need web search grounding. Node.js and Go developers who want affordable search tool integration without Vertex AI overhead.
Key Benefits
- Genkit tool definition in under 20 lines of code
- Works with any Genkit-supported model: Gemini, Claude, OpenAI
- Structured JSON response maps to Genkit's tool output format
- Free 250 queries/month covers development and testing
- No Google Cloud or Vertex AI setup required for web grounding
Python Example
import requests
API_KEY = "your_scavio_api_key"
def scavio_search_tool(query: str) -> dict:
"""Genkit-compatible search tool function."""
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": query, "ai_overview": True},
timeout=15,
)
res.raise_for_status()
data = res.json()
results = []
if data.get("ai_overview"):
results.append({"type": "ai_overview", "text": data["ai_overview"]["text"]})
for r in data.get("organic", [])[:5]:
results.append({"type": "organic", "title": r.get("title", ""), "snippet": r.get("snippet", ""), "url": r.get("link", "")})
return {"query": query, "results": results}
# Use as a tool in your Genkit flow
result = scavio_search_tool("Firebase Genkit latest version 2026")
print(f"Found {len(result["results"])} results")
for r in result["results"]:
print(f" [{r["type"]}] {r.get("title", r.get("text", "")[:60])}")JavaScript Example
const API_KEY = "your_scavio_api_key";
// Genkit tool definition
async function scavioSearchTool(query) {
const res = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST",
headers: { "x-api-key": API_KEY, "content-type": "application/json" },
body: JSON.stringify({ platform: "google", query, ai_overview: true }),
});
if (!res.ok) throw new Error(`scavio ${res.status}`);
const data = await res.json();
const results = [];
if (data.ai_overview) results.push({ type: "ai_overview", text: data.ai_overview.text });
for (const r of (data.organic ?? []).slice(0, 5)) results.push({ type: "organic", title: r.title ?? "", snippet: r.snippet ?? "", url: r.link ?? "" });
return { query, results };
}
// Register as Genkit tool:
// ai.defineTool({ name: "webSearch", description: "Search the web", inputSchema: z.object({ query: z.string() }), outputSchema: z.any() }, async (input) => scavioSearchTool(input.query));
const result = await scavioSearchTool("Firebase Genkit latest version 2026");
result.results.forEach((r) => console.log(`[${r.type}] ${r.title ?? r.text?.slice(0, 60)}`));Platforms Used
Web search with knowledge graph, PAA, and AI overviews