Voice agents and chatbots, built for production.

Streaming speech, natural turn-taking, interruptions and model failover, with every turn traced and measured. Built on 3.5+ years of production backend work, now at Justdial.

  • Barge-in
  • Turn detection
  • LLM failover
  • Tracing and metrics
Email me
AI Bestie
You

Help me unwind after a long day.

Reply

Let’s make the next five minutes easy. Put your phone down, take a slow breath, and get a glass of water.

  1. Speech to textWeb Speech
  2. End of turn1.6 s silence
  3. First tokenGemini
  4. First audioFish Audio
  5. SpeakingStreamed

  • 3.5+years of production backend work
  • 120K+leads a day through my Kafka pipeline
  • 10+services behind my API gateway
  • 26 msserver overhead per voice turn, under load

In every agent

What I handle in production

The parts of a voice agent you only notice when they break, and how I handle each one.

  • Barge-in

    Talk over the agent and it stops mid-word. The words it never said are dropped from the reply.

  • Turn detection

    A turn ends after 1.6 s of silence, or 2.4 s when the sentence sounds unfinished.

  • LLM failover

    No first token after 2 s? A backup model starts too, and whichever answers first wins.

  • Turn tracing

    Speech to text, end of turn, first token, first audio: every stage of every turn is timed.

  • Load tested

    100 concurrent voice users with 0 errors, and the server adds 26 ms to a turn. Providers were mocked.

  • Structured logs

    One JSON line per event, joined into a timeline for each voice turn, so a bad call can be replayed.

Projects

Two products I built to learn voice and retrieval

AI Bestie: A voice companion with two personalities.

Same question, different company: what changes when you ask a friend instead of a mentor?

  • SSE streaming
  • Barge-in
  • LLM failover
  • Turn tracing
  • Load tested
View source

Text chat. Sam’s reply streamed in over SSE while it was generated.

AI Bestie text chat: Sam, the Friend persona, replies to a message about a stressful day at work

Vaidya Assist: From a health question to a booked doctor.

An AI healthcare assistant that answers health questions, helps people find doctors and books appointments. It retrieves relevant context before an LLM answers.

Question Retrieve context LLM answer Book a doctor

  • RAG
  • LLM APIs
  • Doctor search
  • Booking

Dashboard. The next appointment and profile status come from the patient portal API.

Vaidya patient dashboard showing the next appointment with Dr. Rajesh Sharma on December 1

Work

Backend systems in production

At Justdial, I designed and owned the backend integration for a third-party WebRTC calling service. These four cases cover my work at Justdial and Mypcot Infotech.

Justdial

Kafka lead pipeline

120K+leads processed daily

I built the consumer pipeline that delivers lead data to communication, appointment and database services.

My part
Justdial’s database team publishes new lead data to Kafka. I built the consumer pipeline that processes it and passes each lead on.
Result
Around 120K to 130K leads a day, about 10K per city. Consumer lag builds while a batch is processed and drains back to zero once it is done.

Justdial

Node.js API gateway

10+services on one gateway

I built the Node.js and Express gateway that routes requests across Justdial’s backend services.

Justdial

Redis caching

35%lower peak API response time

I added Redis caching and load balancing to Justdial’s IRO platform. Service logs showed faster responses during peak traffic.

Mypcot Infotech

Monolith split into 4 ECS services

4independently deployed services

I led a four-person team through a monolith migration at Mypcot Infotech. We deployed four services independently.

Problem
The client asked for the split. As the project grew, the monolith became hard to maintain, and a failure in one part could not be allowed to break the whole system.
My part
I worked with a third-party consultant to design the target architecture from the start, and led the migration. We built it around a shared database and the saga pattern.
Result
Independent deployments and better service isolation.

About

Pragnesh Prajapati

I’m an SDE 1 at Justdial in Bengaluru with 3.5+ years of backend engineering experience. I’m focusing my next role on voice agents and the real-time systems behind them.

  • TypeScript
  • Node.js
  • WebRTC
  • Kafka
  • Redis
  • AWS

