How taohaoran/langgraph works
LangGraph is a framework for defining and running stateful agent workflows. A developer builds a state graph; the Pregel runtime executes its nodes over channels, with runnable support and streaming for execution behavior and results. Checkpointers, serialization, and stores support durable execution and memory; prebuilt components provide common agent and tool patterns. The Python SDK exposes remote assistant, thread, and run operations, while the CLI supports deployment. The README describes the major product capabilities; connections involving unsampled implementations are omitted or marked unverified.
Main entry points: main.py Pregel runtime · state.py State graph · client.py Python SDK · __init__.py Checkpoint interface
Components 20
Workflow runtime
- State graph
libs/langgraph/langgraph/graph/state.py - Pregel runtime
libs/langgraph/langgraph/pregel/main.py - State channels
libs/langgraph/langgraph/channels/base.py - Runnable execution
libs/langgraph/langgraph/_internal/_runnable.py - Stream transforms
libs/langgraph/langgraph/stream/transformers.py
Agent components
- Chat agent
libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py - Tool execution
libs/prebuilt/langgraph/prebuilt/tool_node.py
State and memory
- Checkpoint interface
libs/checkpoint/langgraph/checkpoint/base/__init__.py - JSON serialization
libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py - Memory store
libs/checkpoint/langgraph/store/base/__init__.py - In-memory store
libs/checkpoint/langgraph/store/memory/__init__.py - Postgres storage
libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py - SQLite checkpoint
libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py - Cache interface
libs/checkpoint/langgraph/cache/base/__init__.py
Client access
- Python SDK
libs/sdk-py/langgraph_sdk/_async/client.py - Run operations
libs/sdk-py/langgraph_sdk/_async/runs.py - Thread operations
libs/sdk-py/langgraph_sdk/_async/threads.py
Deployment
- CLI deployment
libs/cli/langgraph_cli/deploy.py
Other components
- Developer
- Human reviewer
Connections 20
- Developer → State graph: defines workflow
- State graph → Pregel runtime: compiles graph
- Pregel runtime → State channels: updates state
libs/langgraph/langgraph/pregel/main.py - Pregel runtime → Checkpoint interface: loads checkpoints
libs/langgraph/langgraph/pregel/main.py - Pregel runtime → JSON serialization: serializes state
- Pregel runtime → Runnable execution: executes nodes
libs/langgraph/langgraph/pregel/main.py - Pregel runtime → Stream transforms: emits streams
libs/langgraph/langgraph/pregel/main.py - Chat agent → Tool execution: uses tools
libs/prebuilt/langgraph/prebuilt/tool_node.py - Chat agent → State graph: builds workflow
- Pregel runtime → Memory store: accesses memory
libs/langgraph/langgraph/pregel/main.py - Memory store → In-memory store: implemented by
libs/checkpoint/langgraph/store/base/__init__.py - Memory store → Postgres storage: implemented by
- Checkpoint interface → Postgres storage: implemented by
- Checkpoint interface → SQLite checkpoint: implemented by
libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py - State graph → Cache interface: supports caching
libs/langgraph/langgraph/graph/state.py - Python SDK → Run operations: provides operations
libs/sdk-py/langgraph_sdk/_async/client.py - Python SDK → Thread operations: provides operations
libs/sdk-py/langgraph_sdk/_async/client.py - Python SDK → Pregel runtime: invokes remotely
- Human reviewer → Pregel runtime: reviews state
- Developer → CLI deployment: deploys workflow