LangChainLangChain 1.4 · Python 3.10+
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
43 small wins to finish your pathNext lesson

Installation and setup

One pip install brings the framework, its core types and the runtime under its agents. Provider packages come later, when a hosted model replaces the one you write.

langchain 1.4.2

The langchain package brings langchain-core, which holds the message types and the base classes every model builds on, and langgraph, which runs the agent loop.

pip install "langchain==1.4.2"

Check which version Python finds:

Example
from importlib.metadata import version

print(version("langchain"))
print(version("langchain-core"))

Lessons 26 and 29 install what they need when they need it: a text splitter, numpy and MCP support.

Keys, for when you want a hosted modelOptional

Every lesson runs on a stand-in model you write in lesson 3. To use a hosted model instead, install its provider package and set its key as an environment variable. Lesson 33 makes the switch with init_chat_model.

ProviderKeyVariablePackage and model string
GroqFree, console.groq.com/keysGROQ_API_KEYlangchain-groq, "groq:openai/gpt-oss-120b"
GeminiFree, aistudio.google.com/apikeyGOOGLE_API_KEYlangchain-google-genai, "google_genai:gemini-2.5-flash"
OpenRouterFree models end in :free, openrouter.ai/keysOPENROUTER_API_KEYlangchain-openrouter, "openrouter:google/gemma-4-31b-it:free"
pip install "langchain-groq==1.1.3"
export GROQ_API_KEY=gsk_...
Try it yourself
  • Run pip show langchain and find langgraph in its Requires line.

Little by little, you're building something great.