Overview
Multi-agent systems where each agent makes its own search calls waste credits on duplicate queries and get inconsistent results when they search at different times. This workflow centralizes search into an hourly refresh that all agents read from, ensuring consistency and reducing API costs.
Trigger
Hourly cron, every hour on the hour.
Schedule
Hourly
Workflow Steps
Define Shared Query Registry
Maintain a registry of search queries that multiple agents need. Each entry includes the query, platform, and which agents consume the results.
Execute All Registered Queries
Fetch fresh results for every query in the registry. Store results with timestamps so agents know how fresh the data is.
Write Cache File for Agent Consumption
Write the refreshed data to a shared cache file that all agents can read from. Include metadata about freshness and query coverage.
Agent Cache Reader Function
Provide a function that agents use to read from the cache instead of making direct API calls. Includes staleness checks.
Python Implementation
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY'], 'Content-Type': 'application/json'}
data = requests.post('https://api.scavio.dev/api/v1/search', headers=H, json={'query': 'example', 'country_code': 'us'}).json()
print(len(data.get('organic_results', [])))JavaScript Implementation
const H = {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'};
fetch('https://api.scavio.dev/api/v1/search', {method: 'POST', headers: H, body: JSON.stringify({query: 'example', country_code: 'us'})}).then(r => r.json()).then(d => console.log(d.organic_results?.length));Platforms Used
Web search with knowledge graph, PAA, and AI overviews
YouTube
Video search with transcripts and metadata
Community, posts & threaded comments from any subreddit