Choosing the Architecture
Designing an agentic system is a series of structure choices — what to chain, what to run in parallel, and when to lean on plain code versus an LLM. Get these right and the rest of the build gets easier.
What Goes Where
Every agentic system comes down to how you arrange the work. Four decisions cover most of it.
- Chain steps that depend on each other — each one needs the last one's output
- Parallelize independent steps — nothing waits, so run them at once
- Use code for anything deterministic — a fixed rule, a lookup, a calculation
- Use the LLM only where judgment or language is needed
Code or the Model?
The LLM is expensive, slow, and unpredictable. If plain code can do a step reliably, use code — and reserve the model for what only it can do.
Plan for Failure
Steps fail — bad output, timeouts, rate limits. A robust system expects it and has somewhere to go.
- Retries — try again when a call times out or hits a limit
- Defaults — a sensible fallback value when a step cannot produce one
- A safe path — what to do when the model returns something unusable
As Simple As It Allows
Keep the design as simple as the task allows. Every branch and every agent you add is more to test and more to debug — the same simplicity discipline you met in Module 4 applies to architecture too.
Build It
How to implement: sketch your feature as boxes and arrows — mark each box “code” or “LLM,” and note one fallback for the riskiest step.
- Weekly AI Tasks tracker — validation and storage are CODE; only the “understand the message” step is the LLM. Add a fallback that asks the user to rephrase if parsing fails.
- Personal brand site — layout and links are code and templates; only the prose is the LLM.
What you learned
Architecture is a set of choices: chain dependent steps, parallelize independent ones, prefer code for deterministic work and the LLM for judgment, plan fallbacks, and keep it as simple as the task allows.