LangChain for Beginners - A Course

December 8, 2025 ยท View on GitHub

LangChain Cover Image

A course teaching everything you need to know to start building AI Agents with LangChain

GitHub license GitHub contributors GitHub issues GitHub pull-requests

GitHub watchers GitHub forks GitHub stars

๐Ÿฆœ๐Ÿ”— Welcome

Welcome to LangChain for Beginners! This course will cover the fundamentals of building with LangChain and Python. It contains 9 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.

What You'll Learn and Build

This course takes you from zero to building robust AI applications:

  • Conversational AI - Build context-aware chatbots with streaming responses and customizable behavior
  • Semantic Search - Create search systems that understand meaning, not just keywords
  • Function Calling & Tools - Give AI the ability to use tools and extract structured data
  • Autonomous Agents - Build agents that reason, make decisions, and choose tools autonomously
  • MCP Integration - Connect AI to external services using the Model Context Protocol standard
  • Agentic RAG - Build intelligent Q&A systems where agents decide when to search your knowledge base

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.


๐Ÿ“š Table of Contents

This course contains 9 chapters (setup + 8 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.

#ChapterDescriptionKey Concepts
0Course SetupSet up your development environment (local or cloud-based)Python, Azure AI Foundry, Codespaces, environment variables
1Introduction to LangChainUnderstanding the framework and core conceptsLangChain fundamentals, first LLM call
2Chat Models & Basic InteractionsChat models, messages, and conversationsMessage types, streaming, error handling, temperature
3Prompts, Messages, and Structured OutputsWorking with prompts, message arrays, and type-safe outputsMessages, templates, structured outputs, Pydantic schemas
4Function Calling & ToolsExtending AI capabilities with function calling and toolsPydantic schemas, tool binding, type safety
5Getting Started with AgentsBuilding autonomous agents that reason and choose toolsReAct pattern, agent loops, create_agent(), middleware
6Model Context Protocol (MCP)Connect AI to external services using the MCP standardMCP servers, stdio transports, tool integration, multi-server patterns
7Documents, Embeddings & Semantic SearchLoading documents, creating embeddings, and building semantic searchDocument loading, chunking, vector embeddings, similarity search
8Building Agentic RAG SystemsBuilding RAG systems where agents intelligently decide when to search documentsAgentic RAG (agents decide when to search), retrieval tools, intelligent Q&A

Each chapter includes:

  • ๐Ÿ“– Conceptual explanations with real-world analogies
  • ๐Ÿ’ป Code examples you can run immediately
  • ๐ŸŽฏ Hands-on challenges to test your understanding
  • ๐Ÿ”‘ Key takeaways to reinforce learning

We're planning to expand this course over time with additional topics. Stay tuned for updates!


๐Ÿ“‹ Prerequisites

Before starting this course, you should be comfortable with:

  • Python fundamentals - Variables, functions, objects, async/await, pip for package installation
  • Basic Generative AI concepts - Basic understanding of LLMs, prompts, tokens which are covered in our GenAI for Beginners course

Required Tools

๐Ÿ‘ซ Meet Other Learners, Get Your Questions Answered

If you get stuck or have any questions about building AI Agents, join our dedicated LangChain Discord Channel in the Microsoft Foundry Community Discord.

๐Ÿ™ Want to help?

Do you have suggestions or found spelling or code errors? Raise an issue or Create a pull request.

๐Ÿ“– Course Resources and Additional Samples


Additional Resources

LangChain

LangChain.js for Beginners LangChain4j for Beginners


Azure / Edge / MCP / Agents

AZD for Beginners Edge AI for Beginners MCP for Beginners AI Agents for Beginners


Generative AI Series

Generative AI for Beginners Generative AI (.NET) Generative AI (Java) Generative AI (JavaScript)


Core Learning

ML for Beginners Data Science for Beginners AI for Beginners Cybersecurity for Beginners Web Dev for Beginners IoT for Beginners XR Development for Beginners


Copilot Series

Copilot for AI Paired Programming Copilot for C#/.NET Copilot Adventure


Getting Help

If you get stuck or have any questions about building AI apps, join:

Microsoft Foundry Discord

If you have product feedback or errors while building visit:

Microsoft Foundry Developer Forum


Contributing

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.

Trademarks

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.