{"id":25332467,"url":"https://github.com/zhuima/rag-demo","last_synced_at":"2025-07-21T08:03:15.609Z","repository":{"id":276266938,"uuid":"928754952","full_name":"zhuima/rag-demo","owner":"zhuima","description":"基于DeepSeek R1模型构建的智能文档问答系统，支持PDF文档解析与语义问答","archived":false,"fork":false,"pushed_at":"2025-02-07T07:23:12.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T07:45:45.451Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhuima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-07T07:16:14.000Z","updated_at":"2025-02-26T07:20:43.000Z","dependencies_parsed_at":"2025-02-07T08:34:42.187Z","dependency_job_id":null,"html_url":"https://github.com/zhuima/rag-demo","commit_stats":null,"previous_names":["zhuima/rag-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhuima/rag-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuima%2Frag-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuima%2Frag-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuima%2Frag-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuima%2Frag-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhuima","download_url":"https://codeload.github.com/zhuima/rag-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuima%2Frag-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266263057,"owners_count":23901355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-14T04:52:17.905Z","updated_at":"2025-07-21T08:03:15.585Z","avatar_url":"https://github.com/zhuima.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeepSeek RAG Chat 🤖\n\n基于DeepSeek R1模型构建的智能文档问答系统，支持PDF文档解析与语义问答\n\n\n## 主要特性 ✨\n- 📄 PDF文档智能解析与语义分块\n- 🔍 基于FAISS的向量相似度检索\n- 💬 对话式交互界面（支持上下文记忆）\n- 🚀 使用Ollama本地部署DeepSeek R1模型\n- 🎨 响应式布局设计（适配桌面/移动端）\n\n## 技术栈 ⚙️\n- **大语言模型**: DeepSeek R1 32B (via Ollama)\n- **框架**: Streamlit + LangChain\n- **向量数据库**: FAISS\n- **文本嵌入**: Sentence-Transformers\n- **PDF解析**: PDFPlumber\n\n## 快速开始 🚀\n\n### 前置要求\n- Python 3.9+\n- Ollama 已安装并运行\n- 已拉取DeepSeek模型：\n  ```bash\n  ollama pull deepseek-r1:32b\n  ```\n\n### 安装步骤\n1. 克隆仓库：\n   ```bash\n   git clone https://github.com/zhuima/rag-demo.git\n   cd rag-demo\n   ```\n\n2. 安装依赖：\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. 启动应用：\n   ```bash\n   streamlit run main.py\n   ```\n\n## 使用指南 📖\n1. 在左侧边栏上传PDF文档\n2. 等待文档处理完成（首次需要1-2分钟）\n3. 在底部输入框提问，例如：\n   - \"请总结本文的核心观点\"\n   - \"第三章主要讨论了哪些内容？\"\n   - \"列出文中提到的关键技术点\"\n\n## 配置说明 ⚙️\n| 组件 | 默认配置 | 可调整参数 |\n|------|---------|-----------|\n| Ollama | `base_url=\"http://127.0.0.1:11434\"` | 端口号/服务器地址 |\n| 向量检索 | `k=3` 个上下文块 | 检索数量/相似度阈值 |\n| 文本分块 | 语义分块 | 块大小/重叠比例 |\n| 模型参数 | `temperature=0.7` | 创造性/确定性平衡 |\n\n## 项目结构 📂 \n\n```python\n.\n├── main.py # 主应用程序\n├── requirements.txt # 依赖列表\n├── README.md # 说明文档\n```\n\n## 常见问题 ❓\n**Q: 出现`ConnectionError`怎么办？**  \nA: 确保：\n1. Ollama服务正在运行\n2. 模型已正确下载 (`ollama list`)\n3. 防火墙允许11434端口通信\n\n**Q: 如何处理大文档？**  \n- 使用性能更强的GPU设备\n- 调整`search_kwargs={\"k\": 2}`减少检索量\n- 增加系统内存（推荐≥16GB）\n\n## 开发路线图 🗺️\n- [ ] 多文档支持\n- [ ] 对话历史导出\n- [ ] 自动文档摘要\n- [ ] 混合检索策略\n\n## 许可证 📜\nMIT License © 2024 [zhuima]\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuima%2Frag-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhuima%2Frag-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuima%2Frag-demo/lists"}