Skip to content

Hamiltonxx/agentic-pdf-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic PDF Reader

An AI-powered PDF reader that listens, learns vocabulary, and adapts to your reading level.

一个由 AI 驱动的 PDF 朗读器,边听边积累词汇,自动适应你的阅读水平。


Features / 功能

  • TTS playback — reads PDF sentences aloud using the macOS say command 语音朗读 — 使用 macOS say 命令逐句朗读 PDF
  • AI reading agent — Claude decides when to slow down, flag vocabulary, or quiz you AI 阅读助手 — Claude 自动判断何时降速、收录生词、或发起测验
  • Vocabulary tracking — unknown words saved to SQLite, exportable to CSV (Anki-ready) 词汇积累 — 生词存入 SQLite,可导出为 CSV(兼容 Anki)
  • Configurable threshold — set your vocabulary size; only words outside it get flagged 可配置词汇阈值 — 设定你的词汇量,只收录超出范围的生词
  • Progress saving — resumes from where you left off 进度保存 — 下次从上次读到的位置继续

Requirements / 环境要求

  • Python 3.14+
  • macOS (TTS uses the built-in say command)
  • An Anthropic API key

Installation / 安装

git clone https://github.com/your-username/agentic-pdf-reader.git
cd agentic-pdf-reader
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Usage / 使用方法

export ANTHROPIC_API_KEY=your_key_here
python main.py /path/to/book.pdf

Options / 选项

--vocab-threshold N   Only flag words outside the top-N most common English words
                      只收录不在前 N 个最常用英语词汇中的生词(默认 4000)

Example / 示例

# For a learner with ~3000 word vocabulary / 适合约 3000 词汇量的学习者
python main.py book.pdf --vocab-threshold 3000

# For an advanced reader / 适合高级读者
python main.py book.pdf --vocab-threshold 8000

Controls / 操作快捷键

Key Action
space Pause / Resume
n Skip to next sentence
v Show vocabulary list
q Quit

Project Structure / 项目结构

src/
  agent.py        LLM agent loop / AI 决策模块
  pdf_parser.py   Chapter and sentence extraction / PDF 解析
  tts.py          TTS wrapper / 语音引擎封装
  vocab_store.py  SQLite vocab and progress store / 词汇与进度存储
  cli.py          CLI interface / 命令行界面
  gui.py          tkinter GUI (legacy) / 图形界面(旧版)
tests/
main.py           Entry point / 程序入口

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages