NewThe Learning module is now liveSee what's new
Back to LearningIntermediate

AI Agents: Design Patterns and Architecture

This course teaches how to design LLM agents that hold up in production: choosing loop patterns, tools, context and memory, multi-agent splits, and the reliability and security controls around them.

11chapters
7hours
AuthorH. Liu·Staff ML Engineer·
TikTokEx-TikTok

About this course

An AI agent is an LLM that chooses its own next step: it calls a tool, reads the result, and decides what to do next until the task is done. A demo agent is easy to build. An agent that stays on track for hundreds of steps, picks the right tools, keeps the right facts in view, survives a crashed worker, and cannot be steered by a malicious web page is much harder, and that is what agent interviews probe.

This course is about designing agents you can defend in an interview. You will learn how to pick a control pattern for a task, design the tools and context the agent works with, decide when several agents beat one, and add the reliability and security controls production needs. By the end, you can take an open "design an agent that does X" prompt, or a deep dive on an agent you built, and give a clear, well-ordered answer.

What You Will Learn

  • Agent architecture patterns: ReAct, plan-and-execute, and reflection loops, when each fits, and what each costs in steps and latency
  • Tool and action space design: which tools to expose, how to describe them and shape their results, handling many tools, and when to use MCP
  • Context engineering and memory: keeping long runs within the context budget, and long-term memory with clear write, read, and forget rules
  • Multi-agent architectures: when several agents beat one, orchestrator-worker and handoff patterns, and the coordination failures to design against
  • Agent reliability: tool failures, checking actions before and after they run, safe side effects, crash recovery for long runs, and human approval
  • Agent security: indirect prompt injection through tool results, containing it by design, scoped credentials, and sandboxing
  • The agent design interview: a reusable framework for open agent design prompts and project deep dives
  • Optional: coding agents, computer-use and browser agents, and voice agents, for roles at companies that build them

How This Course Works

Each chapter starts from the simplest agent that could work, shows the concrete way it breaks, such as a context window that overflows, an injected instruction that sends an email, or a worker that crashes mid-task, and then adds the pattern that fixes that failure. Every pattern comes with the case where you should not use it.

Chapters stand on their own, and each picks the example that best shows its tradeoff: a research agent, a support agent, a coding agent. Code is short Python pseudocode, not a framework tutorial. The last core chapter pulls the decisions together into an answer framework for open design rounds; it is not a full walkthrough of one design problem.

Who This Course Is For

This course is for AI engineers and backend engineers who have built LLM features and are preparing for agent design questions in AI engineer and forward-deployed engineer interviews. You should already know prompting, tool calling, and the basic agent loop; LLM Engineering 101 covers them.

This course does not teach how to evaluate agents, how to serve models, or how to use a specific agent framework.

Chapters