How ksaurabhsingh/ai_interview works
Project Type and Purpose
• This is a full-stack, Python-based web application designed to automate voice interviews.
• It provides resume upload, AI-driven question generation, text-to-speech for asking questions, speech-to-text for capturing answers, NLP-based summarization and evaluation, and finally outputs a scored Excel report.
Main Architectural Components
a. Frontend Layer
• Streamlit UI – main user interface for uploading resumes, starting interviews, viewing progress, and downloading reports.
• Flask API – serves as an internal HTTP layer (if used directly by Streamlit or external clients).
b. Backend Pipeline
• Resume Parser & RAG Module – ingests PDF/DOCX, extracts key info via Retrieval-Augmented Generation.
• Question Generator – leverages LangChain + Llama 3.2 to craft tailored interview questions.
• TTS Engine – Coqui TTS for converting text questions to audio.
• Audio I/O Module – PyAudio to play questions and record candidate responses.
• STT Engine – Silero (or equivalent) to transcribe recorded audio into text.
• Summarization & Evaluation Module – uses NLP models (Llama via Ollama) to summarize answers, score them, and generate remarks/attributes.
c. Data & Storage
• Excel Report Generator – writes candidate responses, scores, and attributes to an XLSX file.
• Logging – local file-based logging for debugging and audit trails.
d. External Services & Libraries
• LangChain & Ollama – orchestration of LLM calls.
• Coqui TTS & Silero – speech synthesis/recognition.
• Python Ecosystem – virtual environment, pip dependencies.
Component Interactions and Data Flow
• The user interacts with Streamlit UI → Streamlit sends REST/gRPC calls to Flask endpoints or invokes pipeline functions directly.
• Resume upload flows into the Resume Parser → Extracted data moves into the Question Generator.
• Generated questions are passed to the TTS Engine → Audio is played via PyAudio.
• Candidate speaks back → PyAudio records input → STT Engine transcribes audio → Text goes to Summarization & Evaluation.
• Evaluation outputs (scores, remarks) feed into the Excel Report Generator → Downloadable .xlsx.
• Throughout, each module logs activity to the Logging component.
Architectural Patterns & Principles
• Layered Architecture – clear separation between UI, API, business logic, model integration, and data persistence.
• Orchestrator/Coordinator – a central controller (Flask or a pipeline manager) sequences resume parsing, question generation, TTS/STT, and evaluation.
• Modular Design – each major function (parsing, question gen, TTS, STT, evaluation) is encapsulated in its own module or service for easy testing and replacement.