Foundations 5 min read Updated Sep 8, 2026

What Is LangChain? (And How It Relates To LangGraph)

If you've read anything about building with LLMs recently, you've almost certainly seen both "LangChain" and "LangGraph" mentioned - often in the same sentence, sometimes used almost interchangeably. They're not the same thing, and mixing them up is the single most common point of confusion for people getting started. This guide sorts that out first, then gets into what LangChain itself actually does.

The short version

LangChain is a developer framework for connecting a language model to the things it needs: prompts, other models, your own data, and tools. It standardizes a lot of the plumbing that's genuinely tedious to write yourself - calling different model providers through one consistent interface, formatting prompts, parsing structured output, and wiring up retrieval over your documents.

What LangChain isn't, on its own, is a great answer for complex control flow - loops, conditional branching, multi-step agents that need to pause and remember where they were. That's LangGraph's job, and as of LangChain's own 1.0 release, LangChain's newer agent-building tools are built directly on top of LangGraph's execution engine rather than around it. They're not competitors; LangChain is the ingredient layer, and LangGraph is the layer that decides what happens next.

Model LangChain Prompt LangChain Tool LangChain Graph LangGraph orchestrates

LangChain builds the pieces. LangGraph decides the order, the loops, and the branches they run in.

LCEL: the pipe operator that composes pieces into chains

LangChain's own composition tool is called LCEL - the LangChain Expression Language - and its whole trick is the pipe operator, |. You take a few pieces (a prompt template, a model, a parser) and pipe them together in order:

chain = prompt | model | parser
result = chain.invoke({"topic": "otters"})

Each piece is a "Runnable" - a consistent interface that means anything can be piped into anything else that expects its output type. This still works well and is not deprecated; LangChain's current guidance is simply that LCEL is for straightforward, linear compositions. The moment your logic needs to loop, branch on a real condition, or coordinate multiple steps that don't run in a fixed order, that's the signal to reach for LangGraph instead of trying to force it into a pipe chain.

What actually lives inside LangChain

Four things cover most of what you'll touch:

A practical, current detail worth knowing

For a long time, most third-party integrations - document loaders, vector stores, specific model providers - lived in one large package called langchain-community. That package was archived in mid-2026 and is no longer maintained. Integrations have moved into focused, standalone partner packages instead - things like langchain-openai, langchain-chroma, or langchain-pinecone - each maintained on its own release cycle. If you're following an older tutorial that imports from langchain_community, check the current integrations page for that provider's dedicated package before you build on it.

Rule of thumb: reach for plain LangChain (LCEL) when your logic is genuinely linear - one prompt, one model call, maybe a retrieval step, done. Reach for LangGraph the moment you need a loop, a branch, or more than one agent working together.
Coming from the LangGraph guides? This is the same distinction covered from the other side in What Is LangGraph? - worth reading both if you're deciding which one to reach for first.
Share this guide

Was this guide helpful?

Thanks for the feedback!

Want more hands-on AI builds like this?

APA Mastery runs live, practical sessions on working with modern AI tools - not just theory.

See What's On →