
ChatPDF
本地文档直接聊,无需联网,RAG 全流程原生实现。
项目预览
项目数据
项目介绍
Star 增长趋势
本站每日记录该项目 GitHub 星标变化,观测越久曲线越完整
数据来源:GitHub API 逐日快照 · 收录于 2026-08-09 · 当前星标 ★ 861
使用教程
环境要求
- Python 3.9+
- 一个可用的大模型端点
安装与启动步骤
-
1装依赖
仓库自带 WebUI 与 RAG 脚本。
git clone https://github.com/shibing624/ChatPDF.git cd ChatPDF pip install -r requirements.txt -
2配模型
本地模型或 API 二选一,走环境变量。
export OPENAI_API_KEY=sk-xxx -
3命令行问答
先跑 rag.py 验证检索链路。
CUDA_VISIBLE_DEVICES=0 python rag.py -
4起界面
WebUI 支持上传多份 PDF 后追问。
python webui.py
如何确认成功
上传 PDF 后提问,回答能给出对应页码或原文片段。
注意事项
- 还有 graphrag 示例,适合多文档关联问答。
- 扫描件要先 OCR,否则检索不到文字。
核心亮点
- 纯原生实现 RAG,无第三方 agent 依赖,环境更干净
- 支持 GraphRAG,能捕捉实体关系,回答更准确
- 集成 reranker 模型,检索结果相关性更高
不足之处
- 早期项目,文档和社区支持待观察
- 仅支持 PDF/doc/txt,格式覆盖有限
适用场景
- 本地私有文档问答,如合同、论文阅读
- 离线知识库构建,用于企业内部资料查询
- 教育场景,学生与教材 PDF 互动学习
替代项目
LangChain、LlamaIndex、Haystack
上一篇:rag-demystified
下一篇:html-to-markdown
同类项目推荐
adaptive-chunking
开源
自动为每篇文档挑最佳分块法,提升 RAG 检索准确率
Adaptive Chunking: automatically select the best chunking method per document for RA···
casecite
开源
自托管判例检索,问答带原文出处
CaseCite is an open-source, self-hosted legal RAG caselaw research & document analys···
claude-rank
开源
让 AI 搜到你的网站,自动修复可发现性文件
Claude Code plugin that tells you why your site won't get cited by AI — and fixes t···
album-ai
开源
跟相册聊天,用大白话找照片,AI 自动理解内容
AI-First Album: Chat with your gallery using plain language! LLM Vision + RAG + Albu···
memex
开源
一句话搜回所有 AI 编程会话,还能续聊和算 token
Search Claude Code, Codex, Pi, OpenCode, Github Copilot & Cursor transcripts. Resume···
chat-with-your-data-solution-acc···
开源
把自家文档喂给它,秒变懂行的答疑专家
A Solution Accelerator for the RAG pattern running in Azure, using Azure AI Search f···
turboseek
开源
自建带引用来源的 AI 搜索问答
An AI search engine inspired by Perplexity
rag-chat
开源
快速搭建检索增强对话原型,验证 RAG 想法。
Prototype SDK for RAG development.
teracrawl
开源
把任意网页变成干净 Markdown,喂给大模型,轻松搞定!
High-performance web crawler API optimized for LLMs. Turn any search or website into···