Build your first agent with Microsoft Agent Framework. Your project is a small assistant for a fictional community event. It will answer questions about the event's sessions using a Python tool, then handle a follow-up question in the same conversation.
This is a beginner developer course. You need basic Python, but no previous agent-framework experience. You will create each project file from the examples; there is no companion repository to clone.
Your route
| Chapter | What you build | Lesson time |
|---|---|---|
| Connect to Learn Models | An isolated environment and configured Responses client | 15 minutes |
| Build your first agent | A runnable agent with one clear job | 15 minutes |
| Add a tool | A typed function that looks up fictional session details | 20 minutes |
| Keep conversation context | Two turns in one explicit session | 10 minutes |
| Test your agent | Offline tool checks and a live behavior checklist | 15 minutes |
Allow 75 minutes for lessons, 10 minutes for chapter checks, and 5 minutes for the final test. Downloads, account provisioning, and breaks are extra. Each chapter has two questions; the final test has five. Multiple-choice questions can have more than one correct answer. You must answer every question correctly to pass a check.
Before you start
This course has AI credits enabled. You receive your own Learn Models API key and a token allowance; you do not need to bring a provider API key. See the AI credits guide.
Sign in, start the course, and open AI API Details in the lesson sidebar. Prepare your Python environment before activating access, because activation starts the expiry timer. Access normally lasts twice the estimated course duration: 180 consecutive minutes for this course. Closing your browser does not pause it. Access ends when you complete the course or the key expires; requests also stop when your allowance is used up. Finish the live exercises before completing the course.
Copy your base URL, reveal your private API key, and choose a listed model that supports Responses and function calling. The examples use placeholders for these personal connection details, not a public OpenAI or Azure endpoint. Check AI API Details for your actual balance and expiry time. All available models share your balance, and both input and output tokens count, including reasoning tokens when reported. Send requests one at a time.
If you need more time or tokens, choose Request more access in that window. Extra access requires organiser approval and is not automatic.
All event data is fictional and public. The tool does not book seats, send messages, or access a database. This project teaches the basics, not a production deployment architecture.
What you will learn
- Explain what the model, agent, client, tools, and session each do
- Connect Microsoft Agent Framework to a custom Responses API endpoint
- Build and run a Python agent with clear instructions
- Expose a typed, read-only Python function as an agent tool
- Reuse a session for follow-up questions without mixing users
- Test tool behavior and inspect model-dependent results
Before you start
- You can write Python functions and use a terminal
- Python 3.10 or newer and a code editor
- Access to Learn Models with an API key, an OpenAI-compatible Responses API base URL, and a model ID
- A Learn Models model that supports function calling
Course modules
Connect to Learn Models
Prepare Python and configure the Responses client without hard-coding credentials.
Build your first agent
Give an agent a focused job and send its first request through Learn Models.
Add a tool
Expose a small typed lookup function and observe the framework's tool loop.
Keep conversation context
Use an explicit session to connect follow-up questions and keep conversations separate.
Test your agent
Separate deterministic tool checks from model-dependent behavior and record failures honestly.