Overview
The Adaptive Interview Engine dynamically adjusts question difficulty based on real-time performance analysis. It tracks concept mastery across sessions, manages subtopic progression, and implements semantic deduplication to ensure diverse question coverage. Source Files:backend/agent/adaptive_controller.pybackend/agent/adaptive_analyzer.py
Core Architecture
AdaptiveInterviewController
Central orchestration class managing session state, difficulty progression, and mastery tracking.adaptive_controller.py:20-75
Difficulty Matrix (9-Case System)
Strict deterministic difficulty progression based on previous performance.Logic Rules
adaptive_controller.py:30-69
Difficulty Transition Table
| Question | Previous Score | Next Difficulty |
|---|---|---|
| Q1 | N/A | MEDIUM (baseline) |
| Q2 | < 0.4 | EASY (struggling) |
| Q2 | 0.4-0.7 | MEDIUM (adequate) |
| Q2 | > 0.7 | HARD (excelling) |
| Q3 | < 0.4 | EASY (needs support) |
| Q3 | 0.4-0.7 | MEDIUM (stable) |
| Q3 | > 0.7 | HARD (challenging) |
Concept Mastery Tracking
Concept Detection with Synonyms
adaptive_controller.py:77-115
Semantic Concept Matching
Fallback to embedding-based similarity when exact matching fails.adaptive_analyzer.py:29-51
Text Normalization
adaptive_analyzer.py:20-27
Subtopic Progression
SubtopicTracker
Manages exactly 3 questions per subtopic, cycling through topics continuously. Key Invariants:- Exactly 3 questions per subtopic
- Round-robin topic rotation: DBMS → OS → OOPS → DBMS
- Subtopic selection based on mastery gaps
- No subtopic repetition within same session
Session Initialization
adaptive_controller.py:117-150
Semantic Deduplication
Prevents asking semantically similar questions within the same session.Deduplication Function
Learning Velocity
Tracks rate of mastery improvement across sessions.Velocity Calculation
Velocity-Based Interventions
AdaptiveAnalyzer
Enhanced analyzer providing adaptive learning signals.Technical Keywords by Topic
adaptive_analyzer.py:56-76
Depth & Confidence Indicators
adaptive_analyzer.py:83-100
Depth Analysis
Adaptive Decision Flow
Mastery Calculation
Composite Score
Performance Metrics
Key Metrics Tracked
| Metric | Purpose | Range |
|---|---|---|
| Semantic Score | Answer relevance via embeddings | 0.0 - 1.0 |
| Keyword Score | Concept coverage | 0.0 - 1.0 |
| Depth Score | Explanation thoroughness | 0.0 - 1.0 |
| Confidence Score | Linguistic certainty | -1.0 - 1.0 |
| Mastery Level | Overall topic competence | 0.0 - 1.0 |
| Mastery Velocity | Learning rate | -1.0 - 1.0 |
Configuration
Integration Points
- RAG System: Expected answer generation (
rag.py:agentic_expected_answer()) - Question Bank: Dynamic question retrieval with difficulty filtering
- Database: Persistent mastery storage (
UserMastery,SubtopicMasterymodels) - Speech Processing: Real-time metrics for adaptive scoring