LangChain AI开发框架 是 AI Skill Hub 本期精选AI工具之一。在 GitHub 上收获超过 16.5k 颗 Star,综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
基于LangChain和LangGraph构建的开源PDF文档AI对话系统。支持智能问答、文档理解和多轮对话,具有完整的Agent工作流框架。适合开发者快速构建文档分析、知识库问答等应用场景。
LangChain AI开发框架 是一款基于 TypeScript 开发的开源工具,专注于 LangChain、LangGraph、PDF处理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
基于LangChain和LangGraph构建的开源PDF文档AI对话系统。支持智能问答、文档理解和多轮对话,具有完整的Agent工作流框架。适合开发者快速构建文档分析、知识库问答等应用场景。
LangChain AI开发框架 是一款基于 TypeScript 开发的开源工具,专注于 LangChain、LangGraph、PDF处理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一: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
# 命令行使用
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"
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" />
┌─────────────────────┐ 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. ---
Document objects, then store vector embeddings into a vector database (we use Supabase in this example).---
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
---
git clone https://github.com/mayooear/ai-pdf-chatbot-langchain.git
cd ai-pdf-chatbot-langchain
yarn install
env.example files for details.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.
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.
Once both services are running:
app/api/ingest route.app/api/chat route to retrieve the most relevant documents from the vector database and use the relevant PDF context (if needed) to answer.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.
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.
设计精良的AI Agent框架,集成LangChain生态,代码质量优秀。社区活跃、维护及时,是构建PDF对话应用的优选方案。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,LangChain AI开发框架 在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 |
收录时间:2026-05-14 · 更新时间:2026-05-16 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。