Add xAI patient intake example - #86
Open
tinalenguyen wants to merge 2 commits into
Open
Conversation
A family-medicine front-desk voice agent running the full xAI speech stack —
xai/stt-1, grok-4.20, and xai/tts-1 — with LiveKit Agents for transport and
turn detection. Laid out like the drive-thru example: a Python worker plus a
Next.js frontend, each with its own README.
complex-agents/xai-patient-intake/
patient-intake-agent/ One agent, one conversation, eight typed tools over an
in-memory practice. No handoffs or workflow state
machine; every tool re-verifies identity from its
arguments, so a caller can book a visit, report a
symptom, and update insurance in any order.
frontend/ Dispatches the worker and renders the conversation,
transcript, and tool calls.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Three unrelated cleanups to the xAI patient intake example. Model: xai/grok-4.20-0309-non-reasoning -> xai/grok-4.3 with reasoning_effort="none". 4.3 controls reasoning by parameter rather than by model variant, so the non-reasoning behavior the front desk wants is now a kwarg. Verified against the inference gateway on a live call. Fonts: TWK Everett is licensed per-seat from weltkern, and shipping the five woff2 files here redistributed it to everyone who clones a public repo. Replaced with Space Grotesk over next/font/google, so no binary and no license to breach. The --font-lk-display variable is unchanged, so every font-display heading picks it up with no call-site edits. fonts/README.md records what is left and why. Audio: the browser enabled Krisp while the worker was already running the ai-coustics enhancer, so two denoisers ran in series on the same signal. The second one receives audio outside its training distribution and the usual result is over-suppressed quiet speech -- exactly what this agent's endpointing config exists to wait for. Kept the server stage, which also covers SIP callers who never load the frontend. Also expanded the endpointing comment to record the defaults it departs from, and that min_delay is the knob to lower first because dynamic mode only ever adapts upward from the floor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
complex-agents/xai-patient-intake/: a family-medicine front-desk voice agent running the full xAI speech stack, plus the browser frontend for it.xai/stt-1xai/grok-4.20-0309-non-reasoningxai/tts-1(voicecarina)Laid out like
complex-agents/drive-thru: a Python worker (patient-intake-agent/) and a Next.js app (frontend/), each with its own README, and a top-level README carrying the layout table and quick start.What it demonstrates
The agent identifies a caller against a chart, books and moves appointments, answers practice-policy questions from a published guide, collects pre-visit clinical intake, routes refill/results/billing/referral messages, and escalates possible emergencies.
The design is deliberately flat — one agent, one conversation, one fixed tool surface. No handoffs, no
AgentTask, no workflow state machine. The model holds the conversation in its own context and passes what it has learned to eight typed tools:read_practice_information·find_open_times·book_appointment·manage_appointment·take_message·update_insurance·record_previsit_intake·record_emergency_escalationEvery tool re-verifies identity from its own arguments instead of trusting remembered state, so a caller can book a visit, report a symptom, and update insurance in any order without a phase machine deciding what is allowed next. It is a useful counterpoint to the handoff-based examples here — worth comparing with
medical_office_triage, which solves an adjacent problem with a triage/handoff structure.Practice policy stays out of the prompt:
src/clinic/practice_info/holds the published guide as small Markdown files, and one argument-free tool returns all of it, leaving interpretation to the model rather than a category table.Notes
uv run python src/agent.py consolegives a full voice conversation in the terminal with no frontend at all.uv run pytest tests/unit -q..env.examplefiles are blank; no credentials are committed.