dental clinic

The integration of real-time artificial intelligence into clinical workflows represents a structural shift for operations-heavy industries. Deploying autonomous agents capable of managing sensitive scheduling and data extraction requires specialised infrastructure to maintain absolute precision.

Engineers must navigate the inherent tension between seamless conversational interfaces and strict medical compliance frameworks.

Gaurav Kesharwani, Chief Technology Officer at ThirdVoice AI, oversees the development of voice-native systems that handle complex dental practice operations.

Holding a master's degree in artificial intelligence and drawing from thirteen years of engineering experience in banking infrastructure, Kesharwani builds high-volume, HIPAA-aligned architectures. His approach prioritises deterministic controls and transactional reliability over unconstrained model generation.

Overhauling Legacy Voice Stacks

Voice AI infrastructure has shifted decisively away from traditional framework designs. 'A legacy IVR is half-duplex: play a prompt, wait for silence or a keypress, branch,' Kesharwani explains. Systems operating on these assumptions struggle to process overlapping human speech patterns accurately.

Moving to full-duplex conversational AI requires rebuilding the transport and turn-taking loops from scratch. 'In the old stack, barge-in meant stopping a WAV file. Now every stage has to be killable mid-flight, and you have to reconcile what the model generated against what the caller actually heard,' Kesharwani says.

The batch stages went with it. The old pipeline recorded an utterance to a file, posted it to a speech recognition endpoint, waited for a transcript, then synthesised a WAV and played it: four barriers, each a place where audio sat still. Everything now streams, with 20-millisecond frames in, partial transcripts as they form, and synthesised audio going out before the sentence is finished.

Silence-based end pointing went too, replaced by a turn-detection model reading acoustics and semantics together to judge whether a thought is actually complete, a call cascaded dialog architectures have traditionally handed to a fixed timer.

Synthesis research runs in the same direction, with methods that integrate speaker-specific style embeddings into token representations.

Handling Unpredictable Human Interruptions

Handling unpredictable conversational behaviors requires complex logic to manage state reversals without breaking context. 'When a real interruption fires, three things have to die at once: the in-flight LLM stream, the TTS request, and the audio frames already sitting in the playout buffer,' Kesharwani explains. Forgetting the playout buffer results in the agent continuing to speak over the user.

Accurately mapping these reversals prevents the AI from hallucinating conversational history.

'Using TTS-aligned word timings, we map that back to a word boundary and truncate the assistant message in the conversation context to exactly that point, flagged as interrupted,' Kesharwani says. This precise truncation mechanism eliminates the persistent errors commonly found in loosely coupled dialogue systems.

Not every sound is an interruption.

Detection that fires on any detected speech fails on phone audio, where a 'mm-hmm,' a television, or a child in the room all register, so an interruption classifier separates genuine barge-in from backchannel, using a minimum speech duration near half a second and a short cooldown after the agent starts talking.

Telling the two apart depends on word-level acoustic behaviors such as fundamental frequency and energy.

On the SIP leg, there is no browser echo cancellation, so telephony-tuned voice cancellation is mandatory, or the agent interrupts itself. None of these thresholds are reasoned out. They are tuned against logged calls, because a practice with a compressor running behind the front desk needs different numbers than a quiet office.

Managing Complex Non-Linear Conversations

Non-linear clinical calls demand rigorous separation between conversation context and structured tasks. 'The model is the router and the language layer. It is not the state store,' Kesharwani emphasises. The transcript serves as a transient record, while a typed state object captures confirmed facts.

Instead of sequential flows, advanced systems utilise supervisors to dispatch short-lived, focused sub-tasks.

'Because the supervisor never gives up context, a caller who jumps from picking a time to 'wait, does my plan cover this' gets the insurance question answered and comes back with the slot state intact,' Kesharwani explains. This continuous execution avoids the heavy latency penalties of traditional multi-agent handoffs.

Fields in that record are written only by tool calls, never inferred from prose, and each carries provenance and a confirmed flag. If a caller changes the date three times, the transcript holds all three and the state record holds one. Every sub-task is resumable and idempotent, so a return to slot selection re-reads state rather than re-asking.

Symptoms are the branch where the correct engineering answer is often not to answer: urgent cases route to escalation, clinically relevant detail goes into the chart note, and scheduling detail maps to appointment type and duration. The agent gives no clinical advice, and that boundary is enforced in the tool layer rather than requested in a prompt.

Optimising Multi-Model Pipeline Operations

The architectural debate between cascaded pipelines and single end-to-end models centers on transactional reliability.

'Text-native models remain measurably better at producing correct structured tool calls than audio-native ones, and a two percent error rate on 'book the appointment' is not a rounding error in this business; it's a patient who shows up on the wrong day,' Kesharwani says.

Published evaluations report the same trade: end-to-end models minimise time-to-first-audio but show degradation in exact match accuracy on audio-native data extraction.

Cascaded systems also provide necessary visibility into operational failures. 'When a cascaded call goes wrong, the trace tells me which stage broke,' Kesharwani explains. Generating a reliable text transcript as a byproduct serves critical quality assurance and auditing requirements.

The compliance surface argues the same way. Discrete components let him choose which vendor sees which modality, sign a business associate agreement with each and redact between stages, where a single audio-in model sees everything and leaves no place to interpose.

The costs are real: latency accumulates serially across end pointing, transcription, first token and first byte of audio, and the paralinguistic signal – meaning tone, hesitation, and distress – dies at the text boundary.

On the transactional path, structured outputs with strict schema constraints and constrained generation keep the writes honest. The split is re-evaluated every quarter, and the likely first production use of an audio-native model is a narrow one, probably greeting and intent capture.

