Files
microsoft--agent-framework/python/samples/01-get-started
wehub-resource-sync db620d33df
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:39:25 +08:00
..

Get Started with Agent Framework for Python

This folder contains a progressive set of samples that introduce the core concepts of Agent Framework one step at a time.

Prerequisites

pip install agent-framework

Set the required environment variables:

export FOUNDRY_PROJECT_ENDPOINT="https://your-project-endpoint"
export FOUNDRY_MODEL="gpt-4o"   # optional, defaults to gpt-4o

Samples

# File What you'll learn
1 01_hello_agent.py Create your first agent and run it (streaming and non-streaming).
2 02_add_tools.py Define a function tool with @tool and attach it to an agent.
3 03_multi_turn.py Keep conversation history across turns with AgentSession.
4 04_memory.py Add dynamic context with a custom ContextProvider.
5 05_functional_workflow_with_agents.py Call agents inside a functional workflow.
6 06_functional_workflow_basics.py Write a workflow as a plain async function.
7 07_first_graph_workflow.py Chain executors into a graph workflow with edges.
8 08_host_your_agent.py Host a single agent with Azure Functions.

Run any sample with:

python 01_hello_agent.py

These samples use Azure Foundry models with the Responses API. To switch providers, just replace the client, see all providers