By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
LangChain 1.x is a thin orchestration layer, not a model. Three packages cover almost everything in this path: langchain (the agent factory, middleware and provider entry points), langchain-core (messages, tools and the runnable interface), and one provider integration such as langchain-openai. You can replace any one of them without rewriting the others.
The 1.x releases also moved memory, approval and tracing helpers into middleware that plugs into the agent runtime. That is why this path can spend most of its time on your design decisions instead of on glue code.
# Inside a project directory, with uv (recommended):
uv add langchain langchain-openai
# Text splitters are a separate package in LangChain 1.x. Add them when you
# reach the retrieval lesson (Lesson 10):
uv add langchain-text-splitters
# The same environment with pip:
python -m venv .venv
source .venv/bin/activate # Windows: .venv/Scripts/activate
pip install -U langchain langchain-openai
pip install -U langchain-text-splitters # retrieval lesson only
# Colab: use the pip form with a leading % in the cell:
# %pip install -q -U langchain langchain-openaiEvery structural exercise runs without an API key. LangChain ships deterministic test models; GenericFakeChatModel accepts an iterator of messages or plain strings and returns the next one on each call. It exercises the exact message plumbing a real provider uses — only the answers are canned.
from langchain.messages import HumanMessage, SystemMessage
from langchain_core.language_models.fake_chat_models import GenericFakeChatModel
model = GenericFakeChatModel(
messages=iter(["I can help with that. Could you share your order number?"])
)
reply = model.invoke(
[
SystemMessage("You are Harbor Supply's support agent."),
HumanMessage("My order arrived with a cracked lid."),
]
)
print(reply.content)A live provider model is a drop-in replacement for the same invoke call — same messages in, same AIMessage out. Examples that need one carry an API key badge. The output shown for those examples is illustrative, not a capture from a live run of this lesson.
SystemMessage, HumanMessage, AIMessage and ToolMessage mean the same thing everywhere.create_agent in 1.x) that runs model → tool → model until the task is done or a limit is hit.Tools, loops and memory are additions to a single shape: build a message list, send it to a model, inspect the reply. Get comfortable with the shape first; the rest of the path is about what to add when one call is not enough.
Key takeaways
LangChain 1.x is a thin layer: langchain, langchain-core and one provider package are enough to start.
GenericFakeChatModel runs the real message plumbing with no key and deterministic output.
A model call takes a list of messages and returns an AIMessage.
LangChain does not manage history for you — you decide what goes into the next message list.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.