# huanglianjin/ai_interview architecture

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

- Interactive diagram: https://gitdiagram.com/huanglianjin/ai_interview
- Repository: https://github.com/huanglianjin/ai_interview

## Overview

职面 AI is a full-stack interview-practice and resume-improvement product. Its main workflow takes a candidate from session setup through planned, multi-turn interview conversation to evaluation and a report; candidates can also clone sessions into live voice mode. A parallel resume workflow analyzes and optimizes a resume for a target role, then generates and saves tailored resumes. The graph preserves README-documented capabilities; unsampled backend route and graph internals limit finer call-level links.

Main entry points: [`backend/app/api/resume.py`](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/resume.py) (Resume APIs), [`backend/app/core/llms.py`](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/llms.py) (Model configuration), [`backend/app/database/base.py`](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/database/base.py) (PostgreSQL), [`web/components/InterviewArea.tsx`](https://github.com/huanglianjin/ai_interview/blob/main/web/components/InterviewArea.tsx) (Interview interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Candidate experience"]
  node_workbench["Interview workbench<br/>[page.tsx]"]
  node_interview_ui["Interview interface<br/>[InterviewArea.tsx]"]
  node_resume_ui["Resume tools<br/>[ResumeTools.tsx]"]
  node_voice_ui["Voice interface<br/>[VoiceInterview.tsx]"]
  node_voice_hook["Voice capture and playback<br/>[useVoiceChat.ts]"]
  node_frontend_store["Client state"]
end

subgraph group_interview["Interview workflows"]
  node_chat_api["Interview APIs<br/>[chat.py]"]
  node_session_api["Session APIs<br/>[sessions.py]"]
  node_interview_graph{{"Interview agent<br/>[graph.py]"}}
  node_planner["Interview planner"]
  node_voice_api["Voice stream API<br/>[voice_chat.py]"]
  node_voice_engine{{"Voice interview engine<br/>[voice_interview.py]"}}
  node_analysis["Interview analysis"]
  node_report_service["Report generation<br/>[report_service.py]"]
end

subgraph group_resume["Resume workflows"]
  node_resume_api["Resume APIs<br/>[resume.py]"]
  node_resume_analyzer{{"Resume analysis"}}
  node_resume_optimizer{{"Resume optimization"}}
  node_resume_generator{{"Resume generation"}}
  node_resume_storage["Resume storage"]
end

subgraph group_platform["Platform services"]
  node_llm_factory["Model configuration<br/>[llms.py]"]
  node_knowledge["Knowledge retrieval<br/>[rag_service.py]"]
  node_ability["Ability profiles<br/>[ability_service.py]"]
  node_review_api["Review APIs<br/>[review.py]"]
  node_review_service["Appeals and audit"]
end

subgraph group_state["Persistence"]
  node_database[("PostgreSQL<br/>[base.py]")]
  node_session_service["Session persistence<br/>[session_service.py]"]
  node_context_service["Context budgeting<br/>[context_service.py]"]
end

node_candidate(("Candidate"))
node_admin(("Administrator"))
node_llm_provider{{"Configured LLM"}}
node_voice_provider{{"Voice model service"}}

node_candidate -->|"uses"| node_workbench
node_admin -->|"reviews appeals"| node_review_api
node_workbench -->|"updates state"| node_frontend_store
node_workbench -->|"opens interview"| node_interview_ui
node_interview_ui -->|"manages sessions"| node_session_api
node_interview_ui -->|"sends turns"| node_chat_api
node_interview_ui -->|"reads state"| node_frontend_store
node_resume_ui -->|"requests resume work"| node_resume_api
node_voice_ui -->|"captures audio"| node_voice_hook
node_voice_ui -->|"streams conversation"| node_voice_api
node_voice_api -->|"dispatches"| node_voice_engine
node_voice_engine -.->|"streams audio"| node_voice_provider
node_voice_hook -->|"provides audio"| node_voice_ui
node_session_api -->|"manages sessions"| node_session_service
node_chat_api -->|"runs interview"| node_interview_graph
node_interview_graph -->|"plans questions"| node_planner
node_interview_graph -->|"requests model"| node_llm_factory
node_planner -->|"retrieves references"| node_knowledge
node_chat_api -->|"requests evaluation"| node_analysis
node_analysis -->|"builds report"| node_report_service
node_analysis -->|"updates profile"| node_ability
node_resume_api -->|"analyzes resume"| node_resume_analyzer
node_resume_api -->|"optimizes resume"| node_resume_optimizer
node_resume_api -->|"generates resume"| node_resume_generator
node_resume_api -->|"saves generated resume"| node_resume_storage
node_resume_analyzer -->|"requests model"| node_llm_factory
node_resume_optimizer -->|"requests model"| node_llm_factory
node_resume_generator -->|"requests model"| node_llm_factory
node_llm_factory -.->|"calls model"| node_llm_provider
node_interview_graph -->|"compresses history"| node_context_service
node_session_service -->|"reads and writes"| node_database
node_resume_storage -->|"reads and writes"| node_database
node_knowledge -->|"reads chunks"| node_database
node_ability -->|"reads and writes"| node_database
node_review_api -->|"handles appeals"| node_review_service
node_review_service -->|"reads and writes"| node_database

click node_workbench "https://github.com/huanglianjin/ai_interview/blob/main/web/app/page.tsx"
click node_interview_ui "https://github.com/huanglianjin/ai_interview/blob/main/web/components/InterviewArea.tsx"
click node_resume_ui "https://github.com/huanglianjin/ai_interview/blob/main/web/components/ResumeTools.tsx"
click node_voice_ui "https://github.com/huanglianjin/ai_interview/blob/main/web/components/VoiceInterview.tsx"
click node_voice_hook "https://github.com/huanglianjin/ai_interview/blob/main/web/hooks/useVoiceChat.ts"
click node_frontend_store "https://github.com/huanglianjin/ai_interview/blob/main/web/store/useInterviewStore.ts"
click node_chat_api "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/chat.py"
click node_session_api "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/sessions.py"
click node_interview_graph "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/graph.py"
click node_planner "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/interview_planner.py"
click node_voice_api "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/voice_chat.py"
click node_voice_engine "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/voice_interview.py"
click node_analysis "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/interview_analysis.py"
click node_report_service "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/report_service.py"
click node_resume_api "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/resume.py"
click node_resume_analyzer "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/resume_analyzer_graph.py"
click node_resume_optimizer "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/resume_optimizer_graph.py"
click node_resume_generator "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/resume_generation_graph.py"
click node_resume_storage "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/database/resume_generation_service.py"
click node_llm_factory "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/llms.py"
click node_knowledge "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/rag_service.py"
click node_ability "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/ability_service.py"
click node_review_api "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/review.py"
click node_review_service "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/human_review_service.py"
click node_database "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/database/base.py"
click node_session_service "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/database/session_service.py"
click node_context_service "https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/context_service.py"

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_workbench,node_interview_ui,node_resume_ui,node_voice_ui,node_voice_hook,node_frontend_store toneBlue
class node_chat_api,node_session_api,node_interview_graph,node_planner,node_voice_api,node_voice_engine,node_analysis,node_report_service toneAmber
class node_resume_api,node_resume_analyzer,node_resume_optimizer,node_resume_generator,node_resume_storage toneMint
class node_llm_factory,node_knowledge,node_ability,node_review_api,node_review_service toneRose
class node_database,node_session_service,node_context_service,node_candidate,node_admin,node_llm_provider,node_voice_provider toneIndigo
```

## Components

### Candidate experience

- [Interview workbench](https://github.com/huanglianjin/ai_interview/blob/main/web/app/page.tsx): `web/app/page.tsx`
- [Interview interface](https://github.com/huanglianjin/ai_interview/blob/main/web/components/InterviewArea.tsx): `web/components/InterviewArea.tsx`
- [Resume tools](https://github.com/huanglianjin/ai_interview/blob/main/web/components/ResumeTools.tsx): `web/components/ResumeTools.tsx`
- [Voice interface](https://github.com/huanglianjin/ai_interview/blob/main/web/components/VoiceInterview.tsx): `web/components/VoiceInterview.tsx`
- [Voice capture and playback](https://github.com/huanglianjin/ai_interview/blob/main/web/hooks/useVoiceChat.ts): `web/hooks/useVoiceChat.ts`
- [Client state](https://github.com/huanglianjin/ai_interview/blob/main/web/store/useInterviewStore.ts): `web/store/useInterviewStore.ts`

### Interview workflows

- [Interview APIs](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [Session APIs](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/sessions.py): `backend/app/api/sessions.py`
- [Interview agent](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/graph.py): `backend/app/core/graph.py`
- [Interview planner](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/interview_planner.py): `backend/app/core/interview_planner.py`
- [Voice stream API](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/voice_chat.py): `backend/app/api/voice_chat.py`
- [Voice interview engine](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/voice_interview.py): `backend/app/core/voice_interview.py`
- [Interview analysis](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/interview_analysis.py): `backend/app/core/interview_analysis.py`
- [Report generation](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/report_service.py): `backend/app/services/report_service.py`

### Resume workflows

- [Resume APIs](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/resume.py): `backend/app/api/resume.py`
- [Resume analysis](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/resume_analyzer_graph.py): `backend/app/core/resume_analyzer_graph.py`
- [Resume optimization](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/resume_optimizer_graph.py): `backend/app/core/resume_optimizer_graph.py`
- [Resume generation](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/resume_generation_graph.py): `backend/app/core/resume_generation_graph.py`
- [Resume storage](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/database/resume_generation_service.py): `backend/app/database/resume_generation_service.py`

### Platform services

- [Model configuration](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/core/llms.py): `backend/app/core/llms.py`
- [Knowledge retrieval](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/rag_service.py): `backend/app/services/rag_service.py`
- [Ability profiles](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/ability_service.py): `backend/app/services/ability_service.py`
- [Review APIs](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/api/review.py): `backend/app/api/review.py`
- [Appeals and audit](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/human_review_service.py): `backend/app/services/human_review_service.py`

### Persistence

- [PostgreSQL](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/database/base.py): `backend/app/database/base.py`
- [Session persistence](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/database/session_service.py): `backend/app/database/session_service.py`
- [Context budgeting](https://github.com/huanglianjin/ai_interview/blob/main/backend/app/services/context_service.py): `backend/app/services/context_service.py`

### Other components

- **Candidate**
- **Administrator**
- **Configured LLM**
- **Voice model service**

## Connections

- Candidate → Interview workbench: uses
- Administrator → Review APIs: reviews appeals
- Interview workbench → Client state: updates state
- Interview workbench → Interview interface: opens interview
- Interview interface → Session APIs: manages sessions
- Interview interface → Interview APIs: sends turns
- Interview interface → Client state: reads state
- Resume tools → Resume APIs: requests resume work
- Voice interface → Voice capture and playback: captures audio
- Voice interface → Voice stream API: streams conversation
- Voice stream API → Voice interview engine: dispatches
- Voice interview engine → Voice model service: streams audio
- Voice capture and playback → Voice interface: provides audio
- Session APIs → Session persistence: manages sessions
- Interview APIs → Interview agent: runs interview
- Interview agent → Interview planner: plans questions
- Interview agent → Model configuration: requests model
- Interview planner → Knowledge retrieval: retrieves references
- Interview APIs → Interview analysis: requests evaluation
- Interview analysis → Report generation: builds report
- Interview analysis → Ability profiles: updates profile
- Resume APIs → Resume analysis: analyzes resume
- Resume APIs → Resume optimization: optimizes resume
- Resume APIs → Resume generation: generates resume
- Resume APIs → Resume storage: saves generated resume
- Resume analysis → Model configuration: requests model
- Resume optimization → Model configuration: requests model
- Resume generation → Model configuration: requests model
- Model configuration → Configured LLM: calls model
- Interview agent → Context budgeting: compresses history
- Session persistence → PostgreSQL: reads and writes
- Resume storage → PostgreSQL: reads and writes
- Knowledge retrieval → PostgreSQL: reads chunks
- Ability profiles → PostgreSQL: reads and writes
- Review APIs → Appeals and audit: handles appeals
- Appeals and audit → PostgreSQL: reads and writes
