Research Workflow Design
Research workflows are among the most valuable applications of prompt chaining. They gather, analyze, and synthesize information from multiple sources into coherent insights.
The Research Chain Architecture
Query → Decompose → Search → [Multiple Sources] → Extract → Verify → Synthesize → Report
Core Components
Query Decomposition
Break complex research questions into searchable sub-queries:
Loading Prompt Playground...
Multi-Source Search
Search different sources in parallel:
async function multiSourceSearch(subQueries) {
const searchPromises = subQueries.map(async (sq) => {
const sources = {
academic: () => searchAcademicPapers(sq.query),
news: () => searchNews(sq.query),
government: () => searchGovSites(sq.query),
industry: () => searchIndustryReports(sq.query)
};
return {
query: sq.query,
results: await sources[sq.source_type]()
};
});
return Promise.all(searchPromises);
}
Information Extraction
Extract structured data from search results:
Loading Prompt Playground...
Building the Research Pipeline
Stage 1: Planning
const researchPlan = {
query: originalQuery,
scope: {
timeRange: 'last 5 years',
geographicFocus: 'California, USA',
sourceTypes: ['academic', 'government', 'industry']
},
subQueries: decomposedQueries,
expectedOutputs: [
'Environmental impact statistics',
'Economic analysis',
'Comparative data'
]
};
Stage 2: Collection
async function collectResearch(plan) {
const collected = {
sources: [],
statistics: [],
claims: [],
gaps: []
};
for (const subQuery of plan.subQueries) {
const results = await searchAndExtract(subQuery);
collected.sources.push(...results.sources);
collected.statistics.push(...results.statistics);
collected.claims.push(...results.claims);
// Identify gaps
if (results.coverage < 0.7) {
collected.gaps.push({
query: subQuery.query,
missing: results.missingAspects
});
}
}
return collected;
}
Stage 3: Verification
Loading Prompt Playground...
Stage 4: Synthesis
async function synthesizeFindings(verifiedFindings, originalQuery) {
const synthesisPrompt = `
Based on these verified findings, synthesize a comprehensive answer
to the original research question.
ORIGINAL QUESTION: ${originalQuery}
VERIFIED FINDINGS:
${formatFindings(verifiedFindings)}
SYNTHESIS REQUIREMENTS:
1. Address all aspects of the original question
2. Cite sources for key claims
3. Acknowledge areas of uncertainty
4. Note any important limitations
5. Provide balanced perspective
Generate a structured synthesis:
`;
return await llm.chat({ content: synthesisPrompt });
}
Quality Controls
Source Evaluation
function evaluateSource(source) {
const scores = {
recency: calculateRecencyScore(source.date),
authority: evaluateAuthority(source.type, source.publisher),
methodology: assessMethodology(source.content),
bias: detectBias(source.content, source.publisher)
};
return {
...scores,
overall: weightedAverage(scores, {
recency: 0.2,
authority: 0.35,
methodology: 0.3,
bias: 0.15
})
};
}
Claim Tracking
const claimTracker = {
claims: [],
addClaim(claim, sources) {
this.claims.push({
claim,
sources,
supportCount: sources.length,
highQualitySources: sources.filter(s => s.credibility === 'high').length,
conflictingEvidence: false
});
},
markConflict(claimIndex, conflictingClaim) {
this.claims[claimIndex].conflictingEvidence = true;
this.claims[claimIndex].conflicts = this.claims[claimIndex].conflicts || [];
this.claims[claimIndex].conflicts.push(conflictingClaim);
}
};
Exercise: Design a Research Workflow
Design a complete research workflow:
Loading Prompt Playground...
Key Takeaways
- Decompose complex queries into searchable sub-queries
- Search multiple source types in parallel
- Extract structured data from each source
- Verify findings for consistency and credibility
- Track claims and their supporting sources
- Synthesize findings while acknowledging limitations
- Include proper citations throughout
- Identify and address research gaps
Next, we'll explore how to synthesize information from multiple sources.

