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

推荐订阅源

博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
B
Blog
博客园_首页
量子位
博客园 - 叶小钗
L
LangChain Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
雷峰网
雷峰网
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
I
Intezer
H
Help Net Security
The Hacker News
The Hacker News
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
AWS News Blog
AWS News Blog
V
V2EX
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Spread Privacy
Spread Privacy
A
Arctic Wolf
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Last Watchdog
The Last Watchdog
Latest news
Latest news
T
Troy Hunt's Blog
L
LINUX DO - 热门话题

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) Azure Cosmos DB Conf 2026 Recap: Lessons from Production Securing MCP: A Control Plane for Agent Tool Execution - Microsoft for Developers Take your PostgreSQL-backed apps to the next level Awesome GitHub Copilot just got a website, and a learning hub, and plugins! Build a real-world example with Microsoft Agent Framework, Microsoft Foundry, MCP and Aspire
LangChain.js for Beginners: A Free Course to Build Agentic AI Apps with JavaScript - Microsoft for Developers
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