LangGraphLangGraph 1.2 · Python 3.10+
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
38 small wins to finish your pathNext lesson →

Installation and setup

LangGraph installs from PyPI with pip. You need three packages: langgraph runs your graphs, langchain provides models, message types and tools, and a provider package such as langchain-groq connects to a hosted model. python-dotenv, optional, loads your key from a file.

Last updated: 29 Sep, 2026 · LangGraph 1.2 · Python 3.10+

Starting a project with uv · from the Complete Agentic AI Course In 10 Hours · 160:41 to 163:42

Installing LangGraph with pip, uv or Colab

The crash course sets the project up with uv, a fast Python package and project manager written in Rust. uv init turns the folder into a project: it writes pyproject.toml, a .python-version file (3.13 in the video) and a starter main.py. The video lists the libraries in requirements.txt, starting with langgraph, langchain and langsmith, creates the environment with uv venv, activates it, and installs everything with uv add -r requirements.txt.

Pick the tab that fits how you work. pip is the plain way, uv follows the video, and Colab needs nothing installed on your machine. Unlike the video, the tabs pin each version, the ones every lesson was run with.

pip install "langgraph==1.2.12" "langchain==1.4.2" "langchain-groq==1.1.3" "python-dotenv==1.2.3"

Check the install

Example
from importlib.metadata import version

print("langgraph", version("langgraph"))
print("langchain", version("langchain"))
print("langchain-groq", version("langchain-groq"))

What each package does

  • langgraph is the orchestration layer: graphs, state, edges, checkpointers.
  • langchain supplies the chat models, message types and tools that graphs use later.
  • langchain-groq connects init_chat_model to Groq's hosted models. Any other provider LangChain supports works the same way with its own package.
  • The first lessons are plain Python. The model lessons call a real model, which needs an API key (below).
Watch out. LangGraph needs Python 3.10 or newer. On an older Python the install fails or imports break.

Get an API keyNeeded for the model lessons

The model lessons call a real hosted model, and the output you see is its real reply. Groq's free tier is what this course uses; the others work the same way with their own package and model string.

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"
OpenAIPaid, platform.openai.com/api-keysOPENAI_API_KEYlangchain-openai, "openai:gpt-4.1-mini"

The clips use Groq models such as llama3-8b-8192, which Groq has since retired; every example here runs on openai/gpt-oss-120b.

Set the key as an environment variable before you run the model lessons.

export GROQ_API_KEY=gsk_...

Keeping the key in a .env file

The video keeps its keys in a file named .env in the project folder and loads them with python-dotenv, installed above. export and $env: set the key for one terminal window only; the file keeps it:

bash
GROQ_API_KEY=gsk_...

Start each script with these two lines, before any model is created. The examples in later lessons leave them out, so add them at the top if you keep your key in .env. Add .env to your .gitignore so the key never reaches a Git repository. In Colab the Secrets panel above does this job.

python
from dotenv import load_dotenv

load_dotenv()   # copies the keys in .env into the environment

Check the key with a real call

With the key set, one call reaches the model and comes back with a real reply. init_chat_model is explained in the chat-models lesson.

ExampleAPI key
from langchain.chat_models import init_chat_model

model = init_chat_model("groq:openai/gpt-oss-120b", temperature=0)  # uses your GROQ_API_KEY
print(model.invoke("In one sentence, what is LangGraph?").content)

The crash course gives its chatbot a web search tool, TavilySearch from the langchain-tavily package, which needs a TAVILY_API_KEY. The examples from the video that search the web use it, starting in ToolNode and tools_condition, which installs the package and sets up the key. The free plan needs no card. The course's own shop examples run with the Groq key alone.

Try it yourself
  • Run the version check. Do your versions match 1.x?
  • Import from langgraph.graph import StateGraph, START, END and confirm no error.

Little by little, you're building something great.