Voice Coach (Real-Time Sales Simulator)

Role: Solo, end-to-end
Tech Stack: Node.js/Express, React, OpenAI Realtime API, WebRTC, TypeScript
Repository: Private. Demo available on request

Overview

Voice Coach is a real-time conversational AI tool for practicing sales calls. Practice objection handling, closing, and discovery against a realistic AI prospect before burning real leads.

Using OpenAI’s Realtime API over WebRTC, the system enables natural conversation with sub-500ms latency, which is what makes ā€œbarge-inā€ (interrupting the AI) and real conversational flow actually work the way they would on a real call.

The Latency Problem

Most voice assistants feel robotic because of the latency chain:

In a sales call, a 3-second pause destroys the momentum. The whole point of practice is training the muscle, and the muscle doesn’t work if the rhythm is wrong.

Solution: Peer-to-Peer WebRTC Architecture

The Dynamic Context-Aware Co-Pilot

In real sales calls, professionals have ā€œbattle cardsā€ or scripts on their desk. Voice Coach acts as a dynamic co-pilot that follows the conversation.

The Dynamic Cheatsheet listens to the transcript stream and automatically switches UI context based on keyword triggers:

// Simplified logic from client/components/App.jsx
if (/expensive|budget|cost/i.test(text)) {
    return "Objection Handling Framework"; // Auto-switch to pricing rebuttals
}
if (/agreement|sign|commit/i.test(text)) {
    return "Closing Techniques"; // Auto-switch to closing scripts
}

When the AI prospect says ā€œThat sounds great, but we don’t have the budget,ā€ the screen snaps to the Objection Handling panel with the ā€œFeel-Felt-Foundā€ framework ready to go.

Strict Scenario Injection

Generic LLMs are too agreeable to be good practice partners. To train effectively, the AI has to be difficult and realistic.

The PromptEditor constructs rigorous system instructions with detailed persona templates:

ā€œYou are Linda, the owner of Sweet Treats Bakery. You are stressed because a delivery was just canceled. You are skeptical of salespeople. Do not be polite for the sake of it.ā€

That turns the AI into a sparring partner that offers real resistance, which forces you to actually deploy the soft skills rather than glide through a compliant conversation.

Post-Game Automated Rubric

The most valuable part of training is feedback. Rather than leaving it to subjective guessing, the system provides structured evaluation.

Analytics loop:

  1. Transcript Extraction: the app compiles the full conversation history.
  2. The ā€œJudgeā€ Call: a secondary, silent LLM request evaluates the transcript against a rubric.
  3. Structured JSON Output: the model returns scores and specific evidence.

Example feedback:

Score: 2/4. Feedback: You acknowledged the price concern but moved too quickly to a discount without establishing value first.

System Architecture

graph TD
    A[User Speaks] -->|Audio Stream| B[WebRTC Connection]
    B -->|Realtime API| C[OpenAI Model]
    C -->|Response| B
    B -->|Audio Output| D[User Hears Response]

    E[Transcript Stream] -->|Keyword Detection| F[Dynamic Cheatsheet]
    F -->|Context Switch| G[React UI]

    H[Session End] -->|Full Transcript| I[Evaluation Engine]
    I -->|Structured Analysis| J[Feedback Report]

Use Cases

Tech Stack

Architecture: Mode-Based Extensibility

The codebase uses a mode-based architecture where swapping the ScenarioSelector and PromptTemplate components instantly transforms the engine from a Sales Coach into a Mock Interviewer or Negotiation Trainer.

The same real-time infrastructure serves multiple training use cases without any changes to the core WebRTC and evaluation logic.