Agent SDK Building Blocks
The pieces that make up an SDK-based agent.
What an SDK Agent Really Is
An Agent SDK agent is not a single API call. It is a loop built from a few reusable pieces that work together.
In this lesson you will learn the core building blocks: the request fields, the tools the model can call, the agentic loop that drives it, and the coordinator + subagents pattern for bigger jobs.
Master these pieces and you can reason about almost any production agent the exam throws at you.
The Request: model, messages, tools
Every turn starts with one request. Its key fields are: model, max_tokens, system, messages, tools, and tool_choice.
The single most important fact: the model keeps NO state between turns. You must send the FULL conversation history in messages on every request. There is no hidden server-side memory.
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-5",
max_tokens=1024,
system="You are a support agent.",
messages=conversation_history, # FULL history every turn
tools=tools,
tool_choice={"type": "auto"},
)All lessons in this course
- Agent SDK Building Blocks
- Defining an Agent
- The Task Tool & allowedTools
- Principle of Least Privilege