Flutter + Agora: Build a Voice AI Interview Coach App.

Reading interview answers in your head is easy. Saying them out loud to someone who's actually listening is the hard part, and it's the part nobody gets to practice. So I built an app that does it: an AI interviewer that talks to you in real time, on your phone, and reacts to what you say.

Flutter for the app, a small Node.js server in the middle, and Agora's Conversational AI Engine for the voice. Full build is in the video.

Why Agora, and not wiring it up myself

A voice agent is a chain: speech to text, then a language model, then text to speech, all streamed fast enough that the person on the other end doesn't give up. Building that chain yourself is a lot of plumbing before you've written a single line of your actual app. Agora's engine runs the chain for you, and you control the LLM side with your own prompt.

Two things sold me for an interview app. They say response latency can go as low as 650 ms, and the user can interrupt the AI mid-sentence, the way you'd cut in on a real person. An interviewer that talks over you or makes you wait feels broken fast.

The backend took about two minutes

Three files: .env, package.json and server.js. Agora hosts the agent, so the server mostly hands out tokens and starts and stops things.

In the Agora console you copy the App ID and App Certificate, then the customer key and secret, into your .env. Create an agent, hit publish, open the code tab and copy the pipeline ID into the same file. Don't commit that file. None of those values should ever end up inside the Flutter app.

In server.js there's a function that builds the agent's login token, one that builds a token for the user's phone (unique per user), and one that builds the system prompt. The system prompt is the interesting one, since it decides how the interviewer behaves.

The start route takes a job role and a user ID and errors out if either is missing. If they're fine, it makes a channel name, builds both tokens, asks Agora to start the agent, and sends the details back to the app. The end route takes the agent ID and channel and shuts that session down.

The Flutter side

Three packages: agora_rtc_engine for the call, http for talking to the backend, and permission_handler for the mic permission. Then one screen.

You enter a role and tap start. The app sends the role and a random user ID to the backend, and gets back the agent ID, channel, app ID and token. It creates the Agora engine with that app ID, registers an event handler so the UI follows what's happening in the call, turns audio on and joins the channel. From there you're in a room with the AI. The end button tells the backend to kill the agent session.

That's the whole app logic. The first time it ran, I realized how little code it takes to get a live voice conversation going.

Does it work?

I told it I'm a Flutter developer who wants to move into product management, and asked for basic to intermediate questions. Its first question was a generic "tell me about a product that didn't go as planned". After I explained I'm not a product manager, it reworded the question around my experience building mobile prototypes and asked again. Watch the demo at the end of the video and judge for yourself.

If you build your own, put your time into the system prompt. That's where the interviewer gets its personality, and that's what makes it worth using.

Links

Build your own version and tell me which role you tested it with. I tested product manager.

Post a Comment

Previous Post Next Post