Module 1 — What LangChain adds and what it complicates
Courses 16 and 18 taught you to call a language model and to ground it in your documents. Both can be done in a hundred lines of Python with the raw provider SDK, and many teams stop there. This course is about the moment when that stops being enough — several models to swap between, several retrieval sources to combine, streaming and batching to reconcile, tools to expose, traces to keep — and about the framework that emerged to handle that growth. It is also about knowing when not to reach for the framework.
The running example for the whole course is an expense-reports assistant for a small team. It will grow module by module: it reads receipts, answers questions about the reimbursement policy, remembers the conversation, calls a currency converter, checks a per-diem ceiling and finally drafts a spreadsheet line. Module 1 builds nothing yet — it decides whether LangChain is the right vehicle.
The three things LangChain actually provides
Cut through the marketing and only three things earn their keep.
A common interface across providers. ChatOpenAI, ChatAnthropic, ChatOllama and a dozen others all implement the same Runnable contract: invoke, stream, batch, ainvoke. Swapping models becomes changing one import. Given that model choice is unstable — a better one appears every quarter and prices move sideways — that uniformity is worth real money.
A composition operator. LCEL (LangChain Expression Language) lets you write prompt | model | parser and get back a runnable that streams, batches and exposes typed inputs and outputs. The alternative — writing your own glue for streaming, retries, partial updates and token counting — is not conceptually hard, but it is the kind of code that quietly accumulates bugs across a team.
A coordinated ecosystem. Loaders, splitters, vector stores, tool decorators, agent controllers, tracers, evaluators — all conforming to the same interfaces. Picking any two of them still fits together. That is not a feature you notice on day one; it is the feature you miss the day you try to change vector store.
The cost of the abstraction
The same abstraction imposes costs, and honest project post-mortems name them clearly.
Indirection. A stack trace that used to end at your call to openai.chat.completions.create now runs through five layers of wrappers. The first debugging session with a real bug will teach you the internal call sites of RunnableSequence, whether you wanted to learn them or not.
Churn. The library moved from langchain monoliths to langchain-core plus integration packages between 2023 and 2024. Chains were rewritten, then rewritten again, and half of the online tutorials point at deprecated APIs. Pin your versions, read the changelog before an upgrade, and expect an afternoon of migration once a year.
A gravitational pull toward too much framework. LangChain makes it easy to build an agent for a task that would be one prompt and one function call. The classic anti-pattern is a chain of four steps solving something that a raw model call handled cleanly. Every abstraction you add is one more failure mode to trace.
When to write direct calls instead
Reach for the raw provider SDK when:
- You use one model and expect to keep it. The abstraction earns nothing.
- The task is single-shot: no memory, no retrieval, no tools.
client.chat.completions.createis shorter and easier to reason about than any chain. - You have hard latency budgets and every millisecond of Python overhead counts. Direct calls skip a runnable pipeline that adds a few dozen milliseconds per invocation.
- The failure mode you fear most is library churn, not model churn. Two hundred lines of your own code age slower than a dependency tree.
Reach for LangChain when you have two or more of: several models to compare, retrieval to combine with generation, memory to persist across turns, tools to expose to the model, and traces to keep for evaluation. The expense-reports assistant of this course will end up with all five, which is exactly why we bring in the framework.
The state of the ecosystem in 2026
Three packages matter to know by name.
langchain-core holds the Runnable interface, the message types, the prompt and output-parser abstractions, and the small utilities everything else depends on. It changes rarely; it is the stable base.
Integration packages such as langchain-openai, langchain-anthropic, langchain-ollama, langchain-chroma, langchain-huggingface each package one provider. Add them à la carte — you do not need the whole zoo.
langgraph builds on top of the core to describe agents and workflows as explicit graphs of nodes and edges. When the agent loop of module 8 needs branches, retries, human-in-the-loop pauses or persistent state, LangGraph is the layer that handles it. Do not adopt it before you need explicit control flow.
In summary
- LangChain earns its keep through a common provider interface, the LCEL composition operator and a coordinated ecosystem of loaders, retrievers, memories, tools and tracers.
- Its costs are real: indirection during debugging, churn between versions and a gravitational pull toward more framework than the problem needs.
- Prefer a direct SDK call for one-shot tasks with a fixed model; adopt LangChain when at least two of retrieval, memory, tools, streaming or multi-model comparison enter the picture.
- The 2026 ecosystem separates
langchain-core, per-provider integration packages andlanggraphfor explicit workflows — pick the pieces you need, not the whole tree.
Next module: the two abstractions you cannot skip — chat models and prompt templates — and the output parsers that turn free text into a structure your code can consume.