Skip to content
RoushanKhalidPublic

About

ResumeRAG is a RAG-based resume analyzer. Upload any resume as a PDF, then ask natural-language questions such as skills, experience, education, projects, certifications and get accurate, sourced answers with no hallucination. Built for recruiters, hiring managers, and candidates who want to query resumes like a document.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

ResumeRAG

Python 3.11+ FastAPI License: MIT

Upload a resume PDF and ask anything about skills, experience, education, or summary. Answers come only from the resume.

ResumeRAG is a RAG-based (Retrieval-Augmented Generation) resume analyzer. Upload any resume as a PDF, then ask natural-language questions—skills, experience, education, projects, certifications—and get accurate, sourced answers with no hallucination. Built for recruiters, hiring managers, and candidates who want to query resumes like a document.


Table of contents


Features

Feature Description
PDF upload Upload a single resume PDF via the UI; previous data and index are cleared automatically.
Ground-truth answers Every answer is grounded only in the uploaded resume—no external knowledge or hallucination.
Structured output Answers use clear sections, bullet points, and bold labels (e.g. Skills:, Experience:).
Follow-up suggestions After each answer, the app suggests 2–3 relevant follow-up questions.
Starter questions One-click chips for common queries: summarize, list skills, experience timeline, education, key strengths.
Multilingual Ask in English or Bangla; answers follow the question language.
Markdown rendering Responses are rendered as clean HTML (lists, bold, paragraphs) in the UI.
Fresh on upload Uploading a new resume clears old PDFs and index, rebuilds from the new file, and refreshes the in-memory cache.
Startup cache clear On app startup, the RAG cache is cleared so the first request always uses the current index.

Tech stack

Layer Technology
Web FastAPI, Uvicorn
LLM Groq (Llama 3.3 70B) via langchain-groq
Embeddings Hugging Face via langchain-huggingface
Vector store FAISS (CPU), langchain-community
Documents PyPDF for PDF loading, LangChain text splitters
Env python-dotenv for .env

Prerequisites

  • Python 3.11 or 3.12
  • Groq API key — Create one (free tier available)
  • ~500 MB disk for the embedding model and FAISS index (first run downloads the model)

Quick start

git clone <your-repo-url>
cd ResumeRAG
python -m venv .venv
.venv\Scripts\activate          # Windows
# source .venv/bin/activate     # macOS/Linux
pip install -r requirements.txt
cp .env.example .env && notepad .env   # set GROQ_API_KEY
python build_index.py            # after placing a PDF in data/
python app.py

Then open http://localhost:8000, upload a resume or use one in data/, and start asking questions.


Installation

1. Clone and enter the project

git clone <your-repo-url>
cd ResumeRAG

2. Create a virtual environment

Windows (PowerShell):

python -m venv .venv
.venv\Scripts\Activate.ps1

Windows (CMD):

python -m venv .venv
.venv\Scripts\activate.bat

macOS / Linux:

python3 -m venv .venv
source .venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

This installs FastAPI, Uvicorn, LangChain, FAISS, sentence-transformers, langchain-groq, and supporting packages. The first run may download the Hugging Face embedding model (~80 MB).

4. Add a resume (for first run)

Either:

  • Option A: Place one or more PDFs in the data/ folder, then run:
    python build_index.py
  • Option B: Start the app and upload a resume via the UI (no need to run build_index.py first for that flow).

Configuration

Variable Required Description
GROQ_API_KEY Yes Your Groq API key for the LLM.

Copy the example file and edit:

cp .env.example .env

Then set GROQ_API_KEY=your_key_here in .env. Do not commit .env; it is gitignored.


Usage

Run the app

python app.py

The server starts at http://localhost:8000 with hot-reload. Open the URL in a browser.

First use

  1. If you have no index yet, upload a resume PDF using the “Upload & analyze” button.
  2. Wait for “Upload complete. Index rebuilt.”
  3. Use the starter chips or type a question (e.g. “Summarize this resume”, “List all skills”).
  4. Click suggested follow-up questions or ask new ones.

Uploading a new resume

Uploading another PDF will:

  • Remove all previous PDFs from data/
  • Remove the old FAISS index
  • Save the new PDF and rebuild the index from it only
  • Clear the in-memory RAG cache so the next question uses the new resume

Only one resume is “active” at a time.


API reference

Method Path Description
GET / Serves the ResumeRAG web UI (HTML).
POST /api/chat Send a question; returns { "answer": "...", "follow_ups": ["...", ...] }.
POST /api/upload Upload a resume PDF (multipart); replaces current data and rebuilds index.

Example: ask a question

curl -X POST http://localhost:8000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"question": "What are the key skills?"}'

Response:

{
  "answer": "**Skills:**\n- Python\n- Machine Learning\n- ...",
  "follow_ups": ["Which skills are most relevant for data science?", "Experience with Python?"]
}

Example: upload a resume

curl -X POST http://localhost:8000/api/upload \
  -F "file=@/path/to/resume.pdf"

Project structure

ResumeRAG/
├── app.py                 # FastAPI app: routes, RAG chain, in-browser UI
├── build_index.py         # CLI: build FAISS index from data/*.pdf
├── requirements.txt      # Python dependencies
├── .env.example          # Example env (copy to .env)
├── .gitignore
├── README.md
├── data/                  # Resume PDFs (gitignored except .gitkeep)
│   └── .gitkeep
├── faiss_index/          # FAISS index (gitignored; created by build_index / upload)
└── tests/
    ├── __init__.py
    └── test_rag.py       # API tests (run with server at localhost:8000)

How it works

  1. Indexing: PDFs in data/ are loaded, split into chunks (1000 chars, 200 overlap), embedded with a local Hugging Face model, and stored in a FAISS index under faiss_index/.
  2. Question: The user’s question is embedded with the same model; FAISS returns the top-k closest chunks.
  3. Answer: Those chunks are passed as context to a Groq (Llama) prompt that is instructed to answer only from the context and to format with markdown.
  4. Follow-ups: A second LLM call suggests 2–3 follow-up questions based on the question and answer.
  5. UI: The front end renders the answer markdown (bold, lists) and shows follow-up chips.

Tests

With the app running at http://localhost:8000:

python -m tests.test_rag

This sends several sample questions to /api/chat and prints answers and follow-ups. The test expects the server to be up and an index to exist (upload a resume first if needed).


Troubleshooting

Issue What to do
“Knowledge base not found” Run python build_index.py after placing a PDF in data/, or upload a resume via the UI.
“Groq API key not found” Create a .env from .env.example and set GROQ_API_KEY.
Slow first request The first request loads the embedding model and FAISS index; later requests are faster.
Wrong resume answered Upload the correct resume again; uploading clears previous data and index and rebuilds.
Import errors Ensure the virtual environment is activated and run pip install -r requirements.txt again.

License

MIT.

About

ResumeRAG is a RAG-based resume analyzer. Upload any resume as a PDF, then ask natural-language questions such as skills, experience, education, projects, certifications and get accurate, sourced answers with no hallucination. Built for recruiters, hiring managers, and candidates who want to query resumes like a document.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages