{"id":50734368,"url":"https://github.com/tylevnovik/arxivagent","last_synced_at":"2026-06-10T12:02:28.629Z","repository":{"id":359616789,"uuid":"1201177898","full_name":"tylevnovik/ArxivAgent","owner":"tylevnovik","description":"基于 DeepSeek 大模型 API 驱动的智能论文检索代理，支持 arXiv、OpenAlex、Crossref 等开放学术数据源。","archived":false,"fork":false,"pushed_at":"2026-05-31T12:54:10.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-31T14:21:12.909Z","etag":null,"topics":["agent","arxiv","deepseek","fastapi","paper-search","rag"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tylevnovik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-04T10:09:56.000Z","updated_at":"2026-05-31T12:54:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tylevnovik/ArxivAgent","commit_stats":null,"previous_names":["tylevnovik/arxivagent"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tylevnovik/ArxivAgent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylevnovik%2FArxivAgent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylevnovik%2FArxivAgent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylevnovik%2FArxivAgent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylevnovik%2FArxivAgent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tylevnovik","download_url":"https://codeload.github.com/tylevnovik/ArxivAgent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylevnovik%2FArxivAgent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34151276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["agent","arxiv","deepseek","fastapi","paper-search","rag"],"created_at":"2026-06-10T12:02:26.976Z","updated_at":"2026-06-10T12:02:28.619Z","avatar_url":"https://github.com/tylevnovik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔍 多源论文检索 Agent\n\n基于 DeepSeek 大模型 API 驱动的智能论文检索代理，支持 arXiv、OpenAlex、Crossref 等开放学术数据源。\n\n当前版本：`v0.2.0`\n\n## 功能特性\n\n- 🗣️ **自然语言检索**：用中文描述检索需求，Agent 自动理解并构造检索式\n- 🔄 **智能迭代优化**：自动审核检索结果，不满意时迭代优化检索策略\n- 🌐 **多源检索**：支持 arXiv、OpenAlex、Crossref、Semantic Scholar，并带本地缓存、去重与轻量排序\n- 📡 **实时流式展示**：Agent 思考过程、检索状态实时流式展示\n- 🧠 **检索记忆**：记住历史检索轮次，避免重复无效检索\n- 💬 **意图识别**：区分闲聊、检索、修正和结果追问，避免无意义检索\n- 📚 **混合正文 RAG**：使用本地 FastEmbed 向量化、Qdrant 向量库、BM25S 关键词索引和 RRF 融合，在最终报告和后续追问中引用论文正文片段\n- 📤 **多格式导出**：支持 Markdown、CSV、JSON 格式导出对话和结果\n- 🎨 **Web UI**：基于 FastAPI + 单页前端的现代化交互界面\n\n## 项目结构\n\n```\nArxivAgent/\n├── prompts/             # 提示词模板（纯文本，中文）\n│   ├── system.txt       # 系统提示词\n│   ├── query_parse.txt  # 需求理解 \u0026 构造检索式\n│   ├── result_review.txt# 审核检索结果\n│   ├── refine_query.txt # 优化检索策略\n│   ├── error_recovery.txt # 检索出错时的恢复策略\n│   ├── followup_chat.txt # 对话追问提示词\n│   └── summary.txt      # 生成最终报告\n├── core/                # 核心模块\n│   ├── llm.py           # DeepSeek API 封装\n│   ├── arxiv_search.py  # arXiv API 封装\n│   ├── search_service.py# 多源论文检索、缓存与排序服务\n│   ├── pdf_parser.py    # PDF 下载与文本提取分块\n│   ├── rag.py           # 本地混合 RAG 检索器 (Qdrant + BM25S + RRF)\n│   ├── memory.py        # 对话 \u0026 检索记忆\n│   ├── agent.py         # Agent 主循环\n│   └── exporter.py      # 导出功能\n├── index.html           # 单页前端\n├── app.py               # FastAPI 服务入口\n├── config.py            # 配置管理\n├── VERSION              # 版本号文件\n└── requirements.txt     # 依赖\n```\n\n## Agent 工作流程\n\n```\n用户输入 → [理解需求] → 构造检索式 → [多源检索] → [审核结果]\n                                                       ↓\n                                           满意？→ 否 → [优化策略] → 重新检索\n                                                       ↓\n                                                       是 → [生成报告] → 完成\n```\n\n## 快速开始\n\n```bash\n# 1. 创建虚拟环境\npython -m venv .venv\n.venv\\Scripts\\activate       # Windows\n# source .venv/bin/activate  # Linux/Mac\n\n# 2. 安装依赖\npip install -r requirements.txt\n\n# 3. 启动\npython app.py\n```\n\n访问 `http://localhost:7860` 使用。\n\n## 配置\n\n编辑 `config.py` 可修改：\n- DeepSeek API Key 和模型配置\n- arXiv / OpenAlex / Crossref 检索参数\n- 最大检索轮次\n\n也可以通过 `.env` 调整：\n\n```bash\nDEEPSEEK_API_KEY=你的key\nSEARCH_PROVIDERS=arxiv,openalex,crossref\nSEARCH_PROVIDER_TIMEOUT_SECONDS=15\nSEARCH_CACHE_TTL_SECONDS=86400\nOPENALEX_MAILTO=your-email@example.com\nCROSSREF_MAILTO=your-email@example.com\nSEMANTIC_SCHOLAR_API_KEY=可选\n```\n\n如需启用 Semantic Scholar，可把 `SEARCH_PROVIDERS` 改为：\n\n```bash\nSEARCH_PROVIDERS=arxiv,openalex,semantic_scholar,crossref\n```\n\n### RAG 配置\n\n默认 RAG 使用本地方案，不需要 OpenAI API Key，也不要求 Docker：\n\n- `FastEmbed` 负责本地 embedding，默认模型为 `sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2`\n- `Qdrant local mode` 负责 dense vector 检索，默认数据目录为 `.cache/qdrant`\n- `BM25S` 负责关键词召回\n- `RRF` 负责融合向量召回和 BM25 召回\n- 可选 reranker 默认关闭，避免首次下载和推理成本过高\n\n可通过 `.env` 调整：\n\n```bash\nRAG_RETRIEVER_TYPE=hybrid\nRAG_EMBEDDING_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2\nRAG_QDRANT_LOCATION=.cache/qdrant\nRAG_TOP_K=6\nRAG_DENSE_CANDIDATES=20\nRAG_BM25_CANDIDATES=20\nRAG_RRF_K=60\nRAG_ENABLE_RERANKER=false\nRAG_RERANKER_MODEL=BAAI/bge-reranker-base\n```\n\n如果本地机器暂时无法安装或下载 Qdrant/FastEmbed/BM25S 依赖，Agent 会自动降级为轻量 TF-IDF RAG，不会中断主流程。首次运行本地 embedding 模型时需要下载模型文件，之后会走本机缓存。\n\n注意：Qdrant local mode 适合单进程桌面/本地运行；如果多个 Python 进程同时访问同一个 `.cache/qdrant` 目录，Qdrant 会加锁。此时 Agent 会自动退到 Qdrant `:memory:` 继续使用 hybrid 检索。需要多进程或多人并发部署时，建议改用独立 Qdrant server，并把 `RAG_QDRANT_LOCATION` 配成服务 URL。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylevnovik%2Farxivagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylevnovik%2Farxivagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylevnovik%2Farxivagent/lists"}