A course teaching everything you need to know to start building AI Agents with LangChain
Welcome to LangChain for Beginners! This course will cover the fundamentals of building with LangChain and Python. It contains 10 chapters that each focus on a specific concept. To get started right away you can navigate to the course-setup chapter, but you're encouraged to read the overview below first.
This course takes you from zero to building robust AI applications:
By the end, you'll have a solid understanding of LangChain and understand how to build real AI applications you can deploy!
Teaching Approach: We use an agent-first progression. You'll learn about tools, then agents, then combine them with document retrieval to build agentic RAG systems. This mirrors how modern production AI systems are built.
Don't forget to star (π) and fork this repo to run the code.
This course contains 10 chapters (setup + 9 chapters), each building on the previous to teach you LangChain from the ground up. Each chapter includes conceptual explanations, working code examples, and hands-on challenges.
| # | Chapter | Description | Key Concepts |
|---|---|---|---|
| 0 | Course Setup | Set up your development environment (local or cloud-based) | Python, Azure AI Foundry, Codespaces, environment variables |
| 1 | Introduction to LangChain | Understanding the framework and core concepts | LangChain fundamentals, first LLM call |
| 2 | Chat Models & Basic Interactions | Chat models, messages, and conversations | Message types, streaming, error handling, temperature |
| 3 | Prompts, Messages, and Structured Outputs | Working with prompts, message arrays, and type-safe outputs | Messages, templates, structured outputs, Pydantic schemas |
| 4 | Function Calling & Tools | Extending AI capabilities with function calling and tools | Pydantic schemas, tool binding, type safety |
| 5 | Getting Started with Agents | Building autonomous agents that reason and choose tools | ReAct pattern, agent loops, create_agent(), middleware |
| 6 | Model Context Protocol (MCP) | Connect AI to external services using the MCP standard | MCP servers, stdio transports, tool integration, multi-server patterns |
| 7 | Documents, Embeddings & Semantic Search | Loading documents, creating embeddings, and building semantic search | Document loading, chunking, vector embeddings, similarity search |
| 8 | Building Agentic RAG Systems | Building RAG systems where agents intelligently decide when to search documents | Agentic RAG (agents decide when to search), retrieval tools, intelligent Q&A |
| 9 | Deploy LangChain Agents to Microsoft Foundry | Deploy your LangChain agent as a Microsoft Foundry hosted agent | Hosted agents, Responses protocol, VS Code deployment, Azure Developer CLI |
Each chapter includes:
We're planning to expand this course over time with additional topics. Stay tuned for updates!
Before starting this course, you should be comfortable with:
If you get stuck or have any questions about building AI Agents, join our dedicated LangChain Discord Channel in the Microsoft Foundry Community Discord.
Do you have suggestions or found spelling or code errors? Raise an issue or Create a pull request.
If you get stuck or have any questions about building AI apps, join:
If you have product feedback or errors while building visit:
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos is subject to those third-parties' policies.
Python
99.5%
A course teaching everything you need to know to start building AI Agents with LangChain
Welcome to LangChain for Beginners! This course will cover the fundamentals of building with LangChain and Python. It contains 10 chapters that each focus on a specific concept. To get started right away you can navigate to the course-setup chapter, but you're encouraged to read the overview below first.
This course takes you from zero to building robust AI applications:
By the end, you'll have a solid understanding of LangChain and understand how to build real AI applications you can deploy!
Teaching Approach: We use an agent-first progression. You'll learn about tools, then agents, then combine them with document retrieval to build agentic RAG systems. This mirrors how modern production AI systems are built.
Don't forget to star (π) and fork this repo to run the code.
This course contains 10 chapters (setup + 9 chapters), each building on the previous to teach you LangChain from the ground up. Each chapter includes conceptual explanations, working code examples, and hands-on challenges.
| # | Chapter | Description | Key Concepts |
|---|---|---|---|
| 0 | Course Setup | Set up your development environment (local or cloud-based) | Python, Azure AI Foundry, Codespaces, environment variables |
| 1 | Introduction to LangChain | Understanding the framework and core concepts | LangChain fundamentals, first LLM call |
| 2 | Chat Models & Basic Interactions | Chat models, messages, and conversations | Message types, streaming, error handling, temperature |
| 3 | Prompts, Messages, and Structured Outputs | Working with prompts, message arrays, and type-safe outputs | Messages, templates, structured outputs, Pydantic schemas |
| 4 | Function Calling & Tools | Extending AI capabilities with function calling and tools | Pydantic schemas, tool binding, type safety |
| 5 | Getting Started with Agents | Building autonomous agents that reason and choose tools | ReAct pattern, agent loops, create_agent(), middleware |
| 6 | Model Context Protocol (MCP) | Connect AI to external services using the MCP standard | MCP servers, stdio transports, tool integration, multi-server patterns |
| 7 | Documents, Embeddings & Semantic Search | Loading documents, creating embeddings, and building semantic search | Document loading, chunking, vector embeddings, similarity search |
| 8 | Building Agentic RAG Systems | Building RAG systems where agents intelligently decide when to search documents | Agentic RAG (agents decide when to search), retrieval tools, intelligent Q&A |
| 9 | Deploy LangChain Agents to Microsoft Foundry | Deploy your LangChain agent as a Microsoft Foundry hosted agent | Hosted agents, Responses protocol, VS Code deployment, Azure Developer CLI |
Each chapter includes:
We're planning to expand this course over time with additional topics. Stay tuned for updates!
Before starting this course, you should be comfortable with:
If you get stuck or have any questions about building AI Agents, join our dedicated LangChain Discord Channel in the Microsoft Foundry Community Discord.
Do you have suggestions or found spelling or code errors? Raise an issue or Create a pull request.
If you get stuck or have any questions about building AI apps, join:
If you have product feedback or errors while building visit:
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos is subject to those third-parties' policies.
Python
99.5%