agentleFS
MicrosoftKnown publishermicrosoft/ai-agents-for-beginners/AGENTS.md

ai-agents-for-beginners

AGENTS.md76k starsChanged 5 months agoMITView on GitHub

This repository contains "AI Agents for Beginners" - a comprehensive educational course teaching everything needed to build AI Agents. The course consists of 18 lessons (numbered 00-18) covering fundamentals, design patterns, frameworks, production deployment, local/on-device agents, and security of AI agents. Key Technologies: - Python 3.12+ - Jupyter Notebooks for interactive learning - AI Frameworks: Microsoft Agent Framework (MAF) - Azure AI Services: Microsoft Foundry, Microsoft Foundry Agent Service V2 Architecture: - Lesson-based structure (00-18 directories) - Each lesson contains:…

  • Reads credentials
  • Installs packages

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projectsWeek of Nov 15: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about microsoft/ai-agents-for-beginners

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

45 more on GitHub

On Bluesky · 35

30 more on Bluesky

On Hacker News · 3

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

25 rules. About 0 are common, 19 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈19

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Code Style: Follow standard Python PEP 8 conventions

    line 130
  2. Distinctive:

    Notebooks: Use clear markdown cells to explain concepts

    line 131
  3. Distinctive:

    Add output examples in notebooks for reference

    line 137
  4. Distinctive:

    Use clear variable names that match lesson concepts

    line 138
  5. Distinctive:

    Keep notebook execution order linear (cell 1 → 2 → 3...)

    line 139
  6. Distinctive:

    Run notebooks locally or in GitHub Codespaces

    line 174
  7. Distinctive:

    Run affected notebooks completely

    line 182
  8. Distinctive:

    Verify all cells execute without errors

    line 183
  9. Distinctive:

    Check that outputs are appropriate

    line 184
  10. Distinctive:

    Update README.md if adding new concepts

    line 187
  11. Distinctive:

    Add comments in notebooks for complex code

    line 188
  12. Distinctive:

    Ensure markdown cells explain the purpose

    line 189
  13. Very specific:

    Avoid committing .env files (use .env.example)

    line 192
  14. Very specific:

    Don't commit venv/ or __pycache__/ directories

    line 193
  15. Distinctive:

    Keep notebook outputs when they demonstrate concepts

    line 194
  16. Very specific:

    Remove temporary files and backup notebooks (*-backup.ipynb)

    line 195
  17. Distinctive:

    Follow existing code patterns in the repository

    line 209
  18. Distinctive:

    Ensure Python 3.12+ is used

    line 217
  19. Very specific:

    Use python3 -m venv to specify Python version explicitly

    line 219
  20. Very specific:

    Always create .env from .env.example

    line 222
  21. Very specific:

    Don't commit .env file (it's in .gitignore)

    line 223
  22. Distinctive:

    Use a fresh virtual environment

    line 227
  23. Distinctive:

    Ensure your Azure OpenAI model deployment supports the Responses API

    line 234
  24. Distinctive:

    00-course-setup: - Start here for environment setup

    line 239
  25. Distinctive:

    Check the main README.md for course overview

    line 255

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Project Overview

This repository contains "AI Agents for Beginners" - a comprehensive educational course teaching everything needed to build AI Agents. The course consists of 18 lessons (numbered 00-18) covering fundamentals, design patterns, frameworks, production deployment, local/on-device agents, and security of AI agents.

Key Technologies:

  • Python 3.12+
  • Jupyter Notebooks for interactive learning
  • AI Frameworks: Microsoft Agent Framework (MAF)
  • Azure AI Services: Microsoft Foundry, Microsoft Foundry Agent Service V2

Architecture:

  • Lesson-based structure (00-18 directories)
  • Each lesson contains: README documentation, code samples (Jupyter notebooks), and images
  • Multi-language support via automated translation system
  • One Python notebook per lesson using Microsoft Agent Framework

Setup Commands

Prerequisites

  • Python 3.12 or higher
  • Azure subscription (for Microsoft Foundry)
  • Azure CLI installed and authenticated (az login)

