LangChain: useful glue, once you know what it hides.
LangChain is an open-source framework for building applications on language models: it gives you standard interfaces for models, prompts, retrievers, tools and memory, and lets you compose them. LangGraph builds stateful, multi-step agents as graphs; LangSmith traces and evaluates runs. They speed up a first version and hide details you will need when debugging, so learn the plain libraries first.
- LangChain
- Composable building blocks for LLM apps
- LangGraph
- Stateful agents as graphs with loops
- LangSmith
- Tracing, datasets, evaluation (hosted)
- My advice
- Plain Python first, framework when it earns it
- 5production AI apps
- 14engineers led
- 200+students mentored
Questions students ask
The LangChain questions searched most, answered from building LLM apps with and without it.
What is LangChain?
LangChain is a Python (and JavaScript) framework for building applications around language models. It provides a common interface to many model providers, prompt templates, document loaders for dozens of file types, text splitters, embedding and vector store integrations, retrievers, tools and agent runtimes, and a way to chain these into pipelines. Its value is breadth: you can swap a model or a vector store by changing one line because both sit behind the same interface. Its cost is indirection: when something goes wrong, the stack trace runs through several layers of abstraction between you and the API call.
What are LangChain components?
- Models: chat and completion wrappers for OpenAI, Anthropic, Google, local models via Ollama, and more.
- Prompts: templates with variables, few-shot formatting and message roles.
- Document loaders and text splitters: read PDFs, HTML, Notion, databases; chunk by characters, tokens or structure.
- Embeddings and vector stores: one interface over FAISS, pgvector, Qdrant, Chroma, Pinecone and others.
- Retrievers: wrap any store, plus hybrid, multi-query and parent-document variants.
- Tools and agents: function definitions a model can call, and runtimes that loop over them.
- Output parsers: turn model text into typed objects, JSON or structured records.
- LCEL (the expression language): the pipe syntax that composes any of these into a runnable chain with streaming and batching.
How LangChain works
Everything in LangChain is a Runnable with the same methods: invoke, stream, batch and their async forms. You compose runnables with the pipe operator, prompt | model | parser, and the result is itself a runnable. A RAG chain is a retriever feeding a prompt feeding a model feeding a parser. Under the hood each step calls the underlying library or API, passes its output forward, and emits callbacks that tracing tools such as LangSmith capture. That uniform interface is what makes swapping components easy and what makes stack traces long: your four-line chain becomes dozens of frames at run time.
What is LangChain and LangGraph?
LangChain composes steps in a line; LangGraph composes them in a graph. In LangGraph you define a state object, nodes that are functions or model calls that read and update that state, and edges, including conditional edges and cycles, that decide what runs next. That is what agents need: loop until the task is done, branch on a tool result, pause for human approval, resume later. LangGraph also gives you checkpointing, so a long-running agent can persist state between steps. Use LangChain for straightforward pipelines and LangGraph when control flow depends on model decisions.
What is LangChain LangGraph and LangSmith?
Three products from the same company. LangChain is the open-source library of components and chains. LangGraph is the open-source library for stateful agent graphs, with a hosted platform for deploying them. LangSmith is the hosted observability and evaluation service: it records every step of every run with inputs, outputs, latency and cost, lets you build datasets from real traffic, and runs evaluations against them. You can use LangSmith without LangChain by instrumenting your own code, and you can use LangChain without LangSmith by sending callbacks to another tracer or to logs.
What are LangChain agents?
A LangChain agent is a loop in which a model chooses which tool to call next, the framework runs the tool, feeds the result back, and repeats until the model produces a final answer. Tools are Python functions with a name, a description and typed arguments that the model sees as a schema. Older agent types used text parsing of the model's output; current ones use native tool calling, which is far more reliable. LangGraph is now the recommended way to build agents, with a prebuilt ReAct-style agent as the starting point and full control when you need branches, limits and human checkpoints.
What are LangChain tools?
Tools are the functions an agent can call. In LangChain you declare one with a decorator on a Python function; the function's name, docstring and type hints become the schema shown to the model. Built-in integrations cover web search, code execution, SQL databases, HTTP requests, file systems and many SaaS APIs. Writing your own is a few lines. The quality of the description decides how well the model uses the tool, so write it like documentation for a careful colleague: what it does, when to use it, and what the arguments mean. Keep the tool set small; agents with thirty tools choose badly.
How to install LangChain
In a virtual environment, install the core package with pip, then the provider package for the model you use (for example the OpenAI, Anthropic or Ollama integration) and any vector store integration you need. The project is split into small packages so you install only what you use; the community package holds the long tail of integrations. Pin versions in your requirements file, because the API has changed between releases and tutorials from a year ago often no longer run. Set your provider's API key as an environment variable and test with a two-line prompt-to-model call before building anything larger.
How to get LangChain API key
LangChain itself has no API key; it is an open-source library. What people usually mean is one of two things. A model provider key, from OpenAI, Anthropic, Google or whichever model you call, set as an environment variable the integration reads. Or a LangSmith key, which you create in the LangSmith web app under settings and set as an environment variable along with a flag that turns tracing on; with those set, every chain run is recorded automatically. Keep keys out of code and out of git; a leaked provider key is billed to you.
How does LangChain enhance RAG applications?
It shortens the path to a working prototype: loaders for your file types, splitters, an embedding model, a vector store and a retrieval chain can be assembled in an afternoon, and advanced retrievers such as multi-query, parent-document and ensemble (hybrid) retrieval come ready-made. For production, the gains are smaller and the costs appear: default chunking and prompts are generic, the retrieval pipeline is harder to inspect, and performance tuning means reading framework source. My practice is to prototype with it, then rebuild the retrieval stages in plain code with a test set, keeping LangChain only where its integrations save real effort.
When to use what
A quick map.
Plain Python
Learning, small apps, anything you must debug and tune: provider SDK, pgvector, rank_bm25, a cross-encoder.
LangChain
Fast prototypes, many file types, swapping providers, teams already standardised on it.
LangGraph + LangSmith
Agents with loops, branches and checkpoints; tracing and evaluation on real traffic.
In the room
Where these systems get explained to students.


Read next
The alternatives and the fundamentals.
A prototype that needs to become a product?
I turn framework demos into measured, maintainable pipelines.

