LangGraph runs an agent as a graph of steps with shared state, so you can add loops, branches, memory and a human check without hiding the logic.
Do this first: Python with uv
Add it to a uv project
uv add langgraphFrom the official docs (written 10 Nov 2026); the automatic check confirms it on its next run
Or with pip in an active virtual environment
pip install -U langgraphFrom the official docs (written 10 Nov 2026); the automatic check confirms it on its next run
Optional: model and tool integrations
pip install -U langchainFrom the official docs (written 10 Nov 2026); the automatic check confirms it on its next run
from typing_extensions import TypedDict
from langgraph.graph import StateGraph, START, END
class State(TypedDict):
text: str
def shout(state: State) -> dict:
return {"text": state["text"].upper()}
g = StateGraph(State)
g.add_node("shout", shout)
g.add_edge(START, "shout")
g.add_edge("shout", END)
print(g.compile().invoke({"text": "hello graph"}))You should see: {'text': 'HELLO GRAPH'}
ModuleNotFoundError: No module named 'langgraph'Run the script inside the project: uv run python app.py (or activate the virtual environment first).
Requires-Python error while installingLangGraph needs Python 3.10+. With uv: uv python install 3.12, then uv add langgraph again.
Source: Install LangGraph (LangChain). Written from it on 2026-11-10; the pipeline confirms the commands on its next run.