Chat with your research papers, compare them side by side, and surface the gaps nobody's addressed yet.
ResearchMate is an AI-powered research workspace built on retrieval-augmented generation (RAG). Upload a stack of PDFs and it indexes them into a searchable knowledge base you can query, compare, and interrogate — with every answer grounded in your actual sources.
- Chat with your papers — ask natural-language questions, get answers grounded in your uploaded collection with cited sources
- Paper Comparison — generate a structured side-by-side comparison (summary, methodology, strengths) across multiple papers
- Research Gap Discovery — surface unexplored directions, open problems, and future work suggestions from your collection
- Guardrails — similarity-threshold validation keeps responses grounded in the uploaded material instead of hallucinating
Each uploaded PDF moves through a RAG pipeline before it's queryable:
Upload → Extract → Chunk → Embed → Store (ChromaDB)
↓
Query → Retrieve → Rerank → Generate (Gemini) → Cite
- Extract — text is pulled from the PDF (PyMuPDF)
- Chunk — text is split into overlapping segments for retrieval
- Embed — chunks are vectorized (sentence-transformers) and stored in ChromaDB
- Retrieve & Rerank — relevant chunks are pulled for a query and reranked for relevance
- Generate — Gemini produces an answer grounded in the retrieved chunks, with citations back to source papers
| Frontend | React · TypeScript · Vite · Tailwind CSS · TanStack Query · React Router |
| Backend | FastAPI · ChromaDB · sentence-transformers · PyMuPDF · Google Gemini |
| Infra | Docker · Docker Compose |
ResearchMate/
├── frontend/ # React + TypeScript + Vite app
│ └── src/
│ ├── api/ # API client functions
│ ├── features/ # Feature modules (chat, comparison-table, pdf-upload, research-gap)
│ ├── pages/ # Route-level pages
│ └── components/ # Shared UI and layout components
├── backend/ # FastAPI app
│ └── app/
│ ├── api/v1/endpoints/ # Route handlers
│ ├── modules/ # RAG, comparison, research-gap, citation, guardrails logic
│ ├── infrastructure/ # LLM provider integration
│ └── core/ # Settings and logging
├── docker-compose.yml
├── Dockerfile.backend
└── Dockerfile.frontend
Prerequisites: Node.js 20+, Python 3.11+, a Google Gemini API key
git clone https://github.com/<your-username>/ResearchMate.git
cd ResearchMate
# Backend
cd backend
python -m venv venv && source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env # then add your GEMINI_API_KEY
uvicorn app.main:app --reload
# Frontend (in a new terminal)
cd frontend
npm install
cp .env.example .env
npm run dev- Backend:
http://localhost:8000(interactive docs at/docs) - Frontend:
http://localhost:5173
Or with Docker:
docker-compose up --buildbackend/.env
| Variable | Description | Default |
|---|---|---|
ENVIRONMENT |
Application environment mode | development |
LOG_LEVEL |
Logging verbosity | INFO |
CORS_ORIGINS |
Allowed frontend origins | ["http://localhost:5173"] |
GEMINI_API_KEY |
Google Gemini API key (required) | — |
GEMINI_MODEL |
Gemini model identifier | gemini-2.5-flash-lite |
frontend/.env
| Variable | Description | Default |
|---|---|---|
VITE_API_BASE_URL |
Base URL for the backend API | http://localhost:8000/api/v1 |
All endpoints are prefixed with /api/v1. Full interactive docs (Swagger UI) are available at /docs when the backend is running.
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /upload |
Upload PDF files |
| POST | /extract |
Extract text from uploaded PDFs |
| POST | /chunk |
Chunk extracted text |
| POST | /embed |
Generate embeddings for chunks |
| POST | /retrieve |
Retrieve relevant chunks for a query |
| POST | /rerank |
Rerank retrieved chunks |
| POST | /chat |
Chat with the active paper collection |
| POST | /citations |
Generate citations for a response |
| POST | /comparison |
Compare papers in the active collection |
| POST | /research-gap |
Identify research gaps and future work |
| POST | /guardrails |
Validate a query against guardrail thresholds |