The first time we seriously built an AI interviewer, our team poured almost all its effort into the prompt: how to make the model’s follow-up questions feel more human, how to make scoring closer to that of a senior interviewer. In the first week after launch, however, the most common complaint was not “it asks bad questions,” but “after I finish a sentence, it takes three seconds to reply.”
Those three seconds made me realize that an AI interviewer is essentially not a model product, but a real-time system. Within a 20-to-40-minute window, it has to simultaneously handle five things—speaking, listening, judging, scoring, and archiving—and if any one link stalls, what the candidate feels is “this AI is dumb.”
Later I split the entire system into five parts: the interview robot, standard dialogue capabilities, the interview LLM, the digital human, and the multimedia pipeline center. Only after the split could many problems that had previously been mixed together be told apart.
The interview LLM: only follow-up questions and scoring
At first we had the model “host the interview,” and the result was terrible. It would take the liberty of skipping questions, chat with the candidate about industry gossip, and suddenly throw out a harder question when the candidate was nervous. By the end of a 20-minute interview, only two questions from the script had been covered.
Later I narrowed the LLM’s authority to an extremely limited scope, leaving only two actions: follow-up questions and scoring. A follow-up question means judging whether there is a point worth digging into in what the candidate just said, and if so, generating one follow-up question; scoring means assigning dimension scores to that question according to the scoring rubric and pointing out the evidence. Flow control is never given to the model.
Every time it outputs a structured object with these fixed fields: action, question, reason, evidence, score_delta, confidence. action has only three values: follow_up, next, close. The model cannot decide on its own to change questions, nor can it decide to end the interview; it can only “suggest,” and the robot state machine approves. evidence must bring back the original-text timestamp and quotation, while confidence is left for the later review queue.
Three constraints must be added to follow-up questions; otherwise the model will keep following up until it drifts off topic.
- Layer cap: at most two follow-up layers per question, and the third layer is forced to move on to the next question;
- Anchor constraint: the script writes 2–4 required elements for each question, and the model may only follow up on uncovered elements, not improvise freely;
- Schema validation plus fallback: if the JSON is invalid or fields are missing, retry once; if it still fails, directly use the backup follow-up question preset in the script.
Scoring is harder than follow-up questions. When several human interviewers score the same answer, the score gap can reach 20%, so expecting the model to score accurately in one pass is unrealistic. Our approach is to split scoring into 3–5 dimensions (structure, depth, evidence, expression), score each dimension separately and attach the original-text timestamp; the model outputs confidence, questions below the threshold are marked and enter the manual review queue; online we look at “consistency with human scoring,” not “average score difference.” If consistency drops, it means the prompt or the rubric needs to be changed.
The interview robot: the script is the skeleton, the state machine is the joints
If the LLM is the mouth, the robot is the skeleton.
Its input is a question script, a structured document written in a DSL, not a piece of prose. The script must contain at least the stages, time boxes, questions, required elements, preset backup follow-up questions, follow-up caps, and weights. For example, a project deep-dive question will clearly specify stage, timebox, must_cover, followups, max_followups, and weight. These fields look rigid, but only rigidity makes the flow stable.
What the robot runs on top of this is a three-layer state machine:
| Layer | State | Event |
|---|---|---|
| Session | Preparing / In progress / Paused / Ended | Joining the room, reconnecting after disconnection, time up, candidate actively exits |
| Stage | Entry / Self-introduction / Project deep dive / Professional questions / Candidate questions | Stage timeout, required elements covered |
| Question | Asking / Listening / Following up / Closed | Candidate starts speaking, silence timeout, follow-up questions exhausted, answer time up |
With this state machine, questions like “has the candidate finished speaking?” have a place to be answered. If there is 2.5 seconds of silence and ASR gives a final result, it is judged as “finished speaking”; if there is 6 seconds of silence and no final result, it is judged as “possibly stuck,” and an encouraging prompt is given first; only after 12 seconds of silence is skipping allowed.
The most important design principle here is: the communication flow and the evaluation flow must be separated. Communication is synchronous, and the hard metric is first-response latency: from when the candidate finishes speaking to when they hear the first response, P90 must be kept under 1.5 seconds. Evaluation is asynchronous; during the interview only lightweight quick evaluation is done, enough to judge whether a follow-up is needed; full scoring, report generation, and dimension aggregation all run after the interview ends. Early on we stuffed full evaluation into the dialogue, adding 2–3 seconds of waiting per question, and what the candidate felt was “this AI responds very slowly.” After the split, first-response latency immediately looked good, and evaluation quality did not drop.
Standard dialogue capabilities: packaging communication and evaluation together
The rule above—“communication synchronous, evaluation asynchronous”—is actually hard to implement in code. Because the communication style and evaluation style of a dialogue segment are tightly bound. “May I ask, are you Zhang San?” can only appear in personnel confirmation, the tone must be light, and it cannot be scored; “Hello~ hello~ can you hear me” can only appear in environment confirmation, and if there is no response after three tries, it should prompt reconnection rather than judge the candidate as incompetent; a question like “What is the relationship between Zhang San and Li Si” can only appear in ability assessment and must be scored according to the rubric.
If these three segments are placed in the same flow engine, a pile of if stage == 'confirm_identity': ... elif stage == 'env_check': ... will be written. Every time a scenario is added, such as “script drill” for customer service roles or “written test explanation” for campus recruitment, these branches grow another layer.
So we inserted a layer of standard dialogue capabilities between the robot and the LLM: one capability equals one dialogue purpose, a fixed communication style, and the corresponding evaluation style, packaged into a unified interface. The interview robot degenerates into an orchestrator, responsible only for deciding which capability to run now and when to switch to the next one.
The interface is not complicated; the core is four methods and a few declaration fields: opening handles the opening, on_candidate decides the next action, evaluate returns the evaluation result, and is_done determines whether this dialogue segment is over; purpose, tone, and need_eval hard-code the dialogue purpose, tone, and whether to evaluate. For communication-only capabilities, need_eval is False, and evaluate() returns None.
The five capabilities we have accumulated basically cover all stages of a first-round interview except “chatting about technical details”:
| Dialogue capability | Description | Characteristics | Dialogue example |
|---|---|---|---|
| Identity confirmation | Confirm through communication whether the candidate is the interviewee | Confirm only, no evaluation | Interviewer: Hello, are you Zhang San? Candidate: Yes, who is this? Interviewer: I’m the interviewer for the cloud customer service position. |
| Environment check | Confirm through communication whether the communication environment is smooth | Confirm only, no evaluation | Interviewer: Hello~ hello~ can you hear me? Candidate: I can hear you, can you hear me? Interviewer: Yes, I can hear you too. |
| Information collection | Collect information such as name and graduating institution | Collect only, no evaluation | Interviewer: What is your educational background? Candidate: I have a bachelor’s degree. |
| Competency assessment | Assess candidate competency through communication | Communication plus evaluation | Interviewer: Zhang San is Li Si’s older brother. Li Si has two daughters, one of whom is already married. If Li Si holds a family gathering and invites family members, at least how many people will attend? Candidate: Is it 3? |
| Job introduction | Introduce job details to the candidate | Introduce only, no evaluation; supports QA reversal | Interviewer: The cloud customer service online position mainly involves resolving customer issues through online chat tools… Candidate: What does “online” mean? Interviewer: It’s a software similar to WeChat for communicating with users. |
An interview is a chain of these capabilities: identity confirmation → environment check → information collection → job introduction → competency assessment (multiple rounds, weighted by script).
Putting “communicate only, no evaluation” capabilities into the same interface felt awkward at first: evaluate() returns None, and need_eval=False looks like a broken field. But the benefits quickly showed. Binding communication and evaluation together actually made development simpler: whoever writes “identity confirmation” doesn’t need to care what the scoring rubric looks like, nor know what minute the robot is at; and changing the scoring dimensions of competency assessment doesn’t touch identity confirmation. Once the interface was unified, a new capability only needed to implement those four methods, with zero changes on the robot side. We later added “salary expectation communication” and “start date confirmation,” each in under two days. The same “information collection” is also the same code across three business lines—campus recruiting, social recruiting, and customer service—with differences only in the field list passed in from the script.
A few details we had to handle
QA reversal. Job introduction is the only bidirectional capability: the candidate may interject with questions at any time. So besides on_candidate, the interface also needs a on_question branch, letting the capability decide for itself “is this an answer or a question.” We didn’t do this in the first version, so when a candidate asked “what does online mean,” the robot treated it as “done listening, continue,” and jumped straight to the next section—a very poor experience.
A capability stack, not a one-way chain. If the candidate says mid-interview “I’m on a high-speed train, the signal isn’t great,” the system should temporarily fall back to environment check, then return to the original question after handling it. So the orchestrator maintains a stack: push(环境确认), and after finishing, pop continues the original question, preserving the original question’s follow-up depth and covered elements.
Context must be explicitly declared. Data passing between capabilities goes only through ctx, and each capability declares what it reads and writes. For example, identity confirmation declares reads: [candidate_name, resume_id], writes: [identity_verified, identity_confidence]. If you read non-agreed fields from ctx without declaring them, three weeks later nobody knows where the education background in “information collection” came from.
Boundaries are cut by “dialogue purpose,” not by technical module. We tried splitting capabilities by “voice interaction” and “text Q&A,” and it quickly got messy, because a single competency assessment involves both voice and text. After cutting by purpose, purely technical steps like “environment check” actually became stable, because they have a clear endpoint: if you can hear, it’s done.
Digital human: not a face, but the rhythm of transitions between turns
The digital human is the easiest part to get wrong. The team’s first version spent two months on 3D modeling and lip-sync alignment, and the feedback after launch was “looks expensive, but like she’s reading from a script.”
The problem isn’t the face, it’s the rhythm. Most of the information a candidate gets in an interview isn’t the text content, but “is she listening to me”: when I’m speaking, is she looking at me, is she nodding; when I stop, does she immediately respond—too fast feels like interrupting, too slow feels like a dropped connection; when she asks a question, do her pace and pauses feel like a real person organizing their thoughts.
So what really needs polishing is a few states, not model precision:
| State | Trigger | Behavior |
|---|---|---|
| Listening | Detects the candidate speaking continuously | Slight nodding, gaze held, no lip-sync |
| Thinking | Final received, waiting for model response | Eyes slightly averted, pause of about 1 second |
| Speaking | TTS audio arrives | Lip-sync driven plus a few gestures |
| Idle | No input for a long time | Returns to sitting still, avoiding the pressure of “staring at you” |
There are two engineering details: pre-synthesizing the first sentence—opening lines and fixed transitions are synthesized ahead of time so they don’t occupy the real-time path; and sentence-by-sentence streaming synthesis—the model first produces the full text of the question, which is then split by sentence for TTS, with playback starting as soon as the first sentence is synthesized and the rest synthesized while playing.
Voice is a product decision, not a technical one. The same interview can’t switch voices midway; the speaking rate should be slightly slower than everyday conversation, about 4.5 characters per second; and the accent should match the target candidate group. These adjustments cost nothing, and the perceived benefit is much greater than switching models.
Multimedia pipeline hub: connecting the three ends
This looks like the least conspicuous part, but it’s the only module where “if it goes down, everything goes down.” It connects three completely different peers: the C-end candidate’s browser or phone, the robot’s event stream, and the digital human’s rendering and streaming.
A typical real-time pipeline looks like this: candidate microphone → WebRTC (Opus / FEC / jitter buffer) → server-side VAD (detects speech start and end) → streaming ASR (partial → final, with timestamps) → robot orchestrator (decides which capability to run at this moment) → interview LLM (follow-up or quick evaluation) → TTS (sentence-by-sentence streaming synthesis) → digital human rendering (lip-sync, expression, posture) → WebRTC streaming back to the candidate.
What’s really hard on this pipeline is “interruption” and “weak network,” not “connectivity.”
- Barge-in: the candidate starts speaking before the AI finishes; the pipeline must stop TTS playback within 200ms, clear the pending playback queue, switch the state back to listening, and record the already-played text into context to avoid repetition in the next turn;
- Echo cancellation: without AEC, the digital human’s voice gets picked up by itself, and the ASR transcript is full of its own lines;
- Weak-network degradation: when packet loss exceeds a threshold, fall back from full-duplex to half-duplex—play first, then listen—and clearly show “weak network” in the UI, rather than making the candidate talk to a silent avatar;
- Reconnection: snapshot the session state every 5 seconds, and restore from the snapshot after reconnecting—never start the self-introduction over again.
There’s also an easily overlooked bypass: dual-track recording, full timestamped transcripts, and key event logs. These aren’t just for retrospectives. Score appeals, compliance audits, and training corpora for model iteration all come from this bypass. Without it, when the AI interviewer has a problem, you can’t even reconstruct “what she actually heard at the time.”
Technical Big Picture
Putting the five pieces together, it looks roughly like this: the candidate side connects through the multimedia link center; audio and events flow into the real-time dialogue stream on one path and into the interview bot on another; the bot handles orchestration and the state machine, dispatches standard dialogue capabilities downward, and below that sits the interview LLM. The digital human hangs off the bot, taking actions and lines, and is responsible for appearance, voice, and lip sync. The model only does synchronous follow-up questions and asynchronous evaluation; full scoring, reports, the human review queue, and model consistency metrics all go through the evaluation stream. The bypass separately records dual-track audio, timestamped transcripts, and event logs for retrospectives, appeals, compliance, and training corpora.
flowchart LR
subgraph C["候选人端"]
direction LR
A[麦克风与摄像头] --> B[WebRTC]
end
subgraph L["多媒体链路"]
direction LR
V[VAD 与打断] --> S[流式 ASR]
T[按句 TTS] --> D[数字人渲染]
end
subgraph R["面试机器人"]
direction LR
SM[三层状态机] --> O[能力编排]
end
subgraph E["模型与评估"]
direction LR
M[追问与快评] --> Q[异步评估]
end
B --> V
S --> SM
O --> M
M --> T
D --> B
Q --> P[(报告与人工复核)]The most direct change from adding this layer: the interview bot goes from “a service with a hardcoded interview flow” to “a container that assembles capabilities, manages state, and handles real-time performance.” The former requires code changes for every new business scenario; the latter just swaps the script and capability list.
The three streams have completely different time scales, which dictates that they must be three separate mechanisms:
| Stream | Time scale | Failure tolerance | Key metrics |
|---|---|---|---|
| Real-time dialogue stream | Milliseconds | Near zero | First-response latency P90, interruption response |
| Evaluation stream | Seconds to minutes | Retryable, can be rerun offline | Consistency with human scoring |
| Archive stream | Post-interview | Must be complete, cannot be lost | Recording completeness rate, transcript coverage rate |
Mixing these three streams into one service is the most common architectural mistake I’ve seen in this system.
Three Pitfalls I’ve Fallen Into
The first pitfall is letting the model decide the flow. The symptom is the interview going off track and time allocation spiraling out of control. The fix is to take flow control back into the state machine, with the model only outputting suggested actions.
The second pitfall is doing evaluation and dialogue synchronously. The symptom is 2–3 extra seconds per question, and the candidate thinks the connection dropped. The fix is to only make light judgments like “should we follow up” during dialogue, and run full scoring asynchronously.
The third pitfall is building the digital human’s face before its rhythm. The symptom is good-looking but fake. The fix is to first build the listening state, thinking state, and pauses, then go back and optimize lip sync and expressions.
One more thing that isn’t quite a pitfall but is worth noting: standardized interfaces always come with “the cost of tidiness.” Fields like need_eval=False look redundant, but compared to making every business line write its own set of flow branches, that redundancy is far cheaper. If I had to name one principle, it’s this: slice interfaces by “dialogue purpose,” not by technical module.
What Counts as Working
When I judge whether this system is usable now, I only look at four numbers.
First-response latency P90 under 1.5 seconds, interruption response under 300ms. Below that threshold, candidates will feel “the AI is dumb.” Follow-up hit rate: of the follow-up questions, how many would a human interviewer also ask—sample 100 for human annotation. Scoring consistency: the correlation between model scores and human scores; if it drops, go back and revise the rubric. Single-session completion rate and appeal rate—what really determines whether this thing can replace a round of initial interviews is these two numbers, not rankings on a model leaderboard.
The AI interviewer product looks like several modules stitched together, but the real center of gravity is the link in the middle: the model sets the ceiling, the link sets the floor. And candidates only remember the floor.
Comments