Generative AIby Dhruv Narang

Six Workflows We Will Build

Each workflow is a different shape of graph. We build them one by one.

Sequential
ABCD
A straight line
Steps in a fixed order. Each one improves the last.
Parallel
AEBCD
Split and merge
Independent steps run at the same time, then the results join.
Loop
ABend
Go back until good
A reviewer sends the work back until it passes.
Memory
Chatmemoryone thread per user
Remember the chat
The graph saves its state, so the next message continues the talk.
Human in the loop
ABwaits for a human
Pause for approval
The graph stops, a person decides, and then it continues.
Conditional RAG
QHRFinanceIT
Choose a path
A router sends each question to the right knowledge base.

Which Workflow for Which Job?

Choose by the shape of the job.

WorkflowShapeGood for
Sequentiala straight linefixed steps: clean up, rewrite, format
Parallelsplit and mergeindependent checks that can run together
Loopa cyclewrite, review, rewrite until the quality is good
Memorya cycle that rememberssupport bots and personal assistants
Human in the loopa graph that can pauserisky actions: payments, deleting data, approvals
Conditional RAGa tree of pathsone assistant, many knowledge bases (HR, finance, IT)

Quick Revision

The whole lesson on one page.

Why
Real tasks loop
A chain only goes forward. A graph can go back, share notes and wait.
Three blocks
State, node, edge
The notebook, the worker functions, and the arrows between them.
Six shapes
One graph, many uses
Sequential, parallel, loop, memory, human in the loop, conditional RAG.