sudhirshivaram/scientific-papers-curator
Scientific Paper Curator
A source-cited research assistant for recent arXiv Computation and Language (cs.CL) papers. It retrieves from a curated corpus of 50 paper titles, abstracts, authors, publication dates, and PDF links, then uses Gemini to answer only from that retrieved context.
This repository contains the development project. scripts/export_hf_space.py --build-index produces the small, allow-listed Hugging Face Space bundle; it intentionally excludes notebooks and legacy-production/.
Live application
Live demo: sudhirshivaram/scientific-papers-curator
How it works
Question + optional publication-date filter
│
query embedding + BM25 keyword search
│
reciprocal-rank fusion over arXiv papers
│
Gemini answer streamed with paper citationsThe corpus is intentionally abstract-level. The app can explain what a paper’s title and abstract support; it does not claim to answer details found only in the PDF body, figures, tables, or appendices.
Features and certification evidence
- Domain-specific RAG: answers are grounded in a 200-paper arXiv
cs.CLcorpus and include title, arXiv ID, and PDF link citations. - Hybrid retrieval: FAISS dense retrieval and BM25 keyword retrieval are fused with reciprocal-rank fusion.
- Streaming responses: Gemini output is yielded progressively in the Gradio chat interface.
- Multi-turn chat memory: follow-up questions are condensed into standalone retrieval queries using recent conversation context.
- RAG evaluation: a deterministic 10-question evaluation set measured retrieval from Hit Rate
0.60at top-1 to1.00at top-5 for the five-paper notebook baseline. - Reranking experiments: the local cross-encoder improved top-3 Hit Rate from
0.70to0.80; LLM-as-judge reranking improved it from0.70to0.90and MRR from0.650to0.717on that same 10-question baseline. - Metadata filtering: users can restrict retrieval to papers published on or after an ISO date; both dense and BM25 retrieval operate over the selected subset.
The notebook evidence lives under notebooks/paper_curator/ in the development project and is not copied into the public Space bundle.
Cost and privacy
The deployed Space currently uses Hugging Face ZeroGPU because that is the available free hosting tier for this account. It requests a short GPU session only while a chat request is handled; Gemini still performs generation and FAISS retrieval remains local. There is no paid vector database, hosted embedding API, or local Ollama model in the Space. ZeroGPU usage details
The only required key is a Google Gemini API key, supplied by each user directly in the UI. The app does not read it from .env, write it to disk, or store it server-side. Gemini usage is governed by the user’s Google account and can be kept within a $0.50 experiment budget using a low-volume/free-tier key.
Run locally
Development and notebooks
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
python scripts/ingest_papers.py --force-reembed
python app.pyconfig/config.yaml deliberately uses five papers for fast notebook iteration. Local notebook generation requires Ollama and the model named in that configuration.
Build the deployable Space bundle
pip install -r requirements-dev.txt
python scripts/export_hf_space.py --build-indexThis creates build/huggingface-space/ with the configured 50-paper cache, validates the Space startup path, and contains exactly the files to upload to a new Gradio Space:
app.py
README.md
requirements.txt
src/
config/
data/Create a public Gradio Space, then upload the contents of that generated directory. Each Space commit rebuilds the application automatically. Hugging Face Gradio Space guide
Project structure
src/ RAG ingestion, retrieval, generation, and chat code
config/config.yaml 5-paper notebook profile
config/huggingface.yaml 50-paper initial deployment profile
notebooks/paper_curator/ Measured RAG learning and evaluation artifacts
scripts/export_hf_space.py Creates the allow-listed Space bundle
scripts/hf_preflight.py Validates the generated bundle before upload
legacy-production/ Preserved earlier FastAPI/Railway system; not deployedRequired key
No arXiv, Hugging Face, embedding, database, or Ollama key is required by the deployed application.
