An automated agent that monitors arXiv for papers on any topics you choose. It uses a local LLM using ollama to filter papers for relevance and sends email notifications when new relevant papers are found. Fully customizable - search for papers on machine learning, physics, mathematics, or any field you're interested in!
- 🔍 Searches arXiv for papers on any topics you configure
- 🤖 Uses an LLM locally to intelligently filter papers for relevance
- 📧 Sends email notifications for new relevant papers
- 💾 Caches previously seen papers to avoid duplicate notifications
- ⏰ Can run automatically daily via macOS LaunchAgent or Linux systemd timer
Before setting up, make sure you have:
- Python 3 installed (check with
python3 --version) - Ollama installed and running
- Install from: https://ollama.ai
- The agent uses the
gemma2:2bmodel by default - Pull the model:
ollama pull gemma2:2b
- macOS or Linux (Ubuntu/Debian) (for automatic scheduling)
git clone https://github.com/aritra741/paper-flow.git
cd paper-flowpython3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtIf you want email notifications:
-
Copy the example environment file:
cp env.example .env
-
Edit
.envwith your email settings:# Open .env in your editor nano .env # or use your preferred editor
-
Fill in your email details:
USER_EMAIL: Your email addressSMTP_USERNAME: Usually the same as USER_EMAILSMTP_PASSWORD: For Gmail, use an App Password, not your regular passwordSMTP_SERVER: Defaults tosmtp.gmail.com(change if using a different provider)SMTP_PORT: Defaults to587(TLS)
Note: The agent will work without email configuration, but won't send notifications.
Run the agent manually to test:
source .venv/bin/activate # If not already activated
python3 main.pyThis will:
- Search arXiv for papers from the last 7 days
- Filter them using Ollama
- Display relevant papers
- Send email notifications if configured
To set up the agent to run automatically every day at 9:00 AM:
./setup.shThe setup script automatically detects your operating system and configures the appropriate scheduler:
- macOS: Creates a LaunchAgent
- Linux (Ubuntu/Debian): Creates a systemd timer
This will:
- Schedule daily runs at 9:00 AM
- Configure logging to
agent.log
- Check status:
launchctl list | grep arxiv - Run manually:
launchctl start com.arxiv.agent - View logs:
cat agent.log - Uninstall:
./uninstall.sh
- Check status:
systemctl --user status arxiv-agent.timer - Run manually:
systemctl --user start arxiv-agent.service - View logs:
journalctl --user -u arxiv-agent.service -f - View timer logs:
journalctl --user -u arxiv-agent.timer -f - Uninstall:
./uninstall.sh
The agent runs daily at 9:00 AM by default. To change this:
- Edit
setup.shand find the macOS section (around line 64-66):<key>Hour</key> <integer>9</integer> # Change 9 to your desired hour (0-23) <key>Minute</key> <integer>0</integer> # Change 0 to your desired minute (0-59)
- Run
./setup.shagain
- Edit
setup.shand find the Linux section (around line 150):OnCalendar=*-*-* 09:00:00 # Change 09:00:00 to your desired time (HH:MM:SS)
- Run
./setup.shagain
Alternatively, you can edit the timer file directly:
systemctl --user edit arxiv-agent.timerThen add:
[Timer]
OnCalendar=*-*-* HH:MM:00Replace HH:MM with your desired time (24-hour format).
The agent is fully customizable! Edit main.py to search for papers on any topics you want:
- Topics: Modify the
TOPICSlist (line 12-18) - change it to search for papers on machine learning, quantum computing, astrophysics, or anything else! - Max Results: Change
MAX_RESULTS(line 19) - how many papers to fetch per topic - LLM Model: Change
MODEL(line 20) - must be installed in Ollama - Days Back: Change
DAYS_BACK(line 21) - how far back to search (default: 7 days) - Verbose Mode: Set
VERBOSEtoFalse(line 22) for less output
Example: To search for papers on "quantum computing" and "neural networks", simply change the TOPICS list to:
TOPICS = [
"quantum computing",
"neural networks",
]- Search: Queries arXiv API for papers matching your configured topics
- Filter: Uses Ollama LLM to intelligently determine if papers are relevant to your interests
- Cache: Stores relevant paper IDs in
relevant_papers.txtto avoid duplicate notifications - Notify: Sends email with new relevant papers (if configured)
If you see errors about Ollama:
- Make sure Ollama is installed:
ollama --version - Make sure Ollama is running:
ollama list - Pull the required model:
ollama pull gemma2:2b
- Check that
.envfile exists and has correct values - For Gmail, make sure you're using an App Password, not your regular password
- Check
agent.logfor error messages - Test email settings manually if needed
- Check status:
launchctl list | grep arxiv - Check logs:
cat agent.log - Reload:
launchctl unload ~/Library/LaunchAgents/com.arxiv.agent.plist && launchctl load ~/Library/LaunchAgents/com.arxiv.agent.plist
- Check timer status:
systemctl --user status arxiv-agent.timer - Check service status:
systemctl --user status arxiv-agent.service - Check logs:
journalctl --user -u arxiv-agent.service -n 50 - Reload:
systemctl --user daemon-reload && systemctl --user restart arxiv-agent.timer
If you get import errors:
- Make sure virtual environment is activated:
source .venv/bin/activate - Reinstall dependencies:
pip install -r requirements.txt
main.py- Main agent scriptrequirements.txt- Python dependenciessetup.sh- Cross-platform setup script (macOS LaunchAgent / Linux systemd)uninstall.sh- Cross-platform uninstall scriptarxiv-agent.service- systemd service file template (Linux)arxiv-agent.timer- systemd timer file template (Linux)env.example- Example environment configuration.env- Your actual configuration (create from env.example)relevant_papers.txt- Cache of previously seen papersagent.log- Log file (created when running)
See LICENSE file for details.