This chapter covers the core execution mechanism that powers all Yao Agents, including CLI Agent in the next chapter. ## What You'll Learn The execution model is: ``` Create Hook → [ LLM + tool calls ] → Next Hook ``` Hooks are optional. You can build a fully functional agent without writing a single Hook. This chapter introduces them progressively: | Page | What you add | What you get | |------|-------------|--------------| | [Prompts](./prompts) | `prompts.yml` | Agent with personality and multiple modes | | [MCP Tools](./add-tools) | `mcps/tools.mcp.yao` | Agent that calls external tools | | [Pure Hook](./pure-hook) | `src/index.ts` | Deterministic responses without LLM | | [Create Hook](./hook-create) | `Create` function | Control LLM input, routing, delegation | | [Next Hook](./hook-next) | `Next` function | Process LLM output, drive multi-step loops | | [Context API](./context-api) | — | Full `ctx` namespace reference | | [Memory](./memory) | `ctx.memory.*` | State that persists across turns | | [Multi-Agent](./multi-agent) | `delegate` / `ctx.agent` | Agent-to-agent communication | | [Build: Bookmark Agent](./build-assistant) | Everything above | End-to-end working agent | ## What You'll Build A bookmark assistant: user pastes a URL or text → LLM extracts title, summary, and tags → saved to database → navigate to bookmark list. This covers every concept in this chapter. The full version with Sandbox + Chrome is [yao-mark](https://github.com/YaoAgents/yao-mark), covered in the CLI Agent chapter. ## Prerequisite Complete [Getting Started](/tutorials/agent/getting-started) first, or at minimum have a working `package.yao` + `prompts.yml` setup.