惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
博客园 - Franky
D
DataBreaches.Net
B
Blog
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
P
Proofpoint News Feed
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Martin Fowler
Martin Fowler
月光博客
月光博客
宝玉的分享
宝玉的分享
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs
博客园 - 【当耐特】

Microsoft for Developers

Your AI coding agent evaluation is only as good as its sandbox - Microsoft for Developers Build an interview coach app with the GitHub Copilot SDK - Microsoft for Developers Your work might not need the smartest model - Microsoft for Developers Start here: Azure SQL Foundations series - Microsoft for Developers Try Azure SRE Agent with no always-on charges - Microsoft for Developers The Microsoft 365 Copilot Agent’s Playbook: A Practical Livestream Series for Building Better Agents - Microsoft for Developers How to test agent experience changes without shipping them - Microsoft for Developers How to test agent skills without hitting real APIs - Microsoft for Developers Building AX evals that actually work - Microsoft for Developers Let’s Learn GitHub Copilot App - Free Virtual Training Event - Microsoft for Developers The hidden variables in your agent eval - Microsoft for Developers Don't rewrite your CLI for agents - Microsoft for Developers Not all model upgrades are upgrades - Microsoft for Developers What AI benchmarks are not telling you - Microsoft for Developers Your agent already has a plan - Microsoft for Developers Learn from Microsoft: Transform software development through an agentic platform - Microsoft for Developers When the model has never seen your code - Microsoft for Developers Models don't have preferences, they have context - Microsoft for Developers Stop overloading your skills - Microsoft for Developers When your agent extensions fight each other - Microsoft for Developers Competing against yourself - Microsoft for Developers Your agent just scaffolded a project from 2020 Is your agent extension actually working? Stop skillmaxxing, save your tokens - Microsoft for Developers Spec-Driven Development: A Spec-First Approach to AI-Native Engineering Microsoft Build 2026 recap: vision, launches, and top sessions Improve your agentic developer tools by grounding in Microsoft Learn How AI coding agents actually use your technology The AX stack: what’s fixed, where you can win Agentic-Agile: Why Agent Development Needs Agile (Not Just Prompts)
LangChain.js for Beginners: A Free Course to Build Agenti...
Yohan Lasorsa · 2026-04-24 · via Microsoft for Developers

Want to build AI agents with JavaScript that go beyond basic chat completions? Agents that reason, call tools, and pull from knowledge bases on their own? We put together a free, open source course to help you get there.

LangChain.js for Beginners is 8 chapters and 70+ runnable TypeScript examples. Clone the repo, add your API key to a .env file, and start building.

Why LangChain.js?

If you already know Node.js, npm, TypeScript, and async/await, you don’t need to switch to Python to build AI apps. LangChain.js gives you components for chat models, tools, agents, retrieval, and more so you’re not wiring everything from scratch.

LangChain.js is like having a fully stocked hardware store at your disposal. Instead of fabricating every tool from raw metal, you grab what’s on the shelf and get to work.

The Hardware Store Analogy - LangChain.js gives you pre-built components instead of building everything from scratch

An Agent-First Approach

Most LangChain tutorials start with document loaders and embeddings. This course gets to tools and agents early because that’s closer to how production AI systems actually work. Agents decide what to do, when to use tools, and whether they even need to search your data.

Here’s the path through the course:

Chapters 1-3 cover the foundations: your first LLM call, chat models, streaming, prompt templates, and structured outputs with Zod schemas. Standard stuff, but you need it before things get interesting.

Chapter 4 – Function Calling & Tools. This is where the AI stops chatting and starts doing things. You teach it to call your functions, and it figures out when to use them. How the tool-calling loop works between the LLM and your code

Chapter 5 – Agents. An LLM answers questions. An agent reasons through problems, picks tools, and executes multi-step plans. Chapter 5 walks through the ReAct pattern and how to build agents with LangChain.js.

LLM vs Agent comparison

Chapter 6 – MCP. The Model Context Protocol is becoming the standard for connecting AI to external services. You’ll build MCP servers and wire agents to them using both HTTP and stdio transports.

LLM vs Agent comparison

Chapters 7 & 8 bring in documents, embeddings, and semantic search, then combine everything into Agentic RAG. The agent decides when to search your knowledge base versus just answering from what it already knows. That’s a big step up from the “search everything every time” approach most RAG tutorials teach.

MCP Architecture

LLM vs Agent comparison

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

Why Teach Agents Before RAG?

This comes up a lot. Think about it like a student taking an “open book” exam. Traditional RAG is like the student who flips through the textbook for every question, even “What is 2+2?” Agentic RAG is the smart student who answers simple questions from memory and only opens the book when they actually need to look something up.

By the time you reach Agentic RAG in Chapter 8, you already understand tools, agents, and MCP. Document retrieval becomes one more capability your agent can reach for. And because the agent already knows how to reason about tool selection, it can figure out when retrieval is actually necessary versus when it can answer directly. The result is faster responses, lower costs (fewer unnecessary embedding lookups), and a better experience overall. That beats bolting search onto a chatbot and hoping for the best.

Who This Course Is For

JavaScript/TypeScript developers who know npm install and async/await. No prior AI or machine learning experience needed. Each chapter starts with a real-world analogy to ground the concept before any code shows up. You’ll see comparisons to hardware stores, restaurant staff, USB-C adapters (for MCP), and more. From there, you get working code examples you can run immediately, hands-on challenges to test your understanding, and key takeaways at the end of each section. The goal is to learn by building, not by reading walls of theory.

You can also work through the course locally or use GitHub Codespaces for a cloud-based setup if you’d rather skip the local install entirely.

Works With Your AI Provider

The course is provider-agnostic. Examples run with GitHub Models (free, great for learning), Microsoft Foundry (production-ready), or OpenAI directly. The setup is the same in every case: update four environment variables in your .env file (AI_API_KEY, AI_ENDPOINT, AI_MODEL, AI_EMBEDDING_MODEL) and every example works without touching a single line of code.

Capstone and Bonus Samples

The course includes a capstone project you can check out. It’s an MCP-powered RAG server that exposes document search and document ingestion as MCP tools over HTTP. Multiple agents can connect to it and share a centralized knowledge base. It’s the kind of architecture you’d actually use in cases where you don’t want each agent to maintain its own copy of the data.

Beyond the 70+ course examples and capstone project, the README links to several bonus samples you can explore: a burger-ordering agent with a serverless API and MCP server, a serverless AI chat with RAG running on Azure, and a multi-agent travel planner that orchestrates specialized agents across Azure Container Apps.

Get Started

Visit github.com/microsoft/langchainjs-for-beginners to get started! Clone it, configure your API key, and run the examples. Chapters build on each other but are self-contained enough to jump around if something specific catches your eye.

New to generative AI concepts? Check out the companion course Generative AI with JavaScript first to get the fundamentals down.

Additional Courses

Additional LangChain courses are also available for Python and Java:

Category

Author

Yohan Lasorsa

Open-source enthusiast and software craftsman, the web is my playground. As a full stack engineer and DIY hobbyist, I enjoy pushing bits of JavaScript everywhere I can while sharing my passion with others.

Dan Wahlin