Career history

  1. Justdial

    SDE 1 · Bengaluru

    • Built the centralized API gateway and the Kafka lead pipeline.
    • Added Redis caching to the IRO platform and automated error monitoring.
    • Designed and integrated WebRTC calling, owning the backend end to end.
  2. Mypcot InfotechMay 2024–Dec 2025

    Software Engineer · Mumbai

    • Led the monolith-to-microservices migration on AWS ECS.
    • Set up zero-downtime releases and CI/CD pipelines.
    • Built REST and GraphQL APIs and a real-time emergency dispatch system.
  3. Weboccult TechnologiesJan 2023–May 2024

    Backend Engineer · Ahmedabad

    • Built REST backends with Node.js, Express and MongoDB.
    • Built Twilio and WebRTC video calling; better session handling raised average session length by 25%.

How AI Bestie works

One voice companion, two personalities. This is what happens between your question and its spoken reply.

  1. You speak or typeSpeech recognition captures your question. Typed and spoken messages share one conversation.
  2. The persona answersThe backend sends the last 20 messages as context and streams the reply over SSE as it forms.
  3. It speaks backFish Audio speaks the reply sentence by sentence, as each one arrives.
  4. You can cut inStart talking while it speaks and it stops to listen.

Two personalities. Friend and Mentor each have their own voice and range of settings. Five traits shape a reply, from how warmly the companion responds to how directly it challenges you.

How I ship a voice agent

From the mic to the metrics, in the order a turn travels. Open a step to see what breaks and what I build.

  1. CaptureMic in, speech to text
    What breaks
    Browser speech engines stop mid-word, and Safari behaves differently from Chrome. Words go missing without an error.
    What I build
    A capture loop that restarts the engine and keeps adding to the same transcript, with a server-side Whisper fallback for browsers that can’t transcribe.
  2. Turn detectionKnowing when someone has finished
    What breaks
    The agent jumps in on a short pause, or sits silent after the person is done.
    What I build
    Silence-based endpointing: 1.6 s of quiet ends the turn, stretched to 2.4 s when the sentence sounds unfinished.
  3. ReasoningA streamed reply, written for the ear
    What breaks
    A slow first token is dead air on a call, and long paragraphs sound robotic when spoken.
    What I build
    Token streaming over SSE, short replies in voice mode, recent conversation as context, and persona prompts that keep the tone steady.
  4. FailoverSurviving a slow or failing model
    What breaks
    One provider times out or hits a rate limit, and the whole call stalls.
    What I build
    A model list for each mode and hedged requests: if no token arrives in 2 s, the next model races alongside. No blind retries of the same model.
  5. SpeechText to speech, sentence by sentence
    What breaks
    Gaps between sentences, frozen playback, or a long wait for the first word.
    What I build
    Each sentence is spoken as soon as it is written, every synthesis call has a time limit, and the voice provider sits behind one switchable interface.
  6. Barge-inLetting people interrupt
    What breaks
    The agent keeps talking over the person. Nothing makes a voice agent feel fake faster.
    What I build
    The agent listens while it speaks. The first sign of the person’s voice stops playback and hands the turn back.
  7. TracingFollowing one turn end to end
    What breaks
    “It felt slow”, and no way to tell whether speech recognition, the model or the voice caused it.
    What I build
    One turn ID from the browser to the server. Mic, transcription, model, every audio chunk and playback land on one timeline.
  8. Metrics and logsMeasuring every turn
    What breaks
    No numbers, so no way to know whether a change made things faster or slower.
    What I build
    One JSON line per event: time to first token, stream time, total, provider, failovers and outcome. Timings only, never what anyone said.
  9. Load testingFinding the limit before users do
    What breaks
    A bottleneck nobody sees until real traffic arrives.
    What I build
    Load tests with mocked providers on one machine. The first run showed a TTS queue capping voice at about 10 users. With it raised, 100 concurrent voice users ran with 0 errors, and the server added 26 ms to a turn.
  10. ShippingSecured, tested, deployed
    What breaks
    Leaked keys, abuse, and regressions nobody notices until users do.
    What I build
    JWT auth, rate limits, secrets kept out of the code, tests on the voice paths, and a repeatable deploy.

Chatbots run on the same backbone. Text chat skips capture, turn detection, speech and barge-in. Reasoning, failover, tracing, metrics, load testing and shipping work the same way.

AI Bestie Real recording, 34 s

A typed interview-prep question, then a spoken follow-up in the same conversation. Chrome speech recognition, Gemini and Fish Audio.