← Course Home
Phase 3 · Week 5
18 minutes
Lesson 5.1
Lesson 5.1

Agent Architecture: Designing Before You Build

Watch: Andrew Ng on planning, reflection, and tool use in agent design (20 min)

Why Architecture Comes First

Starting without a plan costs more time, not less.

When you code before designing, you hit decision points you have not thought through. You stop, backtrack, redesign. The architecture sketch is faster than the debugging session it prevents.

Ethical decisions must be made at design time.

Where does the human review step sit? What data does the agent actually need? What happens if it fails? These cannot be bolted on after the agent is built.

The sketch is the contract with your mentor.

Your mentor can give very useful feedback on a diagram that shows data flow, tools, memory stores, and decision points. They cannot give useful feedback on code they have not seen.

Five Architecture Questions

The Five Architecture Questions

Answer these before opening VSCode, Make, or n8n.

Q1 — What does the agent perceive?
List every input: file types, API responses, user messages, database records, web content. If it is not in this list, the agent cannot act on it.
Q2 — What decisions does it make?
Map the decision tree. If X then Y, if not X then Z. Where does a human need to approve? Where does the agent decide alone?
Q3 — What tools does it call, and in what order?
Name every API, database query, or external service. Define the sequence. Define what happens if a tool call fails.
Q4 — What does it need to remember?
Session context vs long-term memory. What does the agent need to know from last time? How is that stored and retrieved?
Q5 — Where does the feedback loop sit?
What does the agent check before considering a task complete? What triggers a retry? What escalates to a human?
Architecture Diagram

Common Architecture Mistakes

Starting with the tool, not the problem.
'We will use n8n because we know it.' Wrong starting point. Start with the problem and choose the tool that fits.
No human checkpoint in high-stakes outputs.
Any agent that communicates with real users about health, money, or legal matters must have a human review step before output is delivered.
Memory as an afterthought.
If your agent needs to compare today's data with last week's, the memory store must be in the architecture from day one.
No failure path.
Every tool call can fail. Every API has rate limits. Design what happens when things go wrong before they go wrong.
Common Mistakes
✏️ Student Reflection
Answer the five architecture questions for your project. Write your answers in your project log. If you cannot answer any of them — that is the gap your mentor needs to know about. Bring unanswered questions to your architecture review.

📝 Your Lesson Submission

Share your reflection, ask a question, or leave a comment. Your mentor will respond.

🔐

You need to be logged in to submit your reflection.

← Previous4.4Project Idea Brief Workshop
Next →5.2Track Workshops: Setting Up Your Build Environment🔒 Submit reflection to unlock
🔐

Create a Free Account to Continue

Lesson 1.1 and beyond are available to enrolled members. Join the program for free to access all 21+ lessons, mentor sessions, and your completion certificate.

🎓 Join the Program — It's FreeAlready a member? Log in