Initial Setup

  1. Clone or fork the repository:
    gh repo fork microsoft/ai-agents-for-beginners --clone
    # OR
    git clone https://github.com/microsoft/ai-agents-for-beginners.git
    cd ai-agents-for-beginners
  2. Create and activate Python virtual environment:
    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Set up environment variables:
    cp .env.example .env
    # Edit .env with your API keys and endpoints

Required Environment Variables

For Microsoft Foundry (Required):

  • AZURE_AI_PROJECT_ENDPOINT - Microsoft Foundry project endpoint
  • AZURE_AI_MODEL_DEPLOYMENT_NAME - Model deployment name (e.g., gpt-5-mini)

For Azure AI Search (Lesson 05 - RAG):

  • AZURE_SEARCH_SERVICE_ENDPOINT - Azure AI Search endpoint
  • AZURE_SEARCH_API_KEY - Azure AI Search API key

Authentication: Run az login before running notebooks (uses AzureCliCredential).

Development Workflow

Running Jupyter Notebooks

Each lesson contains multiple Jupyter notebooks for different frameworks:

  1. Start Jupyter:
    jupyter notebook
  2. Navigate to a lesson directory (e.g., 01-intro-to-ai-agents/code_samples/)
  3. Open and run notebooks:
    • *-python-agent-framework.ipynb - Using Microsoft Agent Framework (Python)
    • *-dotnet-agent-framework.ipynb - Using Microsoft Agent Framework (.NET)

Working with Microsoft Agent Framework

Microsoft Agent Framework + Microsoft Foundry:

  • Requires Azure subscription
  • Uses FoundryChatClient for Agent Service V2 (agents visible in Foundry portal)
  • Production-ready with built-in observability
  • File pattern: *-python-agent-framework.ipynb

Testing Instructions

This is an educational repository with example code rather than production code with automated tests. To verify your setup and changes:

Manual Testing

  1. Test Python environment:
    python --version  # Should be 3.12+
    pip list | grep -E "(agent-framework|azure-ai|azure-identity)"
  2. Test notebook execution:
    # Convert notebook to script and run (tests imports)
    jupyter nbconvert --to script <lesson-folder>/code_samples/<notebook>.ipynb --stdout | python
  3. Verify environment variables:
    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')"

Running Individual Notebooks

Open notebooks in Jupyter and execute cells sequentially. Each notebook is self-contained and includes:

  • Import statements
  • Configuration loading
  • Example agent implementations
  • Expected outputs in markdown cells

Smoke-Testing Deployed Agents

For lessons where an agent is deployed as a Microsoft Foundry hosted agent (01, 04, 05, 16), the repo ships smoke-test catalogs under tests/ that are run by the .github/workflows/smoke-test.yml workflow via the AI Smoke Test action. These are a lightweight post-deploy gate (is the agent reachable and following basic prompt expectations?), complementing the evaluation pipeline in Lessons 10 and 16. See tests/README.md for the catalog-to-lesson-to-agent mapping. Lesson 17 runs locally with Foundry Local and has no hosted endpoint, so it is validated by running its notebook directly.

Code Style

Python Conventions

  • Python Version: 3.12+
  • Code Style: Follow standard Python PEP 8 conventions
  • Notebooks: Use clear markdown cells to explain concepts
  • Imports: Group by standard library, third-party, local imports

Jupyter Notebook Conventions

  • Include descriptive markdown cells before code cells
  • Add output examples in notebooks for reference
  • Use clear variable names that match lesson concepts
  • Keep notebook execution order linear (cell 1 → 2 → 3...)

File Organization

<lesson-number>-<lesson-name>/
├── README.md                     # Lesson documentation
├── code_samples/
│   ├── <number>-python-agent-framework.ipynb
│   └── <number>-dotnet-agent-framework.ipynb  (optional)
└── images/
    └── *.png

Build and Deployment

Building Documentation

This repository uses Markdown for documentation:

  • README.md files in each lesson folder
  • Main README.md at repository root
  • Automated translation system via GitHub Actions

CI/CD Pipeline

Located in .github/workflows/:

  1. co-op-translator.yml - Automatic translation to 50+ languages
  2. welcome-issue.yml - Welcomes new issue creators
  3. welcome-pr.yml - Welcomes new pull request contributors

Deployment

This is an educational repository - no deployment process. Users:

  1. Fork or clone the repository
  2. Run notebooks locally or in GitHub Codespaces
  3. Learn by modifying and experimenting with examples

