Skip to main content
AI Agents & Automation

⏱ About 20 min20 XP

Diagram an Agent

Lessons 1 through 8 have built a precise vocabulary for agent architecture: the LLM reasoning core, the planner, the tool layer, the memory system, and the orchestration loop. You have seen these components defined, examined each one's failure modes, surveyed real frameworks that implement them, and traced a concrete execution through a fully specified research agent. Now you will produce an architecture of your own — from goal to components to annotated diagram.

Diagramming is not a soft or creative supplement to technical learning. It is a rigorous test of understanding. A diagram forces you to answer questions that prose can paper over: Where exactly does retrieved context enter the context window? Does the planner run once upfront or at each loop iteration? What triggers the orchestration loop to terminate? If you cannot answer these questions concretely enough to draw them, you have identified gaps in your model that are worth filling before you build anything.

Architecture Diagrams Are Communication Tools

Professional engineers use architecture diagrams to communicate designs to teammates, to identify integration points, and to flag ambiguities before they become bugs. A well-drawn agent architecture diagram should be readable by a developer who was not in the room when it was designed — meaning every component is labeled, every data flow is annotated with what flows through it, and every external dependency is identified.

Reference: What Every Agent Diagram Must Show

A complete agent architecture diagram includes the following elements. Components: each of the five architectural components (or a justified note if one is absent for this agent). Data flows: arrows between components annotated with what data moves — a context window fill is not the same as a tool call result, and both should be labeled differently. External dependencies: any external system the agent connects to (databases, APIs, web services, file systems) identified as external boxes with their interface types. The orchestration loop boundary: a clear indication of which operations are inside the loop (repeated) and which are one-time (initialization, termination). Decision points: where the loop branches between tool-call and terminate. Error paths: at least one error-handling path shown, with its recovery mechanism. Human-in-the-loop checkpoints: if any, clearly marked with the condition that triggers them.

Flashcards — click each card to reveal the answer

Full Agent Architecture Diagram

  1. This is the lesson's core exercise. You will produce a complete, annotated architecture diagram for an AI agent of your choice.
  2. PHASE 1 — CHOOSE YOUR AGENT (5 minutes)
  3. Choose one of these tasks, or propose your own with instructor approval:
  4. (a) A personal finance agent that monitors your bank account, categorizes transactions, flags anomalies, and sends a weekly summary email.
  5. (b) A coding assistant agent that reviews pull requests: reads the diff, checks for common bugs and style issues, posts inline comments to GitHub, and flags any changes that touch security-sensitive code for human review.
  6. (c) A news curator agent that monitors RSS feeds from 20 sources, deduplicates stories, ranks them by relevance to a user-defined interest profile, and generates a daily digest.
  7. (d) Your own proposed agent — get instructor sign-off first.
  8. PHASE 2 — SPECIFY THE COMPONENTS (10 minutes)
  9. Before drawing, write a specification table:
  10. - LLM core: which model, what parameters (temperature, etc.)
  11. - Planner: one-shot, hierarchical, or reactive? How is it invoked?
  12. - Tools: list all tools (name, type: retrieval/action/computation, and one-sentence description each)
  13. - Memory: which types (in-context, external vector, external KV, in-weights)? what gets stored and when?
  14. - Orchestration loop: ReAct-style or another pattern? Max steps? Stopping conditions? Error handling? Human checkpoints?
  15. PHASE 3 — DRAW THE DIAGRAM (15 minutes)
  16. Using pencil and paper (or a digital diagramming tool), draw the full architecture. Include:
  17. - All five components as labeled boxes
  18. - All data flows as annotated arrows
  19. - All external dependencies as distinct shapes
  20. - The loop boundary clearly shown
  21. - At least one decision diamond (parse step)
  22. - At least one error path
  23. - Any human checkpoints
  24. PHASE 4 — ANNOTATE FOR FAILURE (5 minutes)
  25. On your finished diagram, mark with a red X the three places your agent is most likely to fail. For each X, write one sentence explaining the failure mode and one sentence describing how you would mitigate it.
  26. PHASE 5 — PEER REVIEW (5 minutes)
  27. Exchange diagrams with a partner. Check:
  28. 1. Are all five components present and labeled?
  29. 2. Are data flows annotated with what moves through them?
  30. 3. Is the loop boundary clear?
  31. 4. Does the diagram include a decision diamond and an error path?
  32. 5. Provide one piece of specific feedback for improvement.
  33. Deliverable: A complete annotated diagram with failure-mode annotations and peer review notes.

A student draws an agent diagram where the orchestration loop has an arrow from 'LLM core' directly to 'External database' with no tool layer in between. What architectural error does this diagram contain?

Useful Diagramming Tools

For digital diagrams: draw.io (free, browser-based, no account required) is the most accessible. Lucidchart and Miro are popular in professional settings. Excalidraw produces a hand-drawn aesthetic that is fast and collaborative. For anything code-generated, Mermaid.js lets you write diagrams as text and render them in markdown. All of these work well for agent architecture diagrams.