# yashy6583/the-interview-agent architecture

> Architecture diagram of the GitHub repository yashy6583/the-interview-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yashy6583/the-interview-agent
- Repository: https://github.com/yashy6583/the-interview-agent

## Overview

Horizon is an AI technical-interview and candidate-evaluation platform. Recruiters review cohort readiness, configure an interview, and candidates converse with an AI interviewer; the platform tracks topics and learning signals, flags hallucinations, and produces feedback and a hiring verdict. Candidate and curriculum views support the broader learning-readiness workflow. The frontend communicates through a shared API client; backend routes dispatch to interview logic, AI providers, and persistence. README documents voice interaction and hybrid storage, but the excerpts do not show their implementation details, so those links are documented rather than inferred from source.

Main entry points: [`frontend/src/pages/LiveInterviewPage.tsx`](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/LiveInterviewPage.tsx) (Live Interview Room), [`frontend/src/App.tsx`](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/App.tsx) (Web App Routes), [`frontend/src/services/api.ts`](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/services/api.ts) (Frontend API Client), [`backend/src/controllers/InterviewController.ts`](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/controllers/InterviewController.ts) (Interview Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_candidate["Candidate Insights"]
  node_app["Web App Routes<br/>[App.tsx]"]
  node_dashboard["Recruiter Dashboard<br/>[DashboardPage.tsx]"]
  node_candidate_profile["Candidate Profile<br/>[ProfilePage.tsx]"]
  node_curriculum_page["Skill Matrix<br/>[CurriculumPage.tsx]"]
end

subgraph group_interview["Interview Experience"]
  node_candidate_setup["Interview Setup"]
  node_live_room["Live Interview Room"]
  node_interview_state["Interview State Hook<br/>[useInterview.ts]"]
  node_interview_api["Frontend API Client<br/>[api.ts]"]
  node_interview_display["Interview Feedback Views<br/>[FeedbackReport.tsx]"]
  node_knowledge_view["Knowledge Graph View<br/>[KnowledgeGraph.tsx]"]
  node_hallucination_view["Hallucination Indicator"]
end

subgraph group_backend["Interview Services"]
  node_interview_routes["Interview API Route<br/>[interview.ts]"]
  node_interview_controller["Interview Controller"]
  node_ai_service["AI Provider Selector<br/>[AIService.ts]"]
  node_mock_provider["Mock Interview Agent<br/>[MockAIProvider.ts]"]
  node_openai_provider["OpenAI Interview Agent<br/>[OpenAIProvider.ts]"]
  node_hallucination_check["Hallucination Checker"]
  node_topic_graph["Topic Graph<br/>[TopicGraph.ts]"]
  node_system_prompt["Interview Prompt<br/>[systemPrompt.ts]"]
end

subgraph group_storage["Data and Persistence"]
  node_session_store[("Session Store")]
  node_data_routes["Candidate and Curriculum Routes<br/>[data.ts]"]
  node_curriculum_loader["Curriculum and Candidate Logic"]
  node_persistence_service["Persistence Adapter<br/>[SupabaseService.ts]"]
  node_local_database[("SQLite and Memory Store<br/>[database.ts]")]
end

node_recruiter(("Recruiter"))
node_candidate_user(("Candidate"))
node_supabase[("Supabase PostgreSQL")]
node_speech_api["Web Speech API"]

node_recruiter -->|"uses"| node_app
node_candidate_user -->|"configures interview"| node_candidate_setup
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_candidate_profile
node_app -->|"routes to"| node_curriculum_page
node_app -->|"routes to"| node_candidate_setup
node_app -->|"routes to"| node_live_room
node_dashboard -->|"fetches candidates"| node_interview_api
node_candidate_profile -->|"fetches candidate"| node_interview_api
node_curriculum_page -->|"fetches curriculum"| node_interview_api
node_candidate_setup -.->|"starts interview"| node_live_room
node_candidate_user -->|"speaks with"| node_live_room
node_live_room -->|"uses state"| node_interview_state
node_live_room -->|"renders feedback"| node_interview_display
node_live_room -->|"renders topics"| node_knowledge_view
node_live_room -->|"renders flags"| node_hallucination_view
node_interview_state -->|"starts and sends"| node_interview_api
node_interview_api -->|"posts interview"| node_interview_routes
node_interview_routes -->|"dispatches to"| node_interview_controller
node_interview_controller -->|"requests responses"| node_ai_service
node_interview_controller -->|"reads and updates"| node_session_store
node_interview_controller -->|"saves interview"| node_persistence_service
node_ai_service -->|"selects fallback"| node_mock_provider
node_ai_service -->|"selects configured"| node_openai_provider
node_mock_provider -->|"checks claims"| node_hallucination_check
node_mock_provider -->|"uses topic graph"| node_topic_graph
node_openai_provider -->|"uses prompt"| node_system_prompt
node_data_routes -->|"loads curriculum"| node_curriculum_loader
node_data_routes -->|"queries candidates"| node_persistence_service
node_persistence_service -->|"falls back and writes"| node_local_database
node_persistence_service -->|"reads and writes"| node_supabase
node_live_room -.->|"uses speech"| node_speech_api

click node_app "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/App.tsx"
click node_dashboard "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_candidate_profile "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/ProfilePage.tsx"
click node_curriculum_page "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/CurriculumPage.tsx"
click node_candidate_setup "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/StartInterviewPage.tsx"
click node_live_room "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/LiveInterviewPage.tsx"
click node_interview_state "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/hooks/useInterview.ts"
click node_interview_api "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/services/api.ts"
click node_interview_display "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/components/FeedbackReport.tsx"
click node_knowledge_view "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/components/KnowledgeGraph.tsx"
click node_hallucination_view "https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/components/HallucinationBadge.tsx"
click node_interview_routes "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/routes/interview.ts"
click node_interview_controller "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/controllers/InterviewController.ts"
click node_ai_service "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/AIService.ts"
click node_mock_provider "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/MockAIProvider.ts"
click node_openai_provider "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/OpenAIProvider.ts"
click node_hallucination_check "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/HallucinationChecker.ts"
click node_topic_graph "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/TopicGraph.ts"
click node_system_prompt "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/prompts/systemPrompt.ts"
click node_session_store "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/InterviewSessionStore.ts"
click node_data_routes "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/routes/data.ts"
click node_curriculum_loader "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/utils/curriculumLoader.ts"
click node_persistence_service "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/SupabaseService.ts"
click node_local_database "https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/db/database.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_dashboard,node_candidate_profile,node_curriculum_page toneBlue
class node_candidate_setup,node_live_room,node_interview_state,node_interview_api,node_interview_display,node_knowledge_view,node_hallucination_view,node_supabase toneAmber
class node_interview_routes,node_interview_controller,node_ai_service,node_mock_provider,node_openai_provider,node_hallucination_check,node_topic_graph,node_system_prompt,node_speech_api toneMint
class node_session_store,node_data_routes,node_curriculum_loader,node_persistence_service,node_local_database toneRose
class node_recruiter,node_candidate_user toneIndigo
```

## Components

### Candidate Insights

- [Web App Routes](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Recruiter Dashboard](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Candidate Profile](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/ProfilePage.tsx): `frontend/src/pages/ProfilePage.tsx`
- [Skill Matrix](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/CurriculumPage.tsx): `frontend/src/pages/CurriculumPage.tsx`

### Interview Experience

- [Interview Setup](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/StartInterviewPage.tsx): `frontend/src/pages/StartInterviewPage.tsx`
- [Live Interview Room](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/pages/LiveInterviewPage.tsx): `frontend/src/pages/LiveInterviewPage.tsx`
- [Interview State Hook](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/hooks/useInterview.ts): `frontend/src/hooks/useInterview.ts`
- [Frontend API Client](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Interview Feedback Views](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/components/FeedbackReport.tsx): `frontend/src/components/FeedbackReport.tsx`
- [Knowledge Graph View](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/components/KnowledgeGraph.tsx): `frontend/src/components/KnowledgeGraph.tsx`
- [Hallucination Indicator](https://github.com/yashy6583/the-interview-agent/blob/main/frontend/src/components/HallucinationBadge.tsx): `frontend/src/components/HallucinationBadge.tsx`

### Interview Services

- [Interview API Route](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/routes/interview.ts): `backend/src/routes/interview.ts`
- [Interview Controller](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/controllers/InterviewController.ts): `backend/src/controllers/InterviewController.ts`
- [AI Provider Selector](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/AIService.ts): `backend/src/services/AIService.ts`
- [Mock Interview Agent](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/MockAIProvider.ts): `backend/src/services/MockAIProvider.ts`
- [OpenAI Interview Agent](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/OpenAIProvider.ts): `backend/src/services/OpenAIProvider.ts`
- [Hallucination Checker](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/HallucinationChecker.ts): `backend/src/services/HallucinationChecker.ts`
- [Topic Graph](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/TopicGraph.ts): `backend/src/services/TopicGraph.ts`
- [Interview Prompt](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/prompts/systemPrompt.ts): `backend/src/prompts/systemPrompt.ts`

### Data and Persistence

- [Session Store](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/InterviewSessionStore.ts): `backend/src/services/InterviewSessionStore.ts`
- [Candidate and Curriculum Routes](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/routes/data.ts): `backend/src/routes/data.ts`
- [Curriculum and Candidate Logic](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/utils/curriculumLoader.ts): `backend/src/utils/curriculumLoader.ts`
- [Persistence Adapter](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/services/SupabaseService.ts): `backend/src/services/SupabaseService.ts`
- [SQLite and Memory Store](https://github.com/yashy6583/the-interview-agent/blob/main/backend/src/db/database.ts): `backend/src/db/database.ts`

### Other components

- **Recruiter**
- **Candidate**
- **Supabase PostgreSQL**
- **Web Speech API**

## Connections

- Recruiter → Web App Routes: uses (evidence: `README.md`)
- Candidate → Interview Setup: configures interview (evidence: `README.md`)
- Web App Routes → Recruiter Dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Web App Routes → Candidate Profile: routes to (evidence: `frontend/src/App.tsx`)
- Web App Routes → Skill Matrix: routes to (evidence: `frontend/src/App.tsx`)
- Web App Routes → Interview Setup: routes to (evidence: `frontend/src/App.tsx`)
- Web App Routes → Live Interview Room: routes to (evidence: `frontend/src/App.tsx`)
- Recruiter Dashboard → Frontend API Client: fetches candidates (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Candidate Profile → Frontend API Client: fetches candidate (evidence: `frontend/src/pages/ProfilePage.tsx`)
- Skill Matrix → Frontend API Client: fetches curriculum (evidence: `frontend/src/pages/CurriculumPage.tsx`)
- Interview Setup → Live Interview Room: starts interview
- Candidate → Live Interview Room: speaks with (evidence: `README.md`)
- Live Interview Room → Interview State Hook: uses state (evidence: `frontend/src/pages/LiveInterviewPage.tsx`)
- Live Interview Room → Interview Feedback Views: renders feedback (evidence: `frontend/src/pages/LiveInterviewPage.tsx`)
- Live Interview Room → Knowledge Graph View: renders topics (evidence: `frontend/src/pages/LiveInterviewPage.tsx`)
- Live Interview Room → Hallucination Indicator: renders flags (evidence: `frontend/src/pages/LiveInterviewPage.tsx`)
- Interview State Hook → Frontend API Client: starts and sends (evidence: `frontend/src/hooks/useInterview.ts`)
- Frontend API Client → Interview API Route: posts interview (evidence: `frontend/src/services/api.ts`)
- Interview API Route → Interview Controller: dispatches to (evidence: `backend/src/routes/interview.ts`)
- Interview Controller → AI Provider Selector: requests responses (evidence: `backend/src/controllers/InterviewController.ts`)
- Interview Controller → Session Store: reads and updates (evidence: `backend/src/controllers/InterviewController.ts`)
- Interview Controller → Persistence Adapter: saves interview (evidence: `backend/src/controllers/InterviewController.ts`)
- AI Provider Selector → Mock Interview Agent: selects fallback (evidence: `backend/src/services/AIService.ts`)
- AI Provider Selector → OpenAI Interview Agent: selects configured (evidence: `backend/src/services/AIService.ts`)
- Mock Interview Agent → Hallucination Checker: checks claims (evidence: `backend/src/services/MockAIProvider.ts`)
- Mock Interview Agent → Topic Graph: uses topic graph (evidence: `backend/src/services/MockAIProvider.ts`)
- OpenAI Interview Agent → Interview Prompt: uses prompt (evidence: `backend/src/services/OpenAIProvider.ts`)
- Candidate and Curriculum Routes → Curriculum and Candidate Logic: loads curriculum (evidence: `backend/src/routes/data.ts`)
- Candidate and Curriculum Routes → Persistence Adapter: queries candidates (evidence: `backend/src/routes/data.ts`)
- Persistence Adapter → SQLite and Memory Store: falls back and writes (evidence: `backend/src/services/SupabaseService.ts`)
- Persistence Adapter → Supabase PostgreSQL: reads and writes (evidence: `backend/src/services/SupabaseService.ts`)
- Live Interview Room → Web Speech API: uses speech (evidence: `README.md`)
