How abdelrahman-elshahed/hiring_system_using_rag works
Project Type and Purpose
• This is a full-stack, Python-based recruiting/hiring system built around Retrieval-Augmented Generation (RAG).
• Purpose: present job requirements, ingest candidate info (CVs/applications), index candidate data, perform semantic search/ranking, and generate summaries or next-step recommendations using a language model.
File Structure
Top-Level Directories and Files:
• api/
– api/api.py: REST-style endpoints (e.g., submit CV, query candidates, generate responses).
• app/
– streamlit_app.py: the Streamlit UI front end.
• src/
– chat.py: handles chat interactions with the language model.
– vector_db.py: wraps FAISS vector index operations (load/index/search).
– text_chunking.py, text_processing.py: preprocess and split text for embedding.
– cv_management.py: ingest CVs into index, maintain metadata.
– ranking.py: score and rank candidates.
• db/
– cv_index.faiss: the FAISS vector index file.
– cv_metadata.pkl: serialized metadata (CV IDs, file paths, attributes).
• templates/
– job_application.html: Jinja2/HTML template for application UI (used by Streamlit or API).
• jobs/
– job_template_generator.py: generates new job requirement templates (likely based on a PDF or prompt).
• config/
– config/config.py: configuration (API keys, DB paths, model names).
• main.py & run_app.py: orchestration entrypoints (choose API server vs. interactive UI).
README
• README only gives the title “Hiring_System_Using_RAG.”
a. Components to include:
1. Frontend (Streamlit UI)
2. API Layer (Flask/FastAPI endpoints in api/api.py)
3. RAG Pipeline (chat.py + vector_db.py + text_*.py + ranking.py)
4. Vector Database (FAISS index + metadata in db/)
5. Job Template Generator (jobs/job_template_generator.py)
6. Configuration Module (config/config.py)
7. Data Storage (applications/*.json, CV files, PDFs)
8. External LLM Service (OpenAI or similar)
b. Relationships & Data Flow:
• Frontend ↔ API Layer: user clicks “submit CV” or “search,” Streamlit makes REST calls to api/api.py.
• API Layer → RAG Pipeline: invokes src/ modules to process text, chunk & embed, query FAISS, rank results, invoke chat with LLM.
• RAG Pipeline → Vector DB: vector_db.py loads or updates cv_index.faiss and cv_metadata.pkl.
• Job Template Generator reads/writes templates and can be exposed via API or CLI.
• Configuration is imported wherever needed (database paths, API keys).
• Results (ranked candidate list, summaries) are returned from API to Frontend.
c. Architectural Patterns & Principles:
• Layered architecture: Presentation (Streamlit), API/Controller, Service (RAG pipeline), Data Access (FAISS + file I/O).
• Modular design: each src/*.py is a single responsibility.
• Separation of concerns: config in one module, data in db/, templates in templates/.