veda.ng
Module 7 of 7

7. Chaining & Agents

Prompt Chaining

Output of each step becomes input for the next

Step 1: Research

Gather information, summarize sources, extract key facts

ValidateQuality gate

Check: are facts accurate? Is anything missing?

Step 2: Draft

Write first draft using research output as context

ReviewQuality gate

Check: does it match requirements? Tone? Length?

Step 3: Polish

Refine language, add formatting, finalize output

Key principle: Breaking a complex task into steps with quality gates between them produces dramatically better output than a single monolithic prompt.

A single prompt is powerful. But real-world tasks, writing a research report, building a marketing campaign, analyzing a dataset, require multiple steps where the output of one step feeds into the next. This module covers prompt chaining and how it leads to building autonomous agents.

Prompt Chain Architectures

Four patterns for chaining multiple LLM calls together

SequentialOutput of prompt A feeds into prompt BLow
ParallelRun multiple prompts simultaneously, merge resultsMedium
ConditionalRoute to different prompts based on classificationMedium
RecursiveOutput triggers re-evaluation until quality threshold metHigh