Pull Request Guidelines

Before Submitting

  1. Test your changes:
    • Run affected notebooks completely
    • Verify all cells execute without errors
    • Check that outputs are appropriate
  2. Documentation updates:
    • Update README.md if adding new concepts
    • Add comments in notebooks for complex code
    • Ensure markdown cells explain the purpose
  3. File changes:
    • Avoid committing .env files (use .env.example)
    • Don't commit venv/ or __pycache__/ directories
    • Keep notebook outputs when they demonstrate concepts
    • Remove temporary files and backup notebooks (*-backup.ipynb)

PR Title Format

Use descriptive titles:

  • [Lesson-XX] Add new example for <concept>
  • [Fix] Correct typo in lesson-XX README
  • [Update] Improve code sample in lesson-XX
  • [Docs] Update setup instructions

Required Checks

  • Notebooks should execute without errors
  • README files should be clear and accurate
  • Follow existing code patterns in the repository
  • Maintain consistency with other lessons

Additional Notes

Common Gotchas

  1. Python version mismatch:
    • Ensure Python 3.12+ is used
    • Some packages may not work with older versions
    • Use python3 -m venv to specify Python version explicitly
  2. Environment variables:
    • Always create .env from .env.example
    • Don't commit .env file (it's in .gitignore)
    • Sign in with az login for keyless Entra ID authentication
  3. Package conflicts:
    • Use a fresh virtual environment
    • Install from requirements.txt rather than individual packages
    • Some notebooks may require additional packages mentioned in their markdown cells
  4. Azure services:
    • Azure AI services require active subscription
    • Some features are region-specific
    • Ensure your Azure OpenAI model deployment supports the Responses API

Learning Path

Recommended progression through lessons:

  1. 00-course-setup - Start here for environment setup
  2. 01-intro-to-ai-agents - Understand AI agent fundamentals
  3. 02-explore-agentic-frameworks - Learn about different frameworks
  4. 03-agentic-design-patterns - Core design patterns
  5. Continue through numbered lessons sequentially

Framework Selection

Choose framework based on your goals:

  • All lessons: Microsoft Agent Framework (MAF) with FoundryChatClient
  • Agents register server-side in Microsoft Foundry Agent Service V2 and are visible in the Foundry portal

Getting Help

  • Join the Microsoft Foundry Community Discord
  • Review lesson README files for specific guidance
  • Check the main README.md for course overview
  • Refer to Course Setup for detailed setup instructions

Contributing

This is an open educational project. Contributions welcome:

  • Improve code examples
  • Fix typos or errors
  • Add clarifying comments
  • Suggest new lesson topics
  • Translate to additional languages

See GitHub Issues for current needs.

Project-Specific Context

Multi-Language Support

This repository uses an automated translation system:

  • 50+ languages supported
  • Translations in /translations/<lang-code>/ directories
  • GitHub Actions workflow handles translation updates
  • Source files are in English at repository root

Lesson Structure

Each lesson follows a consistent pattern:

  1. Video thumbnail with link
  2. Written lesson content (README.md)
  3. Code samples in multiple frameworks
  4. Learning objectives and prerequisites
  5. Extra learning resources linked

Code Sample Naming

Format: <lesson-number>-python-agent-framework.ipynb

  • 01-python-agent-framework.ipynb - Lesson 1, MAF Python
  • 14-sequential.ipynb - Lesson 14, MAF advanced patterns
  • 16-python-agent-framework.ipynb - Lesson 16, production customer-support agent
  • 17-local-agent-foundry-local.ipynb - Lesson 17, local agent with Foundry Local + Qwen

Special Directories

  • translated_images/ - Localized images for translations
  • images/ - Original images for English content
  • .devcontainer/ - VS Code development container configuration
  • .github/ - GitHub Actions workflows and templates

Dependencies

Key packages from requirements.txt:

  • agent-framework - Microsoft Agent Framework
  • a2a-sdk - Agent-to-Agent protocol support
  • azure-ai-inference, azure-ai-projects - Azure AI services
  • azure-identity - Azure authentication (AzureCliCredential)
  • azure-search-documents - Azure AI Search integration
  • mcp[cli] - Model Context Protocol support

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.