Overview
LangGraph research agents that rely solely on search produce repetitive results because they forget previous sessions. This workflow adds persistent memory so the agent builds on past research. The search step fills knowledge gaps while memory provides continuity. Each research session costs $0.05-0.25 in search queries.
Trigger
On-demand via API call or scheduled weekly for recurring research topics.
Schedule
On-demand or weekly for recurring topics
Workflow Steps
Load Previous Research from Memory
Retrieve relevant context from the persistent memory store. This includes past findings, open questions, and known facts about the research topic.
Identify Knowledge Gaps
Compare the current research question against stored knowledge. Identify what is already known and what needs fresh search data.
Execute Targeted Searches
Run search queries only for identified gaps. Use Google for facts, Reddit for opinions, YouTube for tutorials. Avoid re-searching what memory already covers.
Synthesize and Update Memory
Merge new search findings with existing memory. Update the knowledge store with new facts, changed information, and resolved questions.
Generate Research Output
Produce the research report or answer, citing both memory-sourced and search-sourced information with timestamps for freshness.
Python Implementation
import requests, os
API_KEY = os.environ["SCAVIO_API_KEY"]
def research_search(queries: list) -> list:
"""Execute targeted research searches for identified knowledge gaps."""
results = []
for q in queries:
platform = "reddit" if "opinion" in q.lower() else "youtube" if "tutorial" in q.lower() else "google"
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
json={"query": q, "platform": platform, "country_code": "us"},
timeout=15,
)
data = resp.json()
results.append({
"query": q,
"platform": platform,
"findings": [
{"title": r.get("title", ""), "snippet": r.get("snippet", ""), "url": r.get("link", "")}
for r in data.get("organic_results", [])[:5]
],
})
return results
# Targeted searches for knowledge gaps only
gaps = ["LangGraph v0.3 breaking changes 2026", "langgraph memory implementation opinion"]
findings = research_search(gaps)
for f in findings:
print(f"[{f['platform']}] {f['query']}: {len(f['findings'])} results")JavaScript Implementation
const H = {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'};
async function researchSearch(queries) {
const results = [];
for (const q of queries) {
const platform = q.toLowerCase().includes('opinion') ? 'reddit' : q.toLowerCase().includes('tutorial') ? 'youtube' : 'google';
const r = await fetch('https://api.scavio.dev/api/v1/search', {method:'POST', headers:H, body:JSON.stringify({query:q, platform, country_code:'us'})});
const d = await r.json();
results.push({query:q, platform, findings:(d.organic_results||[]).slice(0,5).map(r=>({title:r.title, snippet:r.snippet, url:r.link}))});
}
return results;
}
const gaps = ['LangGraph v0.3 breaking changes 2026', 'langgraph memory tutorial'];
const findings = await researchSearch(gaps);
findings.forEach(f => console.log('['+f.platform+'] '+f.query+': '+f.findings.length+' results'));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