
Calling a large language model is one API request. Building a product on one is not. A real assistant has to find the right documents, fit them into a prompt, call tools, remember the conversation, return structured output and recover when the model gets something wrong. LangChain is an open-source framework that gives developers building blocks for that work, so they spend less time writing glue code around the model.
This article explains what LangChain is, how its pieces fit together, where it helps, where it gets in the way, and how it compares with the alternatives.
What is LangChain?
LangChain is an open-source framework for building applications powered by large language models (LLMs). It provides a common interface to many model providers, plus components for prompts, retrieval, tools, agents and memory, and it is available for Python and for JavaScript/TypeScript.
Harrison Chase released the first version of the Python package on 24 October 2022, a few weeks before ChatGPT made LLMs a mainstream topic. It began as a small library for prompt templates and chaining model calls and grew quickly with the wave of LLM applications that followed. Chase founded the company LangChain with Ankush Gola in early 2023, and the project now sits next to two related products: LangGraph, a framework for stateful agents, and LangSmith, a platform for tracing and evaluating LLM applications.
LangChain and LangGraph reached their first stable major versions, 1.0, in October 2025, with a commitment to no breaking changes until 2.0. That addressed one of the most common complaints about the early project: APIs that changed from month to month.
How LangChain works
The core idea is that an LLM application is a pipeline of steps, and each step can be a standard component.
Models behind one interface. Chat models and embedding models from OpenAI, Anthropic, Google, Mistral, open models served locally with tools such as Ollama or vLLM, and many others share the same interface. Switching providers, or using different models for different steps, does not mean rewriting the application.
Prompts and structured output. Prompt templates keep instructions separate from data. Structured output turns the model's answer into a typed object, such as JSON that matches a schema, instead of free text you have to parse.
Retrieval for RAG. Retrieval-augmented generation (RAG) answers questions from your own data. LangChain covers each stage: document loaders read PDFs, web pages and databases; text splitters cut them into chunks; embedding models turn chunks into vectors; a vector store indexes them; a retriever finds the relevant chunks for a question; and the model writes an answer grounded in them.
Tools and agents. A tool is a function the model can decide to call: search a database, query an API, run a calculation. An agent is a loop in which the model reasons, calls tools, reads the results and continues until it can answer. In LangChain 1.0, agents run on the LangGraph runtime, which adds persistence, streaming and points where a human can approve a step.
Key features
- Hundreds of integrations with model providers, vector databases, document sources and tools.
- Standard RAG building blocks: loaders, splitters, embeddings, vector stores and retrievers.
- Agents with tool calling, built on LangGraph for long-running and stateful workflows.
- Middleware for cross-cutting concerns such as summarising long conversations, redacting personal data or adding a human approval step.
- Streaming of tokens and intermediate steps, for responsive interfaces.
- Observability through LangSmith, which records each step of a run so teams can debug and evaluate quality.
Where LangChain is used
- Enterprise assistants and internal copilots that answer from company documents, policies and wikis.
- Customer support bots that search a knowledge base and hand over to a person when unsure.
- Document analysis: contracts, reports and forms summarised, compared or turned into structured data.
- Agents that act, booking, updating records or running multi-step research across several systems.
- LLM features inside SaaS products, such as natural-language search or automatic drafting.
When to choose LangChain, and when not to
Choose LangChain when:
- The application combines several capabilities: retrieval, tools, memory and multi-step logic.
- You want to stay independent of a single model provider.
- You need many integrations and would rather not write each connector yourself.
- The workflow will grow into an agent that needs state, retries and human checkpoints.
Look elsewhere when:
- The feature is a single model call, such as summarising a text or classifying a ticket. The provider's own SDK is simpler and easier to debug.
- Retrieval quality over a large document corpus is the whole product. LlamaIndex offers deeper indexing and query strategies.
- The team wants a visual, low-code workflow tool. n8n or a similar platform may fit better.
- You need full control of every prompt and request. Abstractions hide details, and some teams prefer thin code they wrote themselves.
The main criticism of LangChain has been abstraction overhead: several layers between your code and the model can make errors harder to trace. The stable 1.0 line and LangSmith tracing reduce that problem, but it is still worth starting with the simplest design that works.
LangChain and its alternatives
| Option | Focus | Best fit |
|---|---|---|
| LangChain + LangGraph | General LLM applications and agents | Multi-step apps combining RAG, tools and state |
| LlamaIndex | Data connection and retrieval | RAG over large or complex document sets |
| Haystack | Search and RAG pipelines | Production search and question answering |
| Semantic Kernel | LLM orchestration for .NET, Python, Java | Microsoft-centred teams |
| Provider SDKs (OpenAI, Anthropic) | Direct model access | Single-model features with minimal layers |
| n8n | Visual workflow automation | Business automation with AI steps, low code |
LangChain and LlamaIndex are often presented as rivals, but many production systems use both: LangChain to orchestrate the workflow and LlamaIndex as the retrieval layer underneath. We compare them in detail in LangChain vs LlamaIndex: an enterprise RAG framework decision guide.
How we use LangChain at Internative
We use LangChain to design and orchestrate complex AI workflows, including RAG systems, AI agents and enterprise assistants. Its modular structure lets us prototype an LLM-based product quickly and then scale it with a clean system design, without tying it to one model provider.
If you are planning an assistant, a RAG system or an agent on your own data, our AI integration and automation team can help you decide how far a framework like LangChain should go in your architecture.
Frequently asked questions
Is LangChain free?
Yes. The LangChain and LangGraph libraries are open source under the MIT licence and free to use in commercial products. Costs come from the model APIs or the infrastructure you run models on. LangSmith, the separate tracing and evaluation platform, is a commercial product.
Is LangChain a RAG framework?
RAG is one of its main use cases, but not its only one. LangChain covers the whole RAG pipeline, from loading documents to retrieval and generation, and also handles tools, agents, memory and structured output. A framework focused only on retrieval is LlamaIndex.
What is LangGraph and how is it different from LangChain?
LangGraph is a lower-level framework from the same team for building stateful agents as graphs of steps, with persistence, branching, retries and human approval points. LangChain sits on top: since version 1.0 its agents run on the LangGraph runtime. Start with LangChain's agent tools and move down to LangGraph when you need custom control flow.
Is LangChain still relevant?
Yes. With the 1.0 release it moved to a stable API, it remains one of the most widely used LLM frameworks, and its integrations cover most model providers and vector databases. For simple single-call features, though, many teams use the provider SDK directly.
Which programming languages does LangChain support?
LangChain is available for Python and for JavaScript/TypeScript. The Python version is the original and has the most integrations; the JavaScript version is common in Node.js backends and web applications.
Keep reading
The articles that follow this one.