Securing Sensitive Health Information

Implementing financial-grade security in healthcare applications requires fundamental structural isolation. 'An embedding derived from an identifiable record is PHI,' Kesharwani states. Treating vector databases as inherently secure ignores the sensitivity of the underlying mathematical representations.

Robust architectures physically separate general practice knowledge from identifiable patient ledgers.

'Where PHI does reach a vector store, the boundary has to be deterministic rather than learned: a separate namespace per practice, the tenant key injected server-side from the authenticated session, and pre-filtering on that key rather than filtering results afterward,' Kesharwani explains.

Server-side enforcement targets the failure he actually designs against, which is not an attacker but a query that ships with a missing filter and returns the practice next door.

Most patient data never enters the retrieval layer at all. The knowledge tier, holding practice policies, insurance rules, procedure explanations and cancellation terms, is scoped to the practice, contains no PHI and is the only material that genuinely benefits from semantic search. The patient tier, meaning identity, appointments, ledger, and treatment plan, is never embedded.

It is fetched at inference time by a parameterised tool call keyed on a verified patient ID, an exact lookup rather than a nearest-neighbor search. 'You do not want cosine similarity deciding which patient's chart is relevant,' Kesharwani says.

Scope parameters are also stripped from the model-visible tool signature entirely, because if a model can pass a practice ID as an argument, a caller reading a sentence aloud is a cross-tenant data leak.

Safeguarding Autonomous Database Transactions

Transitioning from conversation to autonomous database mutation introduces substantial operational risk. 'A tool call from the model is a proposal, not an execution,' Kesharwani says. Agents must operate through intermediate transaction services that manage validation and idempotency.

Complex booking procedures mandate rigid verification before any permanent write occurs. 'The commit fails without a valid hold, which means the model structurally cannot book without having gone through confirmation,' Kesharwani explains.

The hold is short-lived by design, so a failure mid-flow releases the slot rather than leaving it locked, which is the blocking problem that makes classical two-phase commit hard to run against a live system. Every write also carries an idempotency key derived from session, intent and normalised parameters, because tool loops retry and callers repeat themselves.

The patterns underneath are old: two-phase commit, compensating transactions and an idempotent write path, close cousins of the Saga pattern and Try-Confirm-Cancel mechanisms used for consistent distributed execution. What differs is that the client initiating the transaction is non-deterministic.

Blast radius is therefore scoped by omission rather than by instruction: the agent can create, reschedule and cancel appointments, update contact information and log a note, and it has no tool that touches the ledger, posts payments or alters treatment plans.

'Prompt-level restrictions aren't a security control,' Kesharwani says. Writes are journaled before they go out, which supports compensating actions and a nightly reconciliation job that catches drift.

Extracting Structured Clinical Data

Processing live medical audio into accurate clinical documentation requires strict schema enforcement rather than generative storytelling. 'The first move is to stop calling it summarisation. Summarisation asks a model for a fluent narrative, and a model producing narrative will fill gaps to keep it flowing,' Kesharwani explains.

Asserting clinical facts demands undeniable proof linked directly to the original audio segment. 'Every extracted field carries the transcript span supporting it. No span, no field,' Kesharwani emphasises.

Capture matters more than model selection. Multi-party operatory audio is diarised and run through medical-tuned speech recognition with per-practice key term prompting for procedure codes, material names, and the local formulary, because a general model mangles 'Articaine' and 'distoocclusal' every time and nothing downstream recovers from a garbled transcript.

Extraction then runs field by field against enumerated vocabularies such as CDT codes and tooth numbering, followed by deterministic validation: dose within range, no findings on a tooth already documented as missing. Elsewhere in the field, grammar-constrained decoding prunes invalid tokens at generation time to the same end.

Because exact match scoring penalises surface-level formatting variation, fabrication rate is tracked as its own number. Prose is rendered only from validated fields, and the clinician always signs.

Scaling Latency-Sensitive Voice Workloads

Operating concurrent, sub-second voice engines requires rethinking standard cloud elasticity models. 'Everything follows from one mismatch: a voice session is long-lived, stateful and latency-sensitive, while nearly every cloud autoscaling primitive assumes short stateless requests,' Kesharwani explains. Aligning media planes and agent workers within the same region prevents network latency from accumulating.

Resource allocation strategies must prioritise defensive capacity planning over reactive scaling. 'We scale on active sessions per worker and dispatch queue depth. CPU is a lagging indicator here, and it lags in the worst possible direction, because by the time it's high, calls are already degrading,' Kesharwani says.

Autoscaling is asymmetric on purpose: aggressive scale-up on short cooldowns, slow scale-down with long stabilisation and proper draining, because a worker holding a live patient call cannot be terminated.

A rolling deploy therefore takes as long as the longest call on the fleet. Cold starts are fatal to a first call, since they include model loading and connection setup to every provider, so warm headroom is held per region.

Dental traffic helps, with a Monday morning spike, a lunch dip, and quiet weekends, so scheduled scaling covers the known curve and reactive scaling covers the surprises.

Persistent pooled WebSockets to the speech, language, and synthesis providers, warmed before the call is answered, keep critical healthcare communications alive through localized provider degradation, with alerting on p95 latency by stage rather than in aggregate.

Real-time autonomous operations represent a fundamental infrastructure reset rather than a mere interface upgrade. Through strict architectural isolation, deterministic state management and engineered resilience, highly regulated systems navigate the friction between non-linear human behavior and rigid clinical schemas.

As operations-heavy industries deploy autonomous agents, the mandate shifts from achieving conversational fluidity to guaranteeing transactional integrity at scale.