A hybrid stateβLLM interview simulation platform that conducts structured interviews using retrieval-augmented context, a deterministic interview controller and multiple AI agents.
Unlike typical AI interview tools that rely purely on prompts, Cognix uses a state machine and policy engine to orchestrate LLM agents and maintain a stable interview flow. The system extracts evaluation topics from job descriptions, retrieves relevant resume evidence, generates adaptive questions, evaluates answers in real time, and produces a structured post-interview report with topic-wise performance analysis.
(Short walkthrough of the interview flow, evaluation and other features)
walkthrough.mp4
β’ State-Machine Interview Engine β deterministic interview control instead of LLM-driven conversations
β’ Multi-Agent System β Uses 4 dedicated agents in sync with state machine and smart prompting
β’ Policy-based question strategy β adaptive question types based on candidate performance
β’ Retrieval-augmented context β questions grounded in resume + job description evidence
β’ Semantic evaluation pipeline β strengths/weaknesses clustered and aggregated into a final report
β’ Token-efficient prompt orchestration β selective context injection for cheaper and faster inference
β’ Stateless LLM calls β backend maintains interview state instead of the model
- Up to 100 free interviews per day using a Groq API key
- Multi-agent architecture with fast responses (~1s per turn)
- Configurable interview behavior through policies and thresholds
- Resume + job description driven questioning
- Adaptive questioning (theory / applied / depth / clarification)
- Real-time answer evaluation
- Topic-wise scoring and structured report generation
- Interview transcript and history tracking
- Modern cyber-style UI
- Dockerized environment for reproducible execution
Frontend: HTML, Jinja, CSS, JavaScript, Chart.js
Backend: Python, FastAPI, Pydantic, Scikit-learn
LLM Integration: Groq API, AutoGen
Retrieval: FAISS, Sentence Transformers, pdfplumber
Storage: SQLite
Infrastructure: Docker, Docker Compose
- Git
- Python 3.10+ (for local run)
- Docker Desktop (for Docker run)
- Groq API Key Link
> git clone <https://github.com/Priyansh143/Cognix-AI>
> cd Cognix-AIYou can run the project in two ways.
python run.pyThis will automatically:
- create a virtual environment if it does not exist
- install the required dependencies
- start the FastAPI server
- Press Ctrl + C in terminal to close.
Open the application in your browser:
http://localhost:8000Click to expand
Build the Docker image:docker build -t interview-ai .Start the application using Docker Compose:
docker compose upOpen the application in your browser:
http://localhost:8000docker compose stopTo remove the container:
docker compose downThe interview data stored in the Docker volume will remain unless the volume is removed manually.
Cognix uses a small set of specialized LLM agents instead of a single monolithic prompt.
Each agent performs a specific role in the interview pipeline.
Analyzes the job description and extracts prioritized interview topics along with relevant keywords.
These topics guide the entire interview flow and determine which resume evidence should be retrieved.
Generates interview questions based on:
- the current topic
- retrieved resume evidence
- the question strategy selected by the policy engine
- Difficulty level
- Job Role
- Subtopics covered in current topic
- history (last set of question-answer) if question strategy is 'APPLIED'
The agent focuses purely on question generation while the backend controls interview progression.
Evaluates candidate responses in real time.
Agent takes input-
- Job role
- current topic under evaluation
- question asked by the interviewer agent
- answer given by candidate
- difficulty of interview
The agent produces structured signals including:
- satisfaction score (0-1)
- confidence (high, medium, low)
- strengths
- weaknesses
These signals are used by the policy engine to determine the next interview action.
After the interview ends, this agent converts the aggregated evaluation signals into a human-readable report containing:
- Interview Summary
- Key Strengths
- Areas for Improvement
- Final Evaluation
This separation of responsibilities keeps agent focused and makes the system more predictable and token-efficient.
The interview flow is not driven by a single LLM prompt.
Instead, the system uses a hybrid LLMβState architecture that combines deterministic backend logic, retrieval, and targeted LLM calls.
-
Before the interview begins, an LLM extracts the most important interview topics from the job description.
-
The output becomes a prioritized topic list (
jd_priorities) with topic-specific keywords. -
These extracted keywords are also used to retrieve relevant resume evidence from FAISS.
For each topic:
- resume chunks are embedded and stored in FAISS
- topic keywords are used to retrieve relevant evidence
- only the most useful evidence is injected into the prompt
This keeps the interview grounded in the candidateβs actual profile and reduces unnecessary token usage.
The interview is controlled by a deterministic InterviewState object that tracks:
- current topic / JD priority
- question count per topic
- previous satisfaction score
- confidence level
- covered topics
- retrieved resume evidence
- full interview history
This prevents the interview from being guided purely by LLM behavior.
The backend decides the next question type using a policy engine.
Possible question types include:
THEORYAPPLIEDCLARIFICATIONDEPTH
The next action is selected using the previous answer quality and topic-level policy weights.
This makes the interview adaptive but still predictable and structured.
The LLM is used for language-heavy tasks:
- extracting JD topics
- generating interviewer questions
- evaluating candidate answers
The backend determines the flow, topic progression, and question strategy.
This keeps the interview stable, economical, and less dependent on unpredictable model behavior.
To minimize token usage, the system injects only the context required for the current turn:
- current JD priority
- retrieved resume evidence
- selective history when needed
- current interview state
This design allows the system to work well even with weaker or lower-cost LLMs.
flowchart TB
%% ---------------- USER ----------------
U([π€ Candidate])
%% ---------------- CONTEXT INGESTION ----------------
subgraph A["π₯ Context Ingestion"]
direction LR
JD[π Job Description]
RS[π Resume/Profile]
TE[π§ Topic Extraction LLM]
VR[π FAISS Retrieval]
JD --> TE
RS --> VR
TE --> VR
end
%% ---------------- INTERVIEW ENGINE ----------------
subgraph B["π€ Interview Reasoning Engine"]
direction LR
SM[π§ State Machine]
PE[π― Policy Engine]
QT{Question Strategy}
IL[π¬ Interviewer LLM]
SM --> PE --> QT --> IL
end
%% ---------------- INTERACTION ----------------
subgraph C["π¬ Interview Interaction"]
direction LR
Q[β Interview Question]
A1[π£ Candidate Answer]
Q --> A1
end
%% ---------------- EVALUATION ----------------
subgraph D["π Evaluation System"]
direction LR
EL[π§ Evaluator LLM]
SU[π State Update]
TR{More Topics?}
FR[π Final Report]
EL --> SU --> TR
TR -->|No| FR
end
%% FLOW
U --> JD
U --> RS
VR --> SM
IL --> Q
A1 --> EL
SU --> SM
TR -->|Yes| PE
%% STYLE
classDef user fill:#E3F2FD,stroke:#1E88E5
classDef ingest fill:#E8F5E9,stroke:#43A047
classDef reasoning fill:#F3E5F5,stroke:#8E24AA
classDef interaction fill:#FFF3E0,stroke:#FB8C00
classDef evaluation fill:#ECEFF1,stroke:#546E7A
class U user
class JD,RS,TE,VR ingest
class SM,PE,QT,IL reasoning
class Q,A1 interaction
class EL,SU,TR,FR evaluation
Click to expand
flowchart TD
A[Interview Turns Stored in SQLite]
A --> B[Load Satisfaction, Confidence, Strengths, Weaknesses]
B --> C[Confidence Weighted Scoring]
C --> D[Topic-wise Score Aggregation]
D --> E[Strength & Weakness Phrase Collection]
E --> F[Semantic Clustering<br/>Sentence-Transformer Embeddings]
F --> G[Cluster Representative Phrases]
G --> H[Top Strengths & Weaknesses Selected]
H --> I[Structured Evaluation Data]
I --> J[LLM Human-Readable Report]
J --> K[Final Interview Report Stored]
Click to expand
Click to expand
The system is organized around five main components:- User: Starts the interview, answers questions, reviews results, and opens the transcript.
- Frontend: Handles UI state, settings, interview chat, loading screens, report display, and transcript modal.
- Backend: Orchestrates session setup, state management, retrieval, question generation, answer evaluation, and persistence.
- LLM: Generates interview questions and evaluation summaries.
- Database: Stores session data, interview turns, evaluation output, and history.
Evaluation Engine is part of backend, separately shown for better understanding.
Click to expand
This diagram shows the complete interview lifecycle, from session setup to transcript review.
Click to expand
.
project-root/
βββ backend/
β βββ agents.py
β βββ analysis.py
β βββ app.py
β βββ interview_setup.py
β βββ interview_controller.py
β βββ controller_runner.py
β βββ faiss_index.py
β βββ models.py
β βββ profile_loader.py
β βββ resume_extractor.py
β βββ embeddings.py
β βββ database.py
β βββ logger.py
β
βββ frontend/
β βββ static/
β β βββ assets/
β β βββ script.js
β β βββ style.css
β βββ templates/
β β βββ index.html
β
βββ data/
β βββ uploads/
β βββ interviews.db
β βββ profile.json
|
βββ .env
βββ docker-compose.yml
βββ Dockerfile
βββ requirements.txt
βββ run.py
βββ .gitignore
βββ .dockerignore
βββ config.yaml
βββ README.md
βββ LICENSE
Click to expand
WEBSOCKET /ws/interview/{session_id}
POST /setup
POST /profile
POST /api_key
GET /evaluation/{sessionId}
GET /evaluation-nollm/{sessionId}
GET /transcript/{sessionId}
GET /interviews
GET /profile
GET /config
Responsibilities:
WEBSOCKET /ws/interview/{session_id}β Run the interview session.POST /setupβ initialize interview settings and session dataPOST /profileβ saves profile changes.POST /api_keyβ Saves api key persistently.GET /evaluation/{sessionId}β fetch the final report with LLM outputGET /evaluation-nollm/{sessionId}β fetch the final report without LLMGET /transcript/{sessionId}β fetch interview transcript dataGET /interviewsβ fetch interviews table to view past interviews.GET /profileβ fetch user profile.GET /configβ fetch default configs.
- Deployed Web-Application
- Voice enabled interviews using TTS-STT models.
- Additional interviewer states and policies
- More types of interviews (Eg- Technical, aptitude, cultural fit, etc)
- Camera enabled interview with timer.
- Expanded admin or history dashboard
- User's overall skill tracking and analysis
- Exportable PDF report
- The project depends on external LLM responses from groq.
- Evaluation quality may vary based on model output.
- The retrieval quality depends on the resume/profile data provided.
Contributions are welcome.
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Open a pull request.
This project is licensed under the MIT License.
See the LICENSE file for details.








