一键导入
recipe-research-agent
Full recipe for a web research agent with memory, semantic search, hallucination verification, and source-cited synthesis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Full recipe for a web research agent with memory, semantic search, hallucination verification, and source-cited synthesis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Agentic harness diagnostic + improvement loop. Probes the framework with real model runs, uses the rax-diagnose CLI to root-cause failures from structured trace data, ships ONE coordinated architectural fix, verifies via before/after diff, commits with empirical evidence. Use at the start of any harness improvement session — replaces ad-hoc grep + log-spelunking with a deterministic feedback loop.
Use when the architecture may have drifted from documentation, packages have grown complex, dead code or disabled systems are suspected, or before planning a major refactor — scoped to the reactive-agents-ts 22-package monorepo.
Reactive Agents framework architecture — layer stack, dependency graph, build order, and package structure. Use when planning work, understanding package relationships, or determining build dependencies.
Use when analyzing the Reactive Agents codebase for architectural improvements, abstraction opportunities, composability gaps, or Effect-TS engineering quality — before proposing refactors, during design reviews, or when codebase complexity is growing.
LLMService API contract — the correct signatures for complete(), stream(), embed(), and response types. Use when calling LLMService from any layer, writing reasoning strategies, or building LLM-dependent features.
LLM provider streaming patterns and per-provider quirks. Use when adding a new provider, implementing adapter hooks, or debugging streaming tool call behavior in packages/llm-provider.
| name | recipe-research-agent |
| description | Full recipe for a web research agent with memory, semantic search, hallucination verification, and source-cited synthesis. |
| compatibility | Reactive Agents TypeScript projects using @reactive-agents/* |
| metadata | {"author":"reactive-agents","version":"2.0","tier":"recipe"} |
A research agent that searches the web, retrieves full page content, deduplicates findings against past research in persistent memory, verifies factual accuracy, and returns a cited summary.
reasoning-strategy-selection — plan-execute-reflect strategymemory-patterns — enhanced memory for cross-session recalltool-creation — allowedTools configurationquality-assurance — hallucination detectionimport { ReactiveAgents } from "@reactive-agents/runtime";
const agent = await ReactiveAgents.create()
.withName("researcher")
.withProvider("anthropic")
.withReasoning({
defaultStrategy: "plan-execute-reflect",
maxIterations: 20,
})
.withTools({
allowedTools: ["web-search", "http-get", "checkpoint", "recall", "final-answer"],
})
.withMemory({
tier: "enhanced",
dbPath: "./memory/research.db",
})
.withVerification({
hallucinationDetection: true,
hallucinationThreshold: 0.15,
passThreshold: 0.75,
})
.withObservability({ verbosity: "normal" })
.withSystemPrompt(`
You are a research agent. For every research task:
1. Use recall("topic keywords") to check for prior research on this topic.
2. Use web-search to find 3-5 authoritative sources.
3. Use http-get to retrieve full content from the most relevant pages.
4. Checkpoint your raw findings before synthesizing.
5. Synthesize a comprehensive answer with inline citations (source URL).
6. Do not state facts you cannot attribute to a retrieved source.
`)
.build();
// Run a one-shot research task
const result = await agent.run(
"What are the latest developments in quantum error correction?"
);
console.log(result.output);
console.log(`Cost: $${result.cost?.total.toFixed(4)}`);
// Run multiple research tasks in sequence (memory persists between runs)
const topics = [
"Quantum error correction breakthroughs 2025",
"Topological qubits vs superconducting qubits comparison",
"Timeline for fault-tolerant quantum computers",
];
for (const topic of topics) {
const r = await agent.run(topic);
console.log(`\n## ${topic}\n${r.output}`);
}
// Clean up
await agent.dispose();
.withDocuments([
{ id: "internal-wiki", content: wikiContent, metadata: { source: "wiki" } },
{ id: "product-docs", content: docsContent, metadata: { source: "docs" } },
])
.withTools({
allowedTools: ["find", "web-search", "http-get", "recall", "checkpoint"],
})
// find: searches over .withDocuments() content (rag-search was removed)
// recall: searches over past agent interactions in memory
// web-search: searches the live web
.withCostTracking({ perSession: 0.50, daily: 5.0 })
// Stops if a single research task would exceed $0.50
.withProvider("anthropic")
.withModel("claude-haiku-4-5-20251001")
// Use a cheaper model for initial searches; results still verified
const result = await agent.run("Research topic...");
// result.output — markdown string with synthesis and citations
// result.cost — { input: number, output: number, total: number } (USD)
// result.steps — KernelStep[] with tool call details
// result.metadata — { iterations: number, strategy: string }
http-get on large pages returns truncated content — set a generous maxOutputChars if deep content retrieval is neededrecall only searches memory that was previously checkpointed — instruct the agent to checkpoint findings after each sessionhallucinationDetection: true adds one extra LLM call per verification pass — budget accordinglyplan-execute-reflect with maxIterations: 20 can do up to 20 tool calls — set a perSession budget in .withCostTracking() for cost control