终极网盘直链下载助手:告别限速,实现9大网盘高速下载自由
2026/6/21 18:18:47
LangGraph 专为希望构建强大、适应性强的 AI 智能体的开发者而设计。开发者选择LangGraph 的原因是:
LangGraph 支持两种对于构建对话代理至关重要的内存类型:
LangGraph CLl是一个多平台命令行工具,用于在本地构建和运行LangGraph API服务器。生成的服务器包含您的图的所有运行、线程、助手等的 API端点,以及运行您的代理所需的其他服务,包括用于检查点和存储的托管数据库。
Python版本:>= 3.11 is required.
virtualenv方式
使用虚拟环境所需依赖
pipinstallvirtualenv创建并激活环境
# 创建虚拟环境langgraph_envcdD:\Environment\virtual_env virtualenv langgraph_env# 激活环境cdlanggraph_env\Scripts activateConda方式
Conda安装参考 配置Python环境之Conda
conda create -n langgraph_envpython=3.13conda activate langgraph_env当前官网最新版本为0.4.7,后续版本迭代可查看 langgraph-cli官网
# 激活环境cdD:\Environment\virtual_env\langgraph_env\Scripts activate# 安装LangGraph CLI,可指定版本,"langgraph-cli[inmem]==0.4.7"pipinstall--upgrade"langgraph-cli[inmem]"命令如下:
# 激活环境 cd D:\Environment\virtual_env\langgraph_env\Scripts activate # 新建项目 langgraph new {project_name}其中
{project_name}代表LangGraph项目名称
示例:
cdD:\python-project langgraph new langgraph_demo################### output Start #####################🌟 Pleaseselecta template:1. New LangGraph Project - A simple, minimal chatbot with memory.2. ReAct Agent - A simple agent that can be flexibly extended to many tools.3. Memory Agent - A ReAct-style agent with an additional tool to store memoriesforuse across conversational threads.4. Retrieval Agent - An agent that includes a retrieval-based question-answering system.5. Data-enrichment Agent - An agent that performs web searches and organizes its findings into a structured format. Enter the number of your template choice(default is1):1You selected: New LangGraph Project - A simple, minimal chatbot with memory. Choose language(1forPython 🐍,2forJS/TS 🌐):1📥 Attempting to download repository as a ZIP archive... URL: https://github.com/langchain-ai/new-langgraph-project/archive/refs/heads/main.zip ✅ Downloaded and extracted repository to D:\python-project\langgraph_demo 🎉 New project created at D:\python-project\langgraph_demo################### output End #####################需要将
src目录标记为源代码根目录
在项目根目录下执行:
pipinstall-e.在新 LangGraph 应用的根目录下,以编辑模式安装依赖项,以便服务器使用本地更改。
在 LangGraph 中,pyproject.toml代传统的setup.py和requirements.txt,可能包含以下扩展配置:
[project.optional-dependencies]定义dev(开发工具)和test(测试框架)依赖。requires-python=“>=3.9"指定Python 版本兼容性[too1.*]配置与 GitHub Actions 或 GitLab Cl 的交互自此,本文分享到此结束!!!