能力标签
LangChain AI开发框架
🛠
AI工具

LangChain AI开发框架

基于 TypeScript · 开源 AI 工具,GitHub 社区精选
英文名:ai-pdf-chatbot-langchain
⭐ 16.5k Stars 🍴 3.2k Forks 💻 TypeScript 📄 MIT 🏷 AI 8.2分
8.2AI 综合评分
LangChainLangGraphPDF处理对话系统工作流自动化TypeScript
✦ AI Skill Hub 推荐

LangChain AI开发框架 是 AI Skill Hub 本期精选AI工具之一。在 GitHub 上收获超过 16.5k 颗 Star,综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

LangChain AI开发框架 是一款基于 TypeScript 的开源工具,在 GitHub 上收获 17k+ Star,是LangChain、LangGraph、PDF处理、对话系统领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
LangChain AI开发框架 依赖 TypeScript 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 TypeScript 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 LangChain AI开发框架 的版本更新,及时通知重要功能变化。

📋 工具概览

基于LangChain和LangGraph构建的开源PDF文档AI对话系统。支持智能问答、文档理解和多轮对话,具有完整的Agent工作流框架。适合开发者快速构建文档分析、知识库问答等应用场景。

LangChain AI开发框架 是一款基于 TypeScript 开发的开源工具,专注于 LangChain、LangGraph、PDF处理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 16.5k
开发语言
TypeScript
支持平台
Windows / macOS / Linux
维护状态
活跃维护,更新频繁
开源协议
MIT
AI 综合评分
8.2 分
工具类型
AI工具
Forks
3.2k

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

基于LangChain和LangGraph构建的开源PDF文档AI对话系统。支持智能问答、文档理解和多轮对话,具有完整的Agent工作流框架。适合开发者快速构建文档分析、知识库问答等应用场景。

LangChain AI开发框架 是一款基于 TypeScript 开发的开源工具,专注于 LangChain、LangGraph、PDF处理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:npm 全局安装
npm install -g ai-pdf-chatbot-langchain

# 方式二:npx 直接运行(无需安装)
npx ai-pdf-chatbot-langchain --help

# 方式三:项目依赖安装
npm install ai-pdf-chatbot-langchain

# 方式四:从源码运行
git clone https://github.com/mayooear/ai-pdf-chatbot-langchain
cd ai-pdf-chatbot-langchain
npm install
npm start
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
ai-pdf-chatbot-langchain --help

# 基本用法
ai-pdf-chatbot-langchain [options] <input>

# Node.js 代码中使用
const ai_pdf_chatbot_langchain = require('ai-pdf-chatbot-langchain');

const result = await ai_pdf_chatbot_langchain.run(options);
console.log(result);
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# ai-pdf-chatbot-langchain 配置说明
# 查看配置选项
ai-pdf-chatbot-langchain --config-example > config.yml

# 常见配置项
# output_dir: ./output
# log_level: info
# workers: 4

# 环境变量(覆盖配置文件)
export AI_PDF_CHATBOT_LANGCHAIN_CONFIG="/path/to/config.yml"
📑 README 深度解析 真实文档 完整度 70/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

AI PDF Chatbot & Agent Powered by LangChain and LangGraph

This monorepo is a customizable template example of an AI chatbot agent that "ingests" PDF documents, stores embeddings in a vector database (Supabase), and then answers user queries using OpenAI (or another LLM provider) utilising LangChain and LangGraph as orchestration frameworks.

