Tuned prompts with persona
This commit is contained in:
41
interview-agent/AI_MOCK_INTERVIEW_VIDEO_TRANSCRIPT_SHORT.txt
Normal file
41
interview-agent/AI_MOCK_INTERVIEW_VIDEO_TRANSCRIPT_SHORT.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
Hi, this is Danyang, and I'll walk you through my implementation of the AI Mock Interview demo using the LiveKit's multi-agent framework.
|
||||
|
||||
This demo covers two stages: self-introduction and past experience. The core implementation is inside the agent.py file. I'll briefly explain the architecture, the transition and fallback logic. Then I'll show a live demo.
|
||||
|
||||
For the first goal, I used a multi-agent structure instead of one large prompt. The first agent is SelfIntroAgent. Its only job is to greet the candidate and ask for a self-introduction. It does not ask follow-up questions or move into other topics. Once the user gives a real introduction, it passes control to the next agent. The second agent is PastExperienceAgent. This agent asks about the candidate's previous work experience, such as projects, role experience, or contributions mentioned in the first stage.
|
||||
|
||||
This structure keeps the logic clean. Each agent focuses on one stage, so the model does not need to manage a long instruction set. It also helps real-time voice performance because the prompts are smaller and more focused. The whole system still runs in one shared LiveKit session, with LiveKit Inference, gpt-4.1-mini, speech-to-text, text-to-speech, VAD, turn detection, and shared interview state.
|
||||
|
||||
One important detail is that VAD and dynamic endpointing do not decide whether the first stage is complete. They help detect speech and turn boundaries. The actual stage completion is decided by the intro_complete tool. The fallback timers are only there to guarantee progress if the normal transition does not happen.
|
||||
|
||||
For the second goal, I focused on a smooth transition between stages. The normal transition uses a LiveKit function tool called intro_complete. When the candidate finishes their introduction, SelfIntroAgent calls this tool.
|
||||
|
||||
The tool does three things. First, it marks the introduction as complete in the session state. It then creates the PastExperienceAgent. And finally copies the chat context into the next agent. By passing the context, the second agent knows what the candidate already said, so it does not ask the candidate to repeat the same information again. The handoff also returns only one transition sentence. This keeps the transition clean and avoids overlapping responses.
|
||||
|
||||
For the third goal, I added a time-based fallback inside SelfIntroAgent. This handles cases where the user stays silent, or the model does not call the transition tool.
|
||||
|
||||
There are two watchdog timers. The silence watchdog moves forward if the user stays silent for twenty seconds. The stage watchdog moves forward if the self-introduction stage reaches sixty seconds. The silence timer checks LiveKit's user_state, so if the candidate starts speaking, the timer resets and the agent does not interrupt in the middle of an answer.
|
||||
|
||||
When a fallback triggers, the agent uses a fixed transition phrase, switches to PastExperienceAgent, and cancels the old timers. I also added guard checks so if the normal tool call and a timer happen almost at the same time, only one transition happens.
|
||||
|
||||
Now let's see the demo. There are three cases.
|
||||
|
||||
First, I stay silent during the self-introduction stage. After about twenty seconds, the silence fallback moves the interview forward.
|
||||
|
||||
Second, I give a normal self-introduction. The agent calls intro_complete and hands off to PastExperienceAgent without asking me to repeat myself.
|
||||
|
||||
Third, I give a long answer for more than sixty seconds. The stage watchdog should still move the interview forward, but it waits briefly so the agent does not cut in immediately while I am talking.
|
||||
|
||||
[demo playing for about thirty seconds]
|
||||
|
||||
Looking ahead, I have four next steps.
|
||||
|
||||
First, I want to refine the prompts for smaller models like gpt-4.1-mini. Right now, the interviewer has the name Jordan. If the user stays silent, the model may confuse Jordan as the user's name, so the prompt should make the interviewer identity more explicit.
|
||||
|
||||
Second, I want to extract important hyperparameters and prompts from agent.py. This will make it easier to configure different interview personas and interview types, like a friendly resume-based interview or a more stressful interview.
|
||||
|
||||
Third, I want to test LiveKit's newer audio turn detector and compare it with the current multilingual turn detector setup.
|
||||
|
||||
Finally, I want to finish the configuration for PastExperienceAgent, because right now it can keep asking follow-up questions without a clear stopping point.
|
||||
|
||||
To wrap up, this multi-agent setup gives us a stable foundation for an AI mock interviewer. It separates the interview into clear stages, uses a clean tool-based handoff, and adds fallback timers to keep the conversation moving. From here, we can extend the same structure to more interview types and more complete workflows. And thanks for watching.
|
||||
Reference in New Issue
Block a user