LangChainLangChain 1.4 · Python 3.10+
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
46 small wins to finish your pathNext lesson →

LangChain logoLangChain overview

LangChain is an open-source framework that gives every chat model one interface, wraps the tools a model can call, and runs the agent loop that ties them together.

Last updated: 27 Sep, 2026 · LangChain 1.4

Harrison Chase started LangChain in October 2022. It is released under the MIT licence and maintained by the company of the same name; the version below is 1.4.2. An agent, in its terms, is a model plus a harness: the prompt, the tools, and the middleware that shapes what happens around each model call.

Models, tools, agents and middleware

LangChain gives every chat model provider one interface, so the same code runs against Groq, Gemini or OpenAI after a one-word change. Tools are Python functions a model can ask to run. create_agent puts the two together in a loop: the model asks for a tool, the tool runs, the model reads the result, until it answers. Middleware adds behaviour around that loop, such as retries, limits, human approval and guardrails.

LangChain agents run on LangGraph, the lower-level framework from the same company, which gives them memory and the ability to pause for a human. Everything below stays at the create_agent level and never builds a graph by hand; the LangGraph course covers that layer.

One question through create_agent
The agent looptool callresultYour questiona list of messagesThe chat model decidesanswer, or ask for a toolA tool runsits result goes backThe answertext with no tool calls
Hover or tap a piece to see what it is and which lesson built it.
Follow a question

Pick one to watch it run, step by step.

The support desk starts as a conversation stored in a Python list. By the end it looks up orders, remembers the customer, stops before a refund until a person approves it, hides card numbers and cannot loop forever. A second project answers from the shop's policy documents, says so when they do not cover the question, and comes with tests.

What you build: the shop's support desk
The rules around the modelA customer askswho they are, from your codepasswords answered, no model callcard numbers maskeda cap on model callsrefunds wait for a personA model you wroteswapped for a hosted oneOrder questionslookup and refundPolicy questionssearched, or refusedEach thread keptone per customerThe answerand five tests
Hover or tap a piece to see what it is and which lesson built it.

Everything in both projects is something you build on its own first, in the lesson the drawing names. The course map below shows the order they arrive in.

Everything in this course, and where it is going
Your first agentTools in depthMemoryMiddlewareSafetyKnowledge and MCPAgents, tests, projectsoverviewinstallmessagesyour own chat modelinvoke, batch, streamtoolsbind_toolscreate_agentwatching it workruntime contextstructured outputwrong shapesparallel callscheckpointerstorecustom statehooksorderwrap_model_calltool errorscall limitsretry, fallbacksummarieshuman approvaledit, respondguardrailsdocumentsembeddingsretrieval toolMCP toolssubagentsroutertestsa real modelsupport deskhelp centre
Hover or tap a piece to see what it is and which lesson built it.

A chat model you write yourself

Early on you write a small chat model of your own, and the framework treats it exactly as it treats a hosted one: agents, middleware, memory and structured output all work against it. A later lesson swaps in a hosted model with one line.

Where you use LangChain

  • Support and assistant bots that call your own functions to look things up and act.
  • Answering from your own documents, with the model saying so when they do not cover the question.
  • Any app that must swap one model provider for another without rewriting the code around it.

Prerequisites

  • Python 3.10 or later.
  • Comfort with functions, classes and dictionaries.
Back toAll frameworks

Every expert started right here.