Stepthrough Start free

What is LangChain?

Quick answer

LangChain is an open-source developer framework for building apps on top of large language models. It supplies ready parts, such as chains of prompts, agents that use tools, memory and connectors to vector databases, so developers don't build them from scratch. It is available for Python and JavaScript.

Last updated

Take the free module →Module 14 of the free AI for Customer Support course, about 13 minutes. No account needed.

Updated · By Robert Breen

Why it matters for a small business

LangChain launched in late 2022 and quickly became one of the most used toolkits for AI apps. Its parts have names you meet in no-code tools too: a "chain" runs a prompt through a model in fixed steps, an "agent" lets the model decide which tool to call, and "memory" keeps past messages in a conversation.

You may never write LangChain code, but you may already use it. n8n's docs explain that its AI features are built on LangChain, and the AI nodes ship in a package called @n8n/n8n-nodes-langchain. That is why n8n has nodes named Basic LLM Chain and AI Agent, and why models, memory and tools plug into an agent as separate pieces.

In a real lesson: Answer Staff Questions from Your Own Docs using n8n + Pinecone

In Answer Staff Questions from Your Own Docs, you build the Cedar Ridge Partners handbook chatbot from LangChain-style parts in n8n: an AI Agent, an OpenAI Chat Model, Simple Memory, and a Pinecone Vector Store tool in Retrieve Documents (As Tool for AI Agent) mode, with Embeddings OpenAI attached to it.

The lesson never mentions LangChain by name. You just click the + under Chat Model, Memory and Tool. Each slot is one of LangChain's building blocks, and n8n wires them together for you. In Gmail AI Triage you meet another: the Basic LLM Chain that writes the draft reply.

Practice copy of the n8n chat testing a handbook chatbot: an answer citing the Cedar Ridge employee handbook, page 9, and an I don't know answer to a question about this year's bonus
Practice copy of the n8n chat testing a handbook chatbot: an answer citing the Cedar Ridge employee handbook, page 9, and an I don't know answer to a question about this year's bonus

Try this lesson free or read the step-by-step guide.

Common confusions

LangChain vs n8n

LangChain is a code library for developers. n8n is a visual workflow tool that uses LangChain inside its AI nodes, so you get the parts without writing code.

LangChain vs LangGraph

LangGraph comes from the same company and is aimed at agents with many steps and branches. LangChain is the broader toolkit of parts.

Tips

  • When n8n's docs or forum mention LangChain, read it as "the AI nodes": the advice usually applies to you.
  • Learn the four parts, model, memory, tools and chain, and most AI builders will look familiar.
  • Only reach for LangChain code when a no-code AI node truly can't do the job.

More AI agents terms

Where you use it: free lessons

Frequently asked questions

Is LangChain free?
The LangChain framework is open source and free to use. The language models it calls, and the company's hosted extras, are separate.
Do I need to know LangChain to use n8n's AI Agent?
No. n8n turns LangChain's parts into nodes you add with clicks. Knowing the names just makes the docs easier to read.
What is a chain in LangChain?
A set of steps that runs in a fixed order, such as fill in a prompt, send it to a model, then format the answer.

All AI glossary terms, A to Z · Free prompt templates