AI agent engineering, explained
Short, plain-English explainers of the core ideas behind building AI agents. Start here, then learn them hands-on — level by level — in Way of the Agent.
- Agent architecture The tool-use loop The tool-use loop is the core cycle an AI agent runs: the model decides on an action, a tool executes it, the result is fed back, and the model decides again — repeating until the task is done.
- Prompting System prompt A system prompt is the standing instruction given to an AI model before the conversation starts — it sets the model’s role, rules, tone, and the tools and constraints it must follow.
- Model fundamentals Context window The context window is the maximum amount of text — measured in tokens — that a model can consider at once, covering the system prompt, the conversation so far, tool results, and the reply it is generating.
- Knowledge & memory Retrieval-augmented generation (RAG) Retrieval-augmented generation (RAG) is a pattern where relevant documents are fetched from an external store at query time and inserted into the prompt, so the model answers from that fresh, specific material rather than from memory alone.
- Agent architecture Function calling Function calling (also called tool calling) is the mechanism by which a model requests a specific, defined function with structured arguments instead of replying in prose — the bridge that lets an agent actually do things.
- Safety Prompt injection Prompt injection is an attack where malicious instructions hidden in content the model reads — a web page, a file, a tool result — try to override the agent’s real instructions and make it act against the user.
- Agent architecture The ReAct pattern ReAct (Reason + Act) is an agent pattern where the model interleaves explicit reasoning with tool actions — thinking about what to do, acting, observing the result, then thinking again.
- Tooling & interoperability Model Context Protocol (MCP) The Model Context Protocol (MCP) is an open standard for connecting AI agents to external tools and data through a common interface, so any compliant client can use any compliant server.
- Knowledge & memory Agent memory Agent memory is how an agent retains information beyond a single context window — from short-term working state within a task to long-term stores it can search and reuse across sessions.
- Evaluation Evals for AI agents Evals are systematic tests that measure how well an AI agent performs a task — a test suite for non-deterministic systems, used to catch regressions and compare changes.
- Model fundamentals Hallucination A hallucination is when a model states something false or fabricated with confidence — inventing facts, sources, or details that were never in its input or true in that form.
- Knowledge & memory Embeddings An embedding is a numeric vector that represents the meaning of a piece of text or image, positioned so that similar meanings sit close together — the mechanism behind semantic search and retrieval.