A local web application that helps researchers discover, download, and deeply interrogate academic papers. You type a research query, get back 50 scored and ranked papers from Google Scholar, download the open-access PDFs, and then ask free-form questions about them — answered by Claude using a RAG pipeline built on your downloaded papers.
- Searches Google Scholar via SerpAPI and fetches up to 50 papers in parallel.
- Each paper is scored out of 100 across four dimensions:
| Dimension | Max Score | How it works |
|---|---|---|
| Relevance | 25 | Keyword hits in title (weighted higher) and abstract snippet |
| Top venue | 25 | Checks for NeurIPS, ICML, ICLR, Nature, ACL, CVPR, and 20+ other top venues |
| Recency | 25 | Decays 2 points per year from 2026 |
| Citations | 25 | Tiered: 1 citation = 2pts, 10 = 6pts, 100 = 13pts, 1000 = 20pts, 10000 = 25pts |
- Results are displayed across 5 ranked tabs (10 papers each), highest-scoring first.
Each paper card has a Download PDF button. The server tries to find an open-access PDF through a cascade of fallback strategies:
- Direct PDF link from SerpAPI's
resourcesfield - arXiv — converts
abs/URL topdf/automatically - Semantic Scholar open-access API (free, no key needed)
- OpenAlex open-access API (free, no key needed)
- HTML page scraping — looks for
citation_pdf_urlmeta tag,.pdflinks, and download button keywords
Downloaded PDFs are saved to a downloads/ folder and are never downloaded twice — if the file already exists, it is served from disk.
Select any combination of downloaded papers and ask questions. The system uses a full Retrieval-Augmented Generation (RAG) pipeline:
- Full text extraction — PyPDF2 extracts the complete text of each PDF (no character limit).
- Intelligent chunking — Text is split by section headers first (e.g.
1. Introduction,2 Related Work). Sections longer than 500 words are further split at sentence boundaries with 100-word overlap between adjacent chunks. - Hybrid indexing — Each chunk is indexed in two ways simultaneously:
- FAISS vector index using
all-MiniLM-L6-v2sentence embeddings (cosine similarity) - BM25 keyword index for exact term matching
- FAISS vector index using
- Hybrid retrieval with RRF — For each question, both indexes are queried. Results are fused using Reciprocal Rank Fusion (RRF), combining semantic and keyword signals. The top 5 most relevant chunks are selected per paper — so every selected paper contributes equally regardless of size.
- Per-paper answers — Claude (
claude-sonnet-4-6) receives the retrieved sections and answers the question separately for each paper, with a clear heading per paper. - Index caching — The FAISS + BM25 index is cached keyed by file paths and modification times. Repeated questions on the same selection reuse the cache instantly. Downloading a new paper or changing the selection automatically triggers a rebuild.
- The Q&A panel maintains full conversation history across questions.
- History is sent to Claude on every request, allowing natural follow-up questions (e.g. "Which of those methods is most novel?", "Elaborate on that").
- If the history grows beyond ~6,000 characters (~1,500 tokens), older turns are automatically summarized using
claude-haikuto stay within context limits, while the most recent 2 turns are always kept verbatim. - Click Clear history to start a fresh conversation at any time.
RelatedWork_Researcher/
├── server.py # Flask backend — all API endpoints and RAG pipeline
├── index.html # Single-file frontend — no build step required
├── downloads/ # Downloaded PDFs (auto-created on first download)
└── .env # API keys (see setup below)
- Python 3.10+
- A SerpAPI account and API key — serpapi.com (free tier: 100 searches/month)
- An Anthropic API key — console.anthropic.com
pip install flask httpx python-dotenv anthropic PyPDF2 beautifulsoup4 \
sentence-transformers faiss-cpu numpy rank-bm25Create a file named .env in this folder:
SERP_API_KEY=your_serpapi_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here
Important: Never commit
.envto version control. It is already listed in.gitignore.
python server.pyThe server starts at http://localhost:5001.
Navigate to http://localhost:5001 in any modern browser.
- Type your research topic into the search bar (e.g.
autonomous agents LLM planning). - Click Search 50 — results appear in up to 5 tabs after a few seconds.
- Each card shows: title (linked to the paper), authors, year, venue, citation count, relevance score, and an abstract snippet.
- Switch between tabs to browse by score tier.
- Click Download PDF on any paper card.
- The button changes to Downloaded once saved.
- Papers already downloaded are automatically marked on future searches.
- Downloaded papers appear in the Downloaded Papers sidebar on the right. Click Open to view a PDF in a new tab.
Note: Only open-access papers can be downloaded. Paywalled papers will show "No open-access PDF found".
If automatic download fails (e.g. the paper is paywalled), you can download the PDF yourself and add it manually:
- Download the PDF from any source (publisher website, ResearchGate, your institution's access, etc.).
- Rename the file to something descriptive, e.g.
Attention_Is_All_You_Need.pdf. - Copy or move it into the
downloads/folder inside this project directory. - Refresh the browser — the paper will appear in the Downloaded Papers sidebar and the Papers to query checklist automatically, ready to be queried.
- In the Ask About Papers panel, check the papers you want to query. Use Select all / None to toggle all at once.
- Type your question in the text box and click Ask (or press
Enter). - Claude will return a structured answer with a heading for each selected paper.
- Ask follow-up questions freely — the assistant remembers the conversation context.
- Click Clear history to reset the conversation and start fresh.
Q: What datasets are used in these papers?
A: [Per-paper breakdown of datasets...]
Q: Which of those datasets is largest?
A: [Claude references the previous answer to compare...]
Q: What are the limitations of using that dataset?
A: [Claude understands "that dataset" from context...]
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Serves the frontend (index.html) |
POST |
/search |
Searches Google Scholar. Body: {"query": "..."} |
POST |
/download |
Downloads a PDF. Body: {"url": "...", "title": "...", "pdf_url": "..."} |
GET |
/downloads |
Lists all downloaded PDFs with metadata |
GET |
/files/<filename> |
Serves a downloaded PDF file |
POST |
/ask |
RAG Q&A. Body: {"question": "...", "files": [...], "history": [...]} |
- Embedding model:
all-MiniLM-L6-v2fromsentence-transformers— downloaded automatically on first use (~80 MB, cached locally by HuggingFace). - Chunking: Section-header regex targets academic numbering patterns (
1. Introduction,3.1 Methods). Falls back to sentence-boundary splitting. Max chunk size: 500 words. Overlap: 100 words. - RRF fusion constant:
k=60(standard default). Lower values amplify top-ranked results; higher values smooth rankings. - History summarization: Triggered when total history exceeds 6,000 characters. Uses
claude-haiku-4-5(faster, cheaper) to produce a 3–5 sentence summary of older turns. - Port conflict: macOS uses port 5000 for AirPlay. The server runs on port 5001 to avoid this.