This project is a hands-on learning repository based on the official LangGraph tutorials, with all LLM calls replaced by Qwen (通义千问) models.
LangGraph is a framework for building stateful, multi-actor applications built on top of LangChain. This project learns how to build complex AI Agent applications through practicing official tutorials.
Use Python 3.12.11. DO NOT use version 3.14 as it will cause errors when installing langgraph-cli[inmem].
- Install Python 3.12.11 using pyenv:
pyenv install 3.12.11- Create a virtual environment:
pyenv virtualenv 3.12.11 langgraph-env- Set local Python version:
pyenv local langgraph-env- Install dependencies:
pip install -r requirements.txtlanggraph-learning/
├── 01_base/ # LangGraph basic examples
├── 02_quickstart/ # Quickstart tutorial
├── 03_thinking_in_langgraph/ # Core LangGraph concepts
└── requirements.txt # Project dependencies
Basic LangGraph examples including fundamental graph construction and node definitions.
Official quickstart tutorial implementation, including:
- Using Qwen model to replace official LLM examples
- Implementing simple Agent loops
- Basic tool calling workflows
- Conditional routing implementation
See 02_quickstart/README.md for details.
Core LangGraph thinking patterns tutorial, including:
- Breaking workflows into independent steps
- Node and edge design
- State management and sharing
- Dynamic routing and static routing
- Interrupt and resume mechanisms
See 03_thinking_in_langgraph/README.md for details.
- Using Qwen Model: All LLM calls use Qwen models through
ChatTongyifromlangchain-community - Complete State Management: Managing complex workflows using LangGraph's state graphs
- Tool Integration: Demonstrating how to integrate external tools into Agents
- Interruptible and Resumable: Supporting interruption and resumption in long-running workflows
- Using Qwen model requires API Key configuration, please refer to Qwen official documentation
- Python version must be 3.12.x, avoid using 3.14
- Some tutorials require network access to call Qwen API
本项目是基于 LangGraph 官方教程的学习实践项目,使用通义千问(Qwen)模型替代了原教程中的 LLM 调用。
LangGraph 是一个用于构建有状态、多参与者应用的框架,基于 LangChain 构建。本项目通过实践官方教程,学习如何使用 LangGraph 构建复杂的 AI Agent 应用。
使用 Python 3.12.11,注意不要使用 3.14 版本,因为在安装 langgraph-cli[inmem] 时会报错。
- 使用 pyenv 安装 Python 3.12.11:
pyenv install 3.12.11- 创建虚拟环境:
pyenv virtualenv 3.12.11 langgraph-env- 设置本地 Python 版本:
pyenv local langgraph-env- 安装依赖包:
pip install -r requirements.txtlanggraph-learning/
├── 01_base/ # LangGraph 基础示例
├── 02_quickstart/ # 快速入门教程
├── 03_thinking_in_langgraph/ # LangGraph 核心思维方式
└── requirements.txt # 项目依赖
LangGraph 的基础示例代码,包含基本的图构建和节点定义。
官方快速入门教程实践,包含:
- 使用 Qwen 模型替代官方示例中的 LLM
- 实现简单的 Agent 循环
- 工具调用的基本流程
- 条件路由的实现
详细说明请查看 02_quickstart/README.md
LangGraph 核心思维方式教程,包含:
- 工作流程拆分为独立步骤
- 节点和边的设计
- 状态管理和共享
- 动态路由和静态路由
- 中断和恢复机制
详细说明请查看 03_thinking_in_langgraph/README.md
- 使用 Qwen 模型:所有 LLM 调用都使用通义千问模型,通过
langchain-community的ChatTongyi实现 - 完整的状态管理:使用 LangGraph 的状态图管理复杂工作流
- 工具集成:展示如何将外部工具集成到 Agent 中
- 可中断和恢复:支持长时间运行的工作流中断和恢复
- 使用 Qwen 模型需要配置 API Key,请参考通义千问官方文档
- Python 版本务必使用 3.12.x,避免使用 3.14
- 部分教程需要网络访问以调用 Qwen API