LangChain.js for Beginners
by Microsoft
A free Microsoft course that takes JavaScript and TypeScript developers from a first LLM call to agentic RAG and MCP servers with LangChain.js.
Overview
LangChain.js for Beginners is an open-source course published by Microsoft on GitHub (microsoft/langchainjs-for-beginners) and announced on the Microsoft for Developers blog on April 23, 2026 by Principal Cloud Advocate Yohan Lasorsa and Dan Wahlin. It is written for developers who already know Node.js, npm, TypeScript and async/await but have never built with an LLM. Chapter 0 sets up a local or GitHub Codespaces environment. Chapter 1 introduces LangChain.js and makes a first LLM call. Chapter 2 covers chat models, messages, conversations, streaming, error handling and temperature. Chapter 3 teaches prompt templates, message arrays and type-safe structured outputs with Zod schemas. Chapter 4 adds function calling and tool binding. Chapter 5 builds agents with the ReAct pattern, agent loops and middleware. Chapter 6 covers the Model Context Protocol, connecting agents to MCP servers over HTTP and stdio transports. Chapter 7 handles document loading, chunking, embeddings and similarity search, and chapter 8 combines them into agentic RAG, where the agent decides when to search a knowledge base. Each chapter has explanations, code, hands-on challenges and key takeaways. The blog post describes a capstone that exposes document search and ingestion as MCP tools over HTTP. Models come from GitHub Models (free), Microsoft Foundry or OpenAI, configured through four environment variables.
At a Glance
- Topic
- Frameworks
- Level
- Beginner
- Format
- Course
- Cost
- Free
- Duration
- 8 chapters plus a setup chapter, 70+ runnable examples, self-paced (no official hour estimate)
- Provider
- Microsoft
- Hands-on
- Yes — code/exercises
- Certificate
- None
What You’ll Learn
- ✓Set up a LangChain.js and TypeScript project locally or in GitHub Codespaces
- ✓Work with chat models, conversation history, streaming responses and temperature settings
- ✓Write prompt templates and return type-safe structured outputs validated with Zod schemas
- ✓Bind tools to a model so it decides when to call your own functions
- ✓Build ReAct-style agents with agent loops and middleware in LangChain.js
- ✓Connect agents to MCP servers over both HTTP and stdio transports
- ✓Load and chunk documents, create embeddings and run semantic similarity search
- ✓Build an agentic RAG system where the agent chooses when to query a knowledge base
Highlights
- •One of the few structured LangChain courses aimed at JavaScript and TypeScript developers; most agent curricula assume Python
- •Runs on free GitHub Models, so you can finish it without paying for an API key, with Microsoft Foundry or OpenAI as alternatives
- •Covers MCP with both HTTP and stdio transports alongside tools and agents, not as a separate add-on
- •MIT-licensed repo with 70+ runnable examples and per-chapter challenges; about 246 stars when checked in November 2026
Who It’s For
Best For
- ✓JavaScript and TypeScript web developers adding LLM features to Node.js apps
- ✓Front-end or full-stack engineers who want agents and RAG without switching to Python
- ✓Developers evaluating LangChain.js before adopting it in a production TypeScript codebase
Prerequisites
- •JavaScript or TypeScript fundamentals, including async/await
- •Node.js (LTS), npm, Git and a code editor such as VS Code
- •No AI or ML background needed; Microsoft suggests its Generative AI with JavaScript course first if the concepts are new to you
FAQ
What is LangChain.js for Beginners?
LangChain.js for Beginners is a free, MIT-licensed course from Microsoft for JavaScript and TypeScript developers with no prior AI or machine learning experience. Across eight chapters and more than 70 runnable examples you build chat apps, structured outputs, tool-calling agents, MCP integrations and an agentic RAG system using LangChain.js in Node.js.
Is LangChain.js for Beginners free?
LangChain.js for Beginners is free to access.
What level is LangChain.js for Beginners for?
LangChain.js for Beginners is aimed at a beginner audience. Recommended background: JavaScript or TypeScript fundamentals, including async/await, Node.js (LTS), npm, Git and a code editor such as VS Code, No AI or ML background needed; Microsoft suggests its Generative AI with JavaScript course first if the concepts are new to you.
How long does LangChain.js for Beginners take?
Expect roughly 8 chapters plus a setup chapter, 70+ runnable examples, self-paced (no official hour estimate). Most learners work through it at their own pace.
What will I learn from LangChain.js for Beginners?
You'll learn: Set up a LangChain.js and TypeScript project locally or in GitHub Codespaces; Work with chat models, conversation history, streaming responses and temperature settings; Write prompt templates and return type-safe structured outputs validated with Zod schemas; Bind tools to a model so it decides when to call your own functions; Build ReAct-style agents with agent loops and middleware in LangChain.js; Connect agents to MCP servers over both HTTP and stdio transports; Load and chunk documents, create embeddings and run semantic similarity search; Build an agentic RAG system where the agent chooses when to query a knowledge base.
Topics
Sources
This page was written from 2 sources, 1 on domains other than github.com.