Skip to content

Repository files navigation

Agentic arXiv Observer

逐日、逐类别扫描 arXiv 全量论文,使用本地 LLM(gpt-oss:120b via Ollama)生成中文学术舆情报告,并以 git commit 形式归档。


快速开始

1. 环境准备

# Python 依赖
pip install -r requirements.txt

# 确保 Ollama 已运行,且拉取了目标模型
ollama pull gpt-oss:120b

2. 配置 Kaggle API Token

# .env 已在 .gitignore 中,不会提交
echo "KAGGLE_API_TOKEN=你的token" > .env

3. 下载数据集(~4 GB)

python download_arxiv.py

4. 启动(索引会自动建立)

# tmux 后台长跑(推荐,任务耗时数天)
bash run.sh

# 或前台运行
python main.py

首次运行会自动检测并建立 SQLite 索引(约 10–20 分钟),之后直接跳过。 若建库中途中断,下次启动会自动检测并重建。


项目结构

.
├── download_arxiv.py   # 下载 Kaggle 数据集
├── preprocess.py       # JSONL → SQLite 索引
├── tokenizer.py        # Ollama 精确 token 计数 + 分块
├── llm.py              # LLM 调用(Part 报告 + Merge 摘要)
├── main.py             # 主循环(双层 tqdm + git commit)
├── run.sh              # tmux 后台启动脚本
├── data/               # 数据目录(gitignore)
│   ├── arxiv-metadata-oai-snapshot.json
│   └── arxiv.db
└── reports/            # 生成的报告(gitignore,建议单独仓库)
    └── {year}/
        └── {date}/
            └── {category}/
                ├── part_01.md
                ├── part_02.md  # 论文多时才有
                └── summary.md

设计要点

项目 说明
数据规模 263 万篇新格式论文,2007-03-31 → 2026-05-21
过滤规则 跳过旧格式 ID(acc-phys/9411001 等 41 万条)
Token 预算 256k × 60% = 153,600 可用(预留 thinking 链开销)
分块策略 二分查找最优切分,调用 Ollama /api/tokenize 精确计数
断点续传 summary.md 已存在则跳过整个 (date, category)
输出语言 中文报告,专有名词保留英文原词
Git 粒度 每自然日一次 commit

Git Commit 格式

每个文件单独一次 commit,时间戳为论文当天的随机时刻(用于填充 GitHub 贡献图):

obs: 2007-04-02 cs.CV part 1/3
obs: 2007-04-02 cs.CV part 2/3
obs: 2007-04-02 cs.CV part 3/3
obs: 2007-04-02 cs.CV summary
obs: 2007-04-02 cs.LG part 1/1
...

注意事项

  • reports/ 体量巨大(19 年 × 每天数十个类别),建议推到独立仓库或对象存储
  • Ollama 需在本机运行,默认端口 11434
  • 生成速度取决于硬件;120B 模型建议 GPU 推理

About

Agentic arXiv monitoring pipeline that scans new papers daily, generates Chinese research briefings with local LLMs, and archives outputs automatically.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages