ArXiv论文搜索服务

基于FastAPI和FastMCP的ArXiv元数据搜索服务,使用SQLite FTS5实现快速检索。

  • by mitchins
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 mitchins/arxiv-paper-mcp

使用说明

arxiv纸mcp

使用SQLite FTS5在arXiv元数据上提供FastAPI+FastMCP搜索服务。

推荐运行路径(Docker)

预构建的图像已发布至GHCR linux/amd64 和 linux/arm64. 不需要构建步骤。

docker pull ghcr.io/mitchins/arxiv-paper-mcp:latest

docker run -d --name arxiv-paper-mcp \
  -p 8000:8000 \
  --mount type=bind,src=/absolute/path/to/arxiv.db,dst=/data/arxiv.db,readonly \
  -e DB_PATH=/data/arxiv.db \
  ghcr.io/mitchins/arxiv-paper-mcp:latest

图像已包含默认值 jargon_glossary.json 在...之下 /config. 仅安装 /config 如果你想提供定制 .env 或覆盖 词汇表。

停止:

docker rm -f arxiv-paper-mcp

首次启动后验证:

python3 scripts/smoke_runtime.py --endpoint http://127.0.0.1:8000 --iterations 7 --query "transformer" --search-timeout 180 --startup-wait 60 --warmup

如果愿意,仍支持Compose:

ARXIV_DB_HOST_PATH=/absolute/path/to/arxiv.db docker compose up -d --wait

股票组合文件已装载 ./config 到 /config你可以走了 该目录为空,或指向 ARXIV_CONFIG_HOST_PATH 当你在别处 想要覆盖 .env 或 jargon_glossary.json.

搜索流程

flowchart LR
  Q["POST /search"] --> N["Normalize query"]
  N --> J{"Jargon expansion enabled?"}
  J -->|"yes"| E["Expand glossary terms"]
  J -->|"no"| O["Use original query"]
  E --> F["SQLite FTS5 BM25 retrieval"]
  O --> F
  F --> B{"Broad-query rerank enabled?"}
  B -->|"no (v1.0 default)"| R["Return ranked results"]
  B -->|"yes"| X["Apply broad-query rerank"]
  X --> R

要从源代码构建(开发),请参阅 docs/development.md 或奔跑 bash scripts/dev_up.sh 它在本地构建并运行烟雾测试。

API快速检查

curl -fsS http://127.0.0.1:8000/health
curl -fsS -X POST http://127.0.0.1:8000/search \
  -H 'Content-Type: application/json' \
  -d '{"query":"transformer","limit":10}'

v1.0的搜索默认值

  • 启用行话扩展
  • 已禁用广泛查询重新分级

这些是冻结生产默认值,未经重新评估不得更改。

详细文档所在的位置

  • 开发和基准测试:docs/Development.md
  • 操作和推出清单:docs/ops_1_0_checklist.md
  • 搜索冻结/基线证据:文档/生产_冻结_20260329.0d
  • GitHub发布和分支保护设置:docs/GitHub release_setup.md
  • 发布说明模板:docs/Release_notes_template.md