This template is also an accompanying example to the book Learning LangChain (O'Reilly): Building AI and LLM applications with LangChain and LangGraph.

[!IMPORTANT] This project is not actively maintained and is kept here for reference. Please do not expect responses to new issues or pull requests.

Here's what the Chatbot UI looks like:

<img width="1096" alt="Screenshot 2025-02-20 at 05 39 55" src="https://github.com/user-attachments/assets/3a9ddea7-b718-476b-bdae-38839be20c12" />

Architecture Overview

┌─────────────────────┐    1. Upload PDFs    ┌───────────────────────────┐
│Frontend (Next.js)   │ ────────────────────> │Backend (LangGraph)       │
│ - React UI w/ chat  │                      │ - Ingestion Graph         │
│ - Upload .pdf files │ <────────────────────┤   + Vector embedding via  │
└─────────────────────┘    2. Confirmation   │     SupabaseVectorStore   │
(storing embeddings in DB)

┌─────────────────────┐    3. Ask questions  ┌───────────────────────────┐
│Frontend (Next.js)   │ ────────────────────> │Backend (LangGraph)       │
│ - Chat + SSE stream │                      │ - Retrieval Graph         │
│ - Display sources   │ <────────────────────┤   + Chat model (OpenAI)   │
└─────────────────────┘ 4. Streamed answers  └───────────────────────────┘
- Supabase is used as the vector store to store and retrieve relevant documents at query time. - OpenAI (or other LLM providers) is used for language modeling. - LangGraph orchestrates the "graph" steps for ingestion, routing, and generating responses. - Next.js (React) powers the user interface for uploading PDFs and real-time chat.

The system consists of: - Backend: A Node.js/TypeScript service that contains LangGraph agent "graphs" for: - Ingestion (src/ingestion_graph.ts) - handles indexing/ingesting documents - Retrieval (src/retrieval_graph.ts) - question-answering over the ingested documents - Configuration (src/shared/configuration.ts) - handles configuration for the backend api including model providers and vector stores - Frontend: A Next.js/React app that provides a web UI for users to upload PDFs and chat with the AI. ---

Features

  • Document Ingestion Graph: Upload and parse PDFs into Document objects, then store vector embeddings into a vector database (we use Supabase in this example).
  • Retrieval Graph: Handle user questions, decide whether to retrieve documents or give a direct answer, then generate concise responses with references to the retrieved documents.
  • Streaming Responses: Real-time streaming of partial responses from the server to the client UI.
  • LangGraph Integration: Built using LangGraph’s state machine approach to orchestrate ingestion and retrieval, visualise your agentic workflow, and debug each step of the graph.
  • Next.js Frontend: Allows file uploads, real-time chat, and easy extension with React components and Tailwind.

---

Prerequisites

1. Node.js v18+ (we recommend Node v20). 2. Yarn (or npm, but this monorepo is pre-configured with Yarn). 3. Supabase project (if you plan to store embeddings in Supabase; see Setting up Supabase). - You will need: - SUPABASE_URL - SUPABASE_SERVICE_ROLE_KEY - A table named documents and a function named match_documents for vector similarity search (see LangChain documentation for guidance on setting up the tables). 4. OpenAI API Key (or another LLM provider’s key, supported by LangChain). 5. LangChain API Key (free and optional, but highly recommended for debugging and tracing your LangChain and LangGraph applications). Learn more here

---

Installation

  1. Clone the repository:
   git clone https://github.com/mayooear/ai-pdf-chatbot-langchain.git
   cd ai-pdf-chatbot-langchain
   
  1. Install dependencies (from the monorepo root):

yarn install

  1. Configure environment variables in both backend and frontend. See .env.example files for details.

Deploying the Backend

To deploy your LangGraph agent to a cloud service, you can either use LangGraph's cloud as per this guide or self-host it as per this guide.

Deploying the Frontend

The frontend can be deployed to any hosting that supports Next.js (Vercel, Netlify, etc.).

Make sure to set relevant environment variables in your deployment environment. In particular, ensure NEXT_PUBLIC_LANGGRAPH_API_URL is pointing to your deployed backend URL.

Usage

Once both services are running:

  1. Use langgraph studio UI to interact with the LangGraph server and ensure the workflow is working as expected.
  1. Navigate to http://localhost:3000 to use the chatbot UI.
  1. Upload a small PDF document via the file upload button at the bottom of the page. This will trigger the ingestion graph to extract the text and store the embeddings in Supabase via the frontend app/api/ingest route.
  2. After the ingestion is complete, ask questions in the chat input.
  1. The chatbot will trigger the retrieval graph via the app/api/chat route to retrieve the most relevant documents from the vector database and use the relevant PDF context (if needed) to answer.

Environment Variables

The project relies on environment variables to configure keys and endpoints. Each sub-project (backend and frontend) has its own .env.example. Copy these to .env and fill in your details.

Asking Questions

  • Type your question in the chat input field.
  • Responses stream in real time. If the system retrieved documents, you’ll see a link to “View Sources” for each chunk of text used in the answer.

Troubleshooting

1. .env Not Loaded - Make sure you copied .env.example to .env in both backend and frontend. - Check your environment variables are correct and restart the dev server.

2. Supabase Vector Store - Ensure you have configured your Supabase instance with the documents table and match_documents function. Check the official LangChain docs on Supabase integration.

3. OpenAI Errors - Double-check your OPENAI_API_KEY. Make sure you have enough credits/quota.

4. LangGraph Not Running - If yarn langgraph:dev fails, confirm your Node version is >= 18 and that you have all dependencies installed.

5. Network Errors - Frontend must point to the correct NEXT_PUBLIC_LANGGRAPH_API_URL. By default, it is http://localhost:2024.

🎯 aiskill88 AI 点评 A 级 2026-05-21

设计精良的AI Agent框架,集成LangChain生态,代码质量优秀。社区活跃、维护及时,是构建PDF对话应用的优选方案。

📚 实用指南(长尾问题)
适合谁
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
最佳实践
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
部署方案
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
ai-pdf-chatbot-langchain 中文教程ai-pdf-chatbot-langchain 安装报错怎么办ai-pdf-chatbot-langchain Agent 工作流ai-pdf-chatbot-langchain 与同类工具对比ai-pdf-chatbot-langchain 最佳实践ai-pdf-chatbot-langchain 适合谁用

⚡ 核心功能

👥 适合谁
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
⭐ 最佳实践
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +GitHub 16.5k Star,社区高度认可
  • +MIT 协议,可免费商用
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

支持标准PDF文件,建议使用文本型PDF以获得最佳效果。
💡 AI Skill Hub 点评

经综合评估,LangChain AI开发框架 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

📚 深入学习 LangChain AI开发框架
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 ai-pdf-chatbot-langchain
原始描述 开源AI工作流:AI PDF chatbot agent built with LangChain & LangGraph 。⭐16.5k · TypeScript
Topics LangChainLangGraphPDF处理对话系统工作流自动化TypeScript
GitHub https://github.com/mayooear/ai-pdf-chatbot-langchain
License MIT
语言 TypeScript
🔗 原始来源
🐙 GitHub 仓库  https://github.com/mayooear/ai-pdf-chatbot-langchain 🌐 官方网站  https://www.youtube.com/watch?v=OF6SolDiEwU

收录时间:2026-05-14 · 更新时间:2026-05-16 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →