基于 LangGraph 实现的聊天机器人,接入 DeepSeek、Qwen、智谱 AI 多个 LLM 模型,支持在线搜索和文件解析。
doubao-embedding-text-240715和doubao-embedding-large-text-240915
Embedding 模型,分别对应 2560 和 4096 向量维度。项目效果展示: LangGraphChatBot
<table> <tr> <td style="text-align: center;"><img src="./resources/websearch.png" width="600"/></td> <td style="text-align: center;"><img src="./resources/file_retrival.png" width="600"/></td> </tr> </table>
LangGraphChatBot 是基于 LangChain 和 LangGraph 的 AI 聊天机器人,可以用于回答问题、生成文章、联网搜索、处理文件等。该应用具备以下功能:
Tavily API),获取实时信息LLM 解决代码相关问题,支持连续对话、支持流式回答展示RAG 处理,切分文档,转换为向量表示,基于提供的文档内容和用户提问,进行相似度搜索和 rerank 优化,总结生成答案LLM 基座模型及 Embedding 模型可供选择,支持在线调节模型参数TODO: 接入第三方工具,如天气、翻译等,支持更多功能TODO: 当前联网搜索链路回复较慢,优化响应时间🎉 更多 Agent 个人项目请参考:Agent
以下指南将帮助你在本地机器上安装和运行该项目,进行本地对话。
克隆仓库
git clone git@github.com:kdjlyy/LangGraphChatBot.git
cd LangGraphChatBot
安装依赖
本项目推荐使用 uv 管理虚拟环境和依赖,如果没有安装 uv 也可以使用项目根目录下的 requirements.txt 文件拉取相关依赖。uv 的安装使用方法如下:
# 安装 uv
pip install uv
# 查看 uv 版本
uv --version
# 创建虚拟环境
uv venv
# 激活虚拟环境
source .venv/bin/activate
# 安装依赖
uv sync
拉取 python 和 torch 相关包时可能会遇到网络问题,可以尝试使用国内源。
项目配置
项目从根目录的 .env 文件读取配置信息,包括模型路径、模型参数、API 密钥等。如果需要修改配置信息,可以修改 .env 文件,也可以在运行时通过命令行参数指定配置信息。相关配置项的描述详见:.env.example 文件注释。
# 创建 .env 文件
cp .env.example .env
控制台运行项目
# 运行项目
uv run main.py
现在你可以在控制台输入问题,等待模型返回结果。
使用 Streamlit 运行项目
# 运行项目
streamlit run app.py
项目的主要目录结构如下:
.
├── chains # 智能体
│ ├── generate.py
│ ├── models.py
│ └── summary.py
├── embedding # embedding 兼容
│ ├── ark_embedding.py # 火山方舟的 embedding
│ └── base_embedding.py # embed
Open-source AI coding agent for the terminal. Claude Code-grade accuracy with smart model routing — uses the right AI model for each task, cutting costs 10x. Supports Claude, GPT, Gemini, DeepSeek & more.
A general-purpose Python framework for building LLM agents and multi-agent systems. "Four lines of code, an agent with memory."
Ultimate LLM API Integration Cookbook 2026 for Cursor & AI Agents
Ultimate Multi-Agent OS for Autonomous AI NPCs 2026
PrivateAgent is an open-source Android automation agent built with Flutter. It utilizes the DeepSeek API and native Android Accessibility Services to interpret screen layouts and execute multi-step tasks across any installed application via natural language commands.
把一队分工 Agent 织成一条写小说的流水线,做成桌面客户端;写作指纹让它越写越像你(BYO DeepSeek key,纯本地)。
Workflows from the Neura Market marketplace related to this DeepSeek resource