ai-agents-for-beginners / zh-CN
AGENTS.md76k starsChanged 5 months agoMITView on GitHub
本仓库包含“初学者的AI代理”——一个全面的教育课程,教授构建AI代理所需的全部知识。课程包含18节课(编号00-18),涵盖基础知识、设计模式、框架、生产部署、本地/设备端代理以及AI代理的安全性。 关键技术: - Python 3.12+ - 用于交互式学习的Jupyter笔记本 - AI框架:微软代理框架(Microsoft Agent Framework,MAF) - Azure AI服务:Microsoft Foundry,Microsoft Foundry Agent Service V2 架构: - 基于课程的结构(00-15+ 目录) - 每节课包含:README文档、代码示例(Jupyter笔记本)和图片 - 通过自动翻译系统支持多语言 - 每节课一个使用微软代理框架的Python笔记本 对于 Microsoft Foundry(必填): - AZURE_AI_PROJECT_ENDPOINT - Microsoft Foundry项目端点 - AZURE_AI_MODEL_DEPLOYMENT_NAME - 模型部署名称(例如 gpt-5-mini) 对于 Azure AI Search(第五课 - RAG): - AZURE_SEARCH_SERVICE_ENDPOINT - Azure AI Search端点 - AZURE_SEARCH_API_KEY - Azure AI Search API密钥 认证:运行 az login 后再运行笔记本(使用 AzureCliCredential)。 每节课程包含多个适用于不同框架的Jupyter笔记本: 微软代理框架 + Microsoft Foundry: - 需要Azure订阅 - 使用 FoundryChatClient 访问Agent Service V2(代理可见于Foundry门户) -…
- Reads credentials
- Installs packages
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about microsoft/ai-agents-for-beginners
- @rodtrent.com“AI Agents for Beginners - 10 Lessons teaching everything you need to know to start building AI Agents …”Bluesky · Feb 14, 2025 · 25 likes
- A Hacker News story“Lessons to Get Started Building AI Agents”Hacker News · Jul 4, 2025 · 10 points
- @rdenadai.dev“Pô, parece legal a grade hein... Deixar na lista aqui pra estudar depois da certificação da AWS.”Bluesky · Sep 7, 2025 · 7 likes
- @alvinashcraft.com“AI Agents for Beginners - 10 Lessons to Get Started Building AI Agents. …”Bluesky · Feb 22, 2025 · 7 likes
- @ottorinobruni.bsky.social“🚨 Want to learn AI Agents from scratch? Microsoft’s free 18-lesson course covers frameworks, tools, RAG, …”Bluesky · Nov 20, 2026 · 4 likes
The biggest 5 of 88 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 88
Talked about on GitHub, Bluesky and Hacker News (88 times).
On GitHub · 50
- Oct 14, 2026"Lesson" is not being translated. (en→ja) — Azure/co-op-translator1 reaction
- Jul 25, 2026Previous and Next lessons have not been translated. (en→jp) — Azure/co-op-translator1 reaction · 1 comment
- Jul 4, 2026Translated the markdown header ## Summary to ## まとめ (en→jp) — Azure/co-op-translator1 reaction · 1 comment
- Mar 31, 2026"Join the [Microsoft Foundry Discord]~" has not been translated. (en→ja) — Azure/co-op-translator1 reaction · 3 comments
- Mar 17, 2026The headline has not been translated (en→ja) — Azure/co-op-translator1 reaction · 2 comments
45 more on GitHub
- Mar 15, 2026Code block before and after it has not been translated. (en→ja) — Azure/co-op-translatorsays it tested it1 reaction · 3 comments
- Nov 18, 2025README Structure — notoriousmic/github-copilot-workshop1 reaction
- Oct 2, 2025[KO] Translation improvement for "{days}" usage — Azure/co-op-translator1 reaction · 1 comment
- Oct 2, 2025[KO] Translation improvement for "{days}" usage — Azure/co-op-translator1 reaction
- Sep 15, 2025HTML tags (e.g., <a>) are stripped or lost during translation — Azure/co-op-translator1 reaction · 2 comments
- Sep 7, 2025``` not handled correctly (en→ja) — Azure/co-op-translator1 reaction · 3 comments
- May 7, 2025Correcting all misc errors found across code samples for Lessons 04, 06, 09. — jabari-max/Mohammadhadi-Jabari1 reaction
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T010: retrieval with source attribution — scenario assessment [05-agentic-rag] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T009: confidence-gated escalation — evaluation experiment [09-metacognition] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T008: allowlisted action policy — failure and recovery example [06-building-trustworthy-agents] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T007: dependency-plan validation — worked example with checks [07-planning-design] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T006: dependency-plan validation — refactor the teaching example [08-multi-agent] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T005: bounded agent loop — offline service adapter [01-intro-to-ai-agents] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T004: trace aggregation — invariant and state trace [10-ai-agents-production] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T003: agent-component routing — compare two approaches [03-agentic-design-patterns] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T002: retrieval with source attribution — boundary-case lesson extension [05-agentic-rag] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T001: bounded agent loop — runnable concept example [01-intro-to-ai-agents] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T030: model-manifest selection — scenario assessment [17-creating-local-ai-agents] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T029: trace aggregation — evaluation experiment [16-deploying-scalable-agents] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T028: bounded agent loop — failure and recovery example [14-microsoft-agent-framework] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T033: retrieval with source attribution — invariant and state trace [05-agentic-rag] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T032: bounded agent loop — compare two approaches [14-microsoft-agent-framework] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T038: prompt-template escaping — failure and recovery example [12-context-engineering] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T037: typed tool dispatch — worked example with checks [04-tool-use] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T036: bounded conversation memory — evaluation experiment [13-agent-memory] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T035: bounded conversation memory — refactor the teaching example [11-agentic-protocols] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T034: retrieval with source attribution — offline service adapter [05-agentic-rag] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T040: confidence-gated escalation — scenario assessment [09-metacognition] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T039: bounded conversation memory — boundary-case lesson extension [13-agent-memory] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T044: bounded conversation memory — invariant and state trace [11-agentic-protocols] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T043: agent-component routing — offline service adapter [03-agentic-design-patterns] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T042: dependency-plan validation — compare two approaches [08-multi-agent] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Himanshi Gupta (2601010156) — R17-T049: tamper-evident action receipt — scenario assessment [18-securing-ai-agents] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Himanshi Gupta (2601010156) — R17-T048: prompt-template escaping — evaluation experiment [12-context-engineering] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Himanshi Gupta (2601010156) — R17-T047: agent-component routing — failure and recovery example [02-explore-agentic-frameworks] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Himanshi Gupta (2601010156) — R17-T046: trace aggregation — worked example with checks [10-ai-agents-production] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Hasrat Marwaha (2601010152) — R17-T050: confidence-gated escalation — runnable concept example [09-metacognition] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Hasrat Marwaha (2601010152) — R17-T055: confidence-gated escalation — offline service adapter [09-metacognition] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Hasrat Marwaha (2601010152) — R17-T052: agent-component routing — compare two approaches [02-explore-agentic-frameworks] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Avi Garg (2601010083) — R17-T057: dependency-plan validation — worked example with checks [08-multi-agent] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Avi Garg (2601010083) — R17-T056: agent-component routing — refactor the teaching example [03-agentic-design-patterns] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 16, 2026agent-skills.github.microsoft.ai-agents-for-beginners: 0-unstable-2026-09-10 → 0-unstable-2026-11-07 — sudosubin/agents.nix0 reactions
- Oct 14, 2026agent-skills.github.microsoft.ai-agents-for-beginners: 0-unstable-2026-07-13 → 0-unstable-2026-09-10 — sudosubin/agents.nix0 reactions
- Sep 30, 2026agent-skills.github.microsoft.ai-agents-for-beginners: init at 0-unstable-2026-07-13 — sudosubin/agents.nix0 reactions
- Sep 6, 2026Batch 78: Claude usage-limit tips, n8n grounding technique, coding-agent CLIs, OSS-to-service ideas — dmavridi6478/business0 reactions
On Bluesky · 35
- Feb 14, 2025AI Agents for Beginners - 10 Lessons teaching everything you need to know to start building AI Agents github.com/microsoft/ai...… — @rodtrent.com25 likes and reposts · 1 reply
- Sep 7, 2025Pô, parece legal a grade hein... Deixar na lista aqui pra estudar depois da certificação da AWS. — @rdenadai.dev7 likes and reposts
- Feb 22, 2025AI Agents for Beginners - 10 Lessons to Get Started Building AI Agents. https://github.com/microsoft/ai-agents-for-beginners #ai #aiagents… — @alvinashcraft.com7 likes and reposts
- Nov 20, 2026🚨 Want to learn AI Agents from scratch? Microsoft’s free 18-lesson course covers frameworks, tools, RAG, multi-agents, production & more… — @ottorinobruni.bsky.social4 likes and reposts
- Apr 4, 202510 Lessons teaching everything you need to know to start building AI Agents github.com/microsoft/ai... — @asiermarques.com3 likes and reposts
30 more on Bluesky
- Mar 23, 2025📦 microsoft / ai-agents-for-beginners ⭐ 5,023 (+55) 🗒 Jupyter Notebook 10 Lessons to Get Started Building AI Agents — @github-trending.bsky.social3 likes and reposts
- Oct 20, 2026Stage 3: Agent fundamentals AI Agents for Beginners, Microsoft (18 lessons, 77k+ stars) github.com/microsoft/a... Hugging Face AI Agents… — @astrodevil1.bsky.social2 likes and reposts · 1 reply
- May 18, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 62,102 (+180) 🗒 Jupyter Notebook 12 Lessons to Get Started… — @github-trending.bsky.social2 likes and reposts
- Dec 17, 2025Microsoft AI agents for beginners resource 👀 #fyp #typescript #agent #coding #llm #viral #viralvideo github.com/microsoft/ai... — @krystalmess.bsky.social2 likes and reposts
- Nov 12, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 44,431 (+193) 🗒 Jupyter Notebook 12 Lessons to Get Started… — @github-trending.bsky.social2 likes and reposts
- Sep 7, 2025AI Agents for Beginners 11 Lessons to Get Started Building AI Agents. https://github.com/microsoft/ai-agents-for-beginners — @pythonhub.dev2 likes and reposts
- Jun 16, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 27,064 (+437) 🗒 Jupyter Notebook 11 Lessons to Get Started… — @github-trending.bsky.social2 likes and reposts
- Apr 26, 2025🚀 Dive into Microsoft’s “AI Agents for Beginners” a 10-lesson course designed to help you build AI agents using tools like Azure AI Agent… — @sean.techsnazzy.com2 likes and reposts
- Apr 21, 2025DesktopCommander MCP is trending on GitHub! Check it out alongside other amazing projects from: @microsoft github.com/microsoft/ai..., @n8n… — @desktopcommander.bsky.social2 likes and reposts
- Feb 14, 2025Microsoft’s #AI Agents for Beginners is a great hands-on resource for learning AI agents from scratch. Perfect for beginners and developers… — @mertyeter.bsky.social2 likes and reposts
- Jul 17, 2026微软开源了一套免费课程《AI Agents for Beginners》,GitHub 已封战 61k+ 星。 课程内容:什么是 AI Agent、怎么用 Tool/MCP、多代理人系统、Context 管理、让 AI 操作浏览器、安全部署——一路到完整实战。… — @anotherbug.com1 likes and repost
- Jun 8, 2026https://github.com/microsoft/ai-agents-for-beginners — @tom-doerr.bsky.social1 likes and repost
- May 3, 2026https://github.com/microsoft/ai-agents-for-beginners — @tom-doerr.bsky.social1 likes and repost
- Apr 21, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 57,227 (+131) 🗒 Jupyter Notebook 12 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost
- Feb 14, 2026https://github.com/microsoft/ai-agents-for-beginners — @tom-doerr.bsky.social1 likes and repost
- Jan 10, 2026https://github.com/microsoft/ai-agents-for-beginners — @tom-doerr.bsky.social1 likes and repost
- Dec 5, 20254) ai-agents-for-beginners ↳ 11 Lessons teaching everything you need to know to start building AI Agents. GitHub: github.com/microsoft/ai... — @analyticalrohit.bsky.social1 likes and repost · 1 reply
- Sep 8, 2025AI Agent for Beginners: github.com/microsoft/ai... ---- 📌 Join 3,000+ ML enthusiasts and professionals from 100 countries. ✅ Learn AI for… — @analyticalrohit.bsky.social1 likes and repost · 1 reply
- Jul 23, 20254) ai-agents-for-beginners ↳ 11 Lessons teaching everything you need to know to start building AI Agents. GitHub: github.com/microsoft/ai... — @analyticalrohit.bsky.social1 likes and repost · 1 reply
- Jun 12, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 25,485 (+175) 🗒 Jupyter Notebook 11 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost
- May 29, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 22,020 (+180) 🗒 Jupyter Notebook 11 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost
- Apr 14, 2025🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 14,149 (+688) 🗒 Jupyter Notebook 10 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost · 1 reply
- Apr 10, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 11,709 (+403) 🗒 Jupyter Notebook 10 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost
- Mar 23, 2025Fundamentals of building AI Agents, a place to start. github.com/microsoft/ai... — @cloudnativeboy.bsky.social1 likes and repost
- Feb 22, 2025🤖 Include anche esempi di implementazione di workflow usando #Autogen. 🚀 È un contributo davvero interessante. Insieme al corso… — @alessiopomaro.it1 likes and repost · 1 reply
- Jul 1, 20261. Hugging Face — AI Agents Course huggingface.co/learn/agent... 2. Microsoft — AI Agents for Beginners github.com/microsoft/a... 3.… — @aipromptgirl.bsky.social0 likes and reposts · 1 reply
- Jan 3, 2026AI Agents for Beginners (Microsoft) A free, structured 11-lesson course to get started with AI agents the right way.… — @jackfusion.bsky.social0 likes and reposts · 1 reply
- Jul 20, 20252️⃣ AI Agents for Beginners Free 11-part intro course, build your first AI agents step-by-step. 🔗 github.com/microsoft/a... — @arindam-1729.bsky.social0 likes and reposts · 1 reply
- Jun 13, 2025GitHub repo → github.com/microsoft/a... — @arindam-1729.bsky.social0 likes and reposts · 1 reply
- Mar 24, 2025Microsoft's "AI Agents for Beginners," is designed to teach you everything you need to know to start building AI Agents. The course… — @kuanhoong.bsky.social0 likes and reposts · 1 reply
On Hacker News · 3
- Jul 4, 2025Lessons to Get Started Building AI Agents10 points
- Apr 14, 2025AI Agents for Beginners2 points
- Feb 14, 2025AI Agents for Beginners – A 10 Lesson Course2 points
In this repository338 other files it gives its agents.
- AGENTS.mdAGENTS.md
- translations/ar/AGENTS.mdAGENTS.md
- translations/bg/AGENTS.mdAGENTS.md
- translations/bn/AGENTS.mdAGENTS.md
- translations/cs/AGENTS.mdAGENTS.md
- translations/da/AGENTS.mdAGENTS.md
- translations/de/AGENTS.mdAGENTS.md
- translations/el/AGENTS.mdAGENTS.md
- translations/en/AGENTS.mdAGENTS.md
- translations/es/AGENTS.mdAGENTS.md
- translations/et/AGENTS.mdAGENTS.md
- translations/fa/AGENTS.mdAGENTS.md
- translations/fi/AGENTS.mdAGENTS.md
- translations/fr/AGENTS.mdAGENTS.md
- translations/he/AGENTS.mdAGENTS.md
- translations/hi/AGENTS.mdAGENTS.md
- translations/hr/AGENTS.mdAGENTS.md
- translations/hu/AGENTS.mdAGENTS.md
- translations/id/AGENTS.mdAGENTS.md
- translations/it/AGENTS.mdAGENTS.md
- translations/ja/AGENTS.mdAGENTS.md
- translations/km/AGENTS.mdAGENTS.md
- translations/kn/AGENTS.mdAGENTS.md
- translations/ko/AGENTS.mdAGENTS.md
- translations/lt/AGENTS.mdAGENTS.md
- translations/ml/AGENTS.mdAGENTS.md
- translations/mr/AGENTS.mdAGENTS.md
- translations/ms/AGENTS.mdAGENTS.md
- translations/my/AGENTS.mdAGENTS.md
- translations/ne/AGENTS.mdAGENTS.md
- translations/nl/AGENTS.mdAGENTS.md
- translations/no/AGENTS.mdAGENTS.md
- translations/pa/AGENTS.mdAGENTS.md
- translations/pcm/AGENTS.mdAGENTS.md
- translations/pl/AGENTS.mdAGENTS.md
- translations/pt-BR/AGENTS.mdAGENTS.md
- translations/pt-PT/AGENTS.mdAGENTS.md
- translations/ro/AGENTS.mdAGENTS.md
- translations/ru/AGENTS.mdAGENTS.md
- translations/sk/AGENTS.mdAGENTS.md
- translations/sl/AGENTS.mdAGENTS.md
- translations/sr/AGENTS.mdAGENTS.md
- translations/sv/AGENTS.mdAGENTS.md
- translations/sw/AGENTS.mdAGENTS.md
- translations/ta/AGENTS.mdAGENTS.md
- translations/te/AGENTS.mdAGENTS.md
- translations/th/AGENTS.mdAGENTS.md
- translations/tl/AGENTS.mdAGENTS.md
- translations/tr/AGENTS.mdAGENTS.md
- translations/uk/AGENTS.mdAGENTS.md
- translations/ur/AGENTS.mdAGENTS.md
- translations/vi/AGENTS.mdAGENTS.md
- translations/zh-HK/AGENTS.mdAGENTS.md
- translations/zh-MO/AGENTS.mdAGENTS.md
- translations/zh-TW/AGENTS.mdAGENTS.md
- 15-browser-use/llms.txtllms.txt
- azure-openai-to-responsesSkill
- deploying-scalable-agentsSkill
- jupyter-notebookSkill
- local-ai-agentsSkill
- The first 60 shown.
The file
Files
AGENTS.md
项目概述
本仓库包含“初学者的AI代理”——一个全面的教育课程,教授构建AI代理所需的全部知识。课程包含18节课(编号00-18),涵盖基础知识、设计模式、框架、生产部署、本地/设备端代理以及AI代理的安全性。
关键技术:
- Python 3.12+
- 用于交互式学习的Jupyter笔记本
- AI框架:微软代理框架(Microsoft Agent Framework,MAF)
- Azure AI服务:Microsoft Foundry,Microsoft Foundry Agent Service V2
架构:
- 基于课程的结构(00-15+ 目录)
- 每节课包含:README文档、代码示例(Jupyter笔记本)和图片
- 通过自动翻译系统支持多语言
- 每节课一个使用微软代理框架的Python笔记本
环境搭建命令
先决条件
- Python 3.12或更高版本
- Azure订阅(用于Microsoft Foundry)
- 已安装并登录Azure CLI(
az login)
初始设置
- 克隆或分叉仓库:
gh repo fork microsoft/ai-agents-for-beginners --clone # 或者 git clone https://github.com/microsoft/ai-agents-for-beginners.git cd ai-agents-for-beginners - 创建并激活Python虚拟环境:
python3 -m venv venv source venv/bin/activate # 在 Windows 上:venv\Scripts\activate - 安装依赖项:
pip install -r requirements.txt - 设置环境变量:
cp .env.example .env # 使用您的 API 密钥和端点编辑 .env
必需的环境变量
对于 Microsoft Foundry(必填):
AZURE_AI_PROJECT_ENDPOINT- Microsoft Foundry项目端点AZURE_AI_MODEL_DEPLOYMENT_NAME- 模型部署名称(例如 gpt-5-mini)
对于 Azure AI Search(第五课 - RAG):
AZURE_SEARCH_SERVICE_ENDPOINT- Azure AI Search端点AZURE_SEARCH_API_KEY- Azure AI Search API密钥
认证:运行 az login 后再运行笔记本(使用 AzureCliCredential)。
开发工作流程
运行Jupyter笔记本
每节课程包含多个适用于不同框架的Jupyter笔记本:
- 启动Jupyter:
jupyter notebook <strong>进入某个课程目录</strong>(例如01-intro-to-ai-agents/code_samples/)- 打开并运行笔记本:
*-python-agent-framework.ipynb- 使用微软代理框架(Python)*-dotnet-agent-framework.ipynb- 使用微软代理框架(.NET)
使用微软代理框架
微软代理框架 + Microsoft Foundry:
- 需要Azure订阅
- 使用
FoundryChatClient访问Agent Service V2(代理可见于Foundry门户) - 生产就绪,内置可观测性
- 文件模式:
*-python-agent-framework.ipynb
测试说明
这是一个教程仓库,含示例代码,而非带自动化测试的生产代码。验证环境和更改的方法:
手动测试
- 测试Python环境:
python --version # 应该是3.12以上 pip list | grep -E "(agent-framework|azure-ai|azure-identity)" - 测试笔记本执行:
# 将笔记本转换为脚本并运行(测试导入) jupyter nbconvert --to script <lesson-folder>/code_samples/<notebook>.ipynb --stdout | python - 核实环境变量:
python -c "import os; from dotenv import load_dotenv; load_dotenv(); print('✓ AZURE_AI_PROJECT_ENDPOINT' if os.getenv('AZURE_AI_PROJECT_ENDPOINT') else '✗ AZURE_AI_PROJECT_ENDPOINT missing')"
运行单个笔记本
在Jupyter中打开笔记本,按顺序执行单元。每个笔记本均为自包含,包含:
- 导入语句
- 配置加载
- 示例代理实现
- 预期输出(位于markdown单元)
部署代理的冒烟测试
在代理作为Microsoft Foundry托管代理部署的课程(01、04、05、16)中,本仓库提供了位于 tests/ 下的冒烟测试目录,由 .github/workflows/smoke-test.yml 工作流通过AI冒烟测试动作运行。这是轻量级的部署后检查(代理是否可达且基本响应符合预期?),是课程10和16评估流程的补充。有关目录到课程再到代理的映射,详见 tests/README.md。第17课在本地运行Foundry Local,无托管端点,通过直接运行笔记本验证。
代码风格
Python规范
- Python版本:3.12+
<strong>代码风格</strong>:遵循标准Python PEP 8规范<strong>笔记本</strong>:使用清晰的markdown单元解释概念<strong>导入</strong>:按标准库、第三方、本地模块分组
Jupyter笔记本规范
- 在代码单元前加入描述性markdown单元
- 在笔记本中添加输出示例供参考
- 使用与课程概念匹配的清晰变量名
- 保持笔记本执行顺序线性(单元1 → 2 → 3…)
文件组织
<lesson-number>-<lesson-name>/
├── README.md # Lesson documentation
├── code_samples/
│ ├── <number>-python-agent-framework.ipynb
│ └── <number>-dotnet-agent-framework.ipynb (optional)
└── images/
└── *.png构建与部署
文档构建
本仓库使用Markdown编写文档:
- 各课程文件夹下的README.md文件
- 仓库根目录主README.md
- 通过GitHub Actions实现自动翻译系统
CI/CD流程
位于 .github/workflows/:
- co-op-translator.yml - 自动翻译成50+种语言
- welcome-issue.yml - 欢迎新创建问题的用户
- welcome-pr.yml - 欢迎新拉取请求贡献者
部署
这是一个教学仓库——无部署流程。用户:
- 分叉或克隆仓库
- 本地或GitHub Codespaces中运行笔记本
- 通过修改和实验示例学习
拉取请求指南
提交前
- 测试修改:
- 完整运行受影响的笔记本
- 确认所有单元格无错误
- 检查输出是否合理
- 文档更新:
- 若新增概念,更新README.md
- 笔记本复杂代码添加注释
- 确保markdown单元解释目的
- 文件变更:
- 避免提交
.env文件(使用.env.example) - 不提交
venv/或__pycache__/目录 - 展示概念时保留笔记本输出
- 移除临时文件和备份笔记本(
*-backup.ipynb)
- 避免提交
PR标题格式
使用描述性标题:
[Lesson-XX] 添加<概念>的新示例[Fix] 修正第XX课README中的拼写错误[Update] 改进第XX课代码示例[Docs] 更新安装说明
必要检查
- 笔记本应无错误执行
- README文件应清晰准确
- 遵循仓库现有代码模式
- 保持与其他课程一致
附加说明
常见问题
- Python版本不匹配:
- 确保使用Python 3.12+
- 部分包不支持旧版
- 使用
python3 -m venv明确指定Python版本
- 环境变量:
- 始终从
.env.example创建.env - 不提交
.env文件(已加入.gitignore) - 使用
az login进行无密Entra ID认证
- 始终从
- 包冲突:
- 使用新虚拟环境
- 从
requirements.txt安装,不单独安装包 - 有些笔记本markdown单元中提及额外依赖
- Azure服务:
- 需要有效的Azure订阅
- 部分功能有区域限制
- 确保你的Azure OpenAI模型部署支持Responses API
学习路线
建议按顺序学习课程:
- 00-course-setup - 环境搭建开始
- 01-intro-to-ai-agents - 理解AI代理基础
- 02-explore-agentic-frameworks - 学习不同框架
- 03-agentic-design-patterns - 核心设计模式
- 按编号顺序继续后续课程
框架选择
根据目标选择框架:
<strong>所有课程</strong>:微软代理框架(MAF)配合FoundryChatClient<strong>代理在服务器端注册</strong>,在Microsoft Foundry Agent Service V2中,并可在Foundry门户查看
获取帮助
- 加入 Microsoft Foundry社区Discord
- 查看课程README文件获取具体指导
- 查阅主README.md了解课程概览
- 参阅课程环境搭建详细步骤
贡献
这是一个开放的教育项目,欢迎贡献:
- 改进代码示例
- 修正拼写或错误
- 添加注释说明
- 建议新增课程主题
- 翻译成更多语言
详见GitHub Issues了解当前需求。
项目特定上下文
多语言支持
本仓库使用自动翻译系统:
- 支持50+种语言
- 翻译存放于
/translations/<lang-code>/目录 - GitHub Actions工作流负责翻译更新
- 源文件为仓库根目录的英文内容
课程结构
每节课遵循统一模式:
- 视频缩略图与链接
- 书面课程内容(README.md)
- 多框架代码示例
- 学习目标和先决条件
- 额外学习资源链接
代码示例命名
格式:<lesson-number>-python-agent-framework.ipynb
01-python-agent-framework.ipynb- 第1课,MAF Python14-sequential.ipynb- 第14课,MAF高级模式16-python-agent-framework.ipynb- 第16课,生产客户支持代理17-local-agent-foundry-local.ipynb- 第17课,本地代理(Foundry Local + Qwen)
特殊目录
translated_images/- 本地化翻译对应图片images/- 英文原始图片.devcontainer/- VS Code开发容器配置.github/- GitHub Actions工作流及模板
依赖
requirements.txt 中的关键包:
agent-framework- 微软代理框架a2a-sdk- 代理间协议支持azure-ai-inference,azure-ai-projects- Azure AI服务azure-identity- Azure认证(AzureCliCredential)azure-search-documents- Azure AI Search集成mcp[cli]- 模型上下文协议支持
<!-- CO-OP TRANSLATOR DISCLAIMER START -->免责声明: 本文件由 AI 翻译服务 Co-op Translator 翻译完成。尽管我们力求准确,但请注意,自动翻译可能包含错误或不准确之处。原始语言版文件应视为权威来源。对于重要信息,建议使用专业人工翻译。我们对因使用本翻译而产生的任何误解或误释不承担责任。
<!-- CO-OP TRANSLATOR DISCLAIMER END -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

