| title | Job Hunting RAG |
|---|---|
| emoji | 🎯 |
| colorFrom | blue |
| colorTo | purple |
| sdk | docker |
| app_port | 7860 |
| pinned | false |
End-to-end Retrieval-Augmented Generation (RAG) service for job hunting. Ingest job postings, upload your resume, then ask questions and get ranked job matches with explanations.
Stack: Python 3.11, FastAPI, LangChain, Chroma (vector store), Groq (LLM, free tier), Gemini (embeddings + fallback LLM, free tier).
- Ingestion of job postings from PDF, TXT, Markdown and JSON files
- Resume upload for personalized matching
- Question answering over ingested jobs (RAG)
- Resume-to-job matching with ranked results and optional LLM explanations
- Runs fully offline in tests via deterministic fake embeddings
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # add your GROQ_API_KEY and GOOGLE_API_KEY (both free)
uvicorn job_rag.api:app --reload --app-dir srcAPI docs: http://localhost:8000/docs
docker build -t job-rag .
docker run -p 8000:8000 --env-file .env -v $(pwd)/data:/app/data job-rag| Variable | Default | Description |
|---|---|---|
GROQ_API_KEY |
(empty) | Groq API key (free at https://console.groq.com), preferred LLM |
GROQ_MODEL |
llama-3.3-70b-versatile |
Groq chat model |
GOOGLE_API_KEY |
(empty) | Google AI Studio key (free at https://aistudio.google.com/apikey), used for embeddings and as fallback LLM |
GEMINI_MODEL |
gemini-2.0-flash |
Gemini chat model (fallback LLM) |
EMBEDDING_MODEL |
gemini-embedding-001 |
Gemini embedding model |
CHROMA_DIR |
./data/chroma |
Chroma persistence directory |
COLLECTION_NAME |
job_postings |
Chroma collection name |
CHUNK_SIZE |
800 |
Chunk size (characters) |
CHUNK_OVERLAP |
120 |
Chunk overlap (characters) |
TOP_K |
5 |
Default number of retrieved chunks |
USE_FAKE_EMBEDDINGS |
false |
Use deterministic fake embeddings (dev/tests) |
Ingest job postings (JSON file with a list of postings):
curl -X POST http://localhost:8000/ingest \
-F "file=@examples/jobs.json"Ingest a single posting from PDF/TXT/MD:
curl -X POST http://localhost:8000/ingest \
-F "file=@posting.pdf" \
-F "title=Senior ML Engineer" -F "company=Acme" -F "location=Remote"Upload your resume:
curl -X POST http://localhost:8000/resume -F "file=@resume.pdf"Ask a question:
curl -X POST http://localhost:8000/query \
-H 'Content-Type: application/json' \
-d '{"question": "Which jobs best match my Python and ML experience?"}'Get ranked matches for your resume:
curl -X POST http://localhost:8000/match \
-H 'Content-Type: application/json' \
-d '{"top_k": 5, "explain": true}'[
{
"title": "Senior Python Engineer",
"company": "Acme Corp",
"location": "Remote",
"description": "We are looking for a Python engineer with ML experience..."
}
]A professional single-page web app is served at the root URL (/):
- Drag-and-drop ingestion of job postings
- Resume upload (PDF/TXT)
- Grounded Q&A with cited sources
- Ranked job matches with fit scores and optional AI explanations
Start the server and open http://localhost:8000
On every push to main, CI builds the Docker image and pushes it to the
GitLab Container Registry:
registry.gitlab.com/my-projects6853305/job-hunting-rag:latest
Run it anywhere Docker is available (VPS, Cloud Run, Fly.io, Render, etc.):
docker login registry.gitlab.com
docker run -d -p 8000:8000 \
-e GROQ_API_KEY=gsk_... \
-e GOOGLE_API_KEY=AIza... \
-v $(pwd)/data:/app/data \
registry.gitlab.com/my-projects6853305/job-hunting-rag:latestThe data/ volume persists the Chroma index and uploaded resume across restarts.
The app deploys for free to a Docker-based Hugging Face Space.
The YAML front matter at the top of this README configures the Space
(sdk: docker, app_port: 8000).
One-time setup:
- Create a free account at https://huggingface.co and create a new Space
(type: Docker, blank template), e.g.
your-username/job-hunting-rag. - Create a write access token at https://huggingface.co/settings/tokens.
- In GitLab, go to Settings > CI/CD > Variables and add:
HF_TOKEN(masked) - the write tokenHF_USERNAME- your Hugging Face usernameHF_SPACE(optional) - the Space name, defaults tojob-hunting-rag
- In the Space settings on Hugging Face, add secrets named
GROQ_API_KEY(from https://console.groq.com) andGOOGLE_API_KEY(from https://aistudio.google.com/apikey). Both have free tiers.
Every merge to main then triggers the deploy-huggingface CI job, which
pushes the code to the Space. It builds and goes live at:
https://huggingface.co/spaces/<HF_USERNAME>/job-hunting-rag
Note: free Spaces have ephemeral disk and sleep after inactivity, so the Chroma index resets when the Space restarts. Re-ingest postings after a restart, or use a hosted vector DB for persistence.
The app deploys to Cloudflare Containers: a lightweight Worker
(worker/index.js) routes all traffic to the FastAPI container defined by the
Dockerfile, configured in wrangler.jsonc.
One-time setup:
- You need a Cloudflare account with the Workers Paid plan (required for Containers).
- Create an API token at Cloudflare dashboard with the Edit Cloudflare Workers template.
- In GitLab, go to Settings > CI/CD > Variables and add (masked):
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_ID
- Set the API keys as Worker secrets (from your machine):
npm install npx wrangler secret put GROQ_API_KEY npx wrangler secret put GOOGLE_API_KEY
After that, every merge to main triggers the deploy-cloudflare CI job,
which builds the container and deploys it. Your app will be live at:
https://job-hunting-rag.<your-subdomain>.workers.dev
You can also deploy manually from your machine:
npx wrangler login
npx wrangler deployNote: Cloudflare container instances sleep after 15 minutes of inactivity and their disk is ephemeral, so the Chroma index resets when the instance recycles. For persistent production data, re-ingest on startup or point the app at a hosted vector DB.
The repo is fully portable. To launch the beta from GitHub:
- Clone and push to GitHub:
git clone https://gitlab.com/my-projects6853305/job-hunting-rag.git cd job-hunting-rag git remote add github https://github.com/<you>/job-hunting-rag.git git push github main
- Configure GitHub Actions (Settings > Secrets and variables > Actions):
- Secret
HF_TOKEN- Hugging Face write token (free) - Variable
HF_USERNAME- your Hugging Face username
- Secret
- Create the free Hugging Face Space (type: Docker, name
job-hunting-rag) and add Space secretsGROQ_API_KEYandGOOGLE_API_KEY(both free tiers). - Push to
mainon GitHub - theCI & Deployworkflow lints, tests and deploys automatically. Your beta is live athttps://huggingface.co/spaces/<HF_USERNAME>/job-hunting-rag.
Or self-host with one command on any machine with Docker:
cp .env.example .env # add free GROQ_API_KEY + GOOGLE_API_KEY
docker compose up -d # app on http://localhost:8000, data persisted in ./datapip install -r requirements-dev.txt
ruff check .
pytestTests use deterministic fake embeddings and an in-memory Chroma collection, so no API key or network access is required.