How subodhnarayan/ai-interviewer works
Purpose and Entry Points
AI Interviewer is a local, voice-enabled technical interview application with adaptive questioning, transcript evaluation, topic plans, history, and planned coding-round support. The FastAPI server starts at backend/main.py; the browser UI is served from frontend/index.html. Primary operational entry points are the root UI and /api/health.
HTTP Application Boundary
backend/main.py owns the FastAPI application, API routing, and frontend delivery. backend/_http.py centralizes HTTP-facing support, separating request/response concerns from interview logic. The frontend is a single HTML/CSS/JavaScript client at frontend/index.html, responsible for text interaction, microphone capture, browser speech synthesis, and displaying interview progress and results.
Interview Orchestration and Session Flow
backend/interviewer.py is the core stateful interview engine. It maintains session-level data such as transcript, current question, elapsed time, difficulty progression, follow-up history, and completion state. A typical flow is: client creates/configures an interview, the engine requests an LLM-generated question, user text or transcribed speech is appended to the transcript, and the engine selects follow-ups or advances the plan. The <END_INTERVIEW> control token ends the live interview and triggers final evaluation.
Relevant paths:
• backend/interviewer.py
• backend/main.py
• backend/prompts.py
LLM and Prompt Boundary
backend/llm.py provides the swappable OpenAI-compatible model integration, allowing Groq, OpenAI, or locally hosted Ollama to be selected through environment configuration. backend/prompts.py separates interviewer behavior from final evaluator behavior: one prompt drives question/follow-up generation, while another evaluates the complete transcript and produces scoring, strengths, weaknesses, and report content. This boundary keeps provider transport independent from interview policy and output shaping.
Relevant paths:
• backend/llm.py
• backend/prompts.py
• backend/config.py
Plans, Topics, and Evaluation
Structured interview plans and topic-oriented progress are represented by backend/topics.py. These plans support preset interview packs and job-description-derived interview plans, and provide the structure against which live progress and final evaluation can be aligned. The interview engine consumes this structure to sequence or adapt questions rather than treating every session as an unstructured chat.
Relevant paths:
• backend/topics.py
• backend/interviewer.py
• backend/prompts.py
Speech, Persistence, and Execution Integrations
Speech input crosses an external transcription boundary in backend/stt.py, configured for Groq Whisper; speech output remains browser-side via the Web Speech/SpeechSynthesis API in frontend/index.html. SQLite-backed interview history is encapsulated by backend/db.py, separating durable records from active in-memory session flow. Coding-round infrastructure is isolated in backend/coding.py, backend/runner.py, and backend/piston.py, indicating a boundary for code submission, execution orchestration, and likely Piston execution-service integration.
Relevant paths:
• backend/stt.py
• backend/db.py
• backend/coding.py
• backend/runner.py
• backend/piston.py
Runtime and Configuration
The application runs on Python 3.11+ with FastAPI and Uvicorn, using dependencies declared in requirements.txt. Runtime configuration, including LLM provider URL/model/key and Whisper settings, is loaded by backend/config.py from environment values documented in .env.example. External dependencies are OpenAI-compatible LLM APIs, Groq Whisper for transcription, optional local Ollama, browser microphone APIs, browser speech synthesis, SQLite, and potentially Piston for code execution.
Main entry points: main.py FastAPI application · interviewer.py Interview engine · index.html Voice interview UI · llm.py LLM gateway
Components 17
Browser client
- Voice interview UI · Captures text and microphone input and renders progress and results.
frontend/index.html - Browser speech APIs · Provides microphone access and speech synthesis.
FastAPI backend
- FastAPI application · Serves the UI and owns API routes including health.
backend/main.py - HTTP support
backend/_http.py - Interview engine · Manages active session state, adaptive questions, transcript, and completion.
backend/interviewer.py - Interview plans · Defines preset and job-description-derived topic plans.
backend/topics.py - Interview prompts · Separates question-generation and final-evaluation instructions.
backend/prompts.py - LLM gateway · Selects an OpenAI-compatible model provider.
backend/llm.py - Speech transcription
backend/stt.py - Interview history · Stores durable interview records separately from active sessions.
backend/db.py - Coding rounds
backend/coding.py - Code runner
backend/runner.py - Piston adapter
backend/piston.py - Runtime configuration · Loads model-provider and Whisper settings.
backend/config.py
External services
- LLM provider · Groq, OpenAI, or local Ollama.
- Groq Whisper
- Piston service
Connections 19
- Voice interview UI → FastAPI application: interview and history API
- FastAPI application → Voice interview UI: serves root UI
- Voice interview UI → Browser speech APIs: microphone and spoken output
- FastAPI application → HTTP support: uses
- FastAPI application → Interview engine: creates and drives sessions
- FastAPI application → Speech transcription: transcribes recorded speech
- FastAPI application → Interview history: reads and writes records
- FastAPI application → Coding rounds: coding-round endpoints
- Interview engine → Interview plans: sequences against plan
- Interview engine → Interview prompts: question and evaluation policy
- Interview engine → LLM gateway: generates questions and report
- Interview engine → Interview history: persists completed interview
- Speech transcription → Groq Whisper: audio transcription
- Coding rounds → Code runner: submits code
- Code runner → Piston adapter: delegates execution
- Piston adapter → Piston service: execution requests
- LLM gateway → LLM provider: model requests
- Runtime configuration → LLM gateway: provider URL, model, key
- Runtime configuration → Speech transcription: Whisper settings