One Agent That Works in Building AI Agents

Lessons in this section

  1. Workflow or Agent?

    The four shapes of an AI helper inside an app: one model call, a chain, a router and an agent. Learn what each one can do, what it costs, and how to pick the simplest one that works.

  2. The Agent Loop by Hand

    How an agent works inside an app: it asks the model, runs a tool, reads the result and repeats. Learn why every loop needs a stop rule, a step limit and a budget.

  3. Tool Design

    The model picks a tool by reading its name and description. Learn to write clear tool cards, clear input rules and helpful error messages, so your agent picks the right tool and fixes its own mistakes.

  4. Structured Output and Validation

    Give the helper's answer a fixed shape with named boxes, then check every box before the customer sees it. Send problems back for a fix, and pass to a person after too many tries.

  5. State, Memory and Context Limits

    An AI helper can only read so much of a long chat. Learn how a memory window, a summary, a sticky note and customer memory keep the important facts close, and keep them with the right customer.

  6. Guardrails, Permissions and Human Approval

    Some actions are never allowed, and some need a person's OK. Learn how the app checks every tool request, keeps customers to their own orders, sends big refunds to a person and resists prompt injection.

  7. Streaming and Interruptions

    Show the customer what the helper is doing while it works, and stop cleanly when they press Stop. Learn streaming, progress chips, cancel checks and honest stopped messages.