Contact Us

Case study

Generative AI case study: role-play training where opticians practise on an AI patient

ResultAverage role-play session: about 25 minutes down to under 15

Client
A learning platform for opticians (anonymised)
Industry
Healthcare and education technology
Service
Generative AI development
Type
Generative AI role-play
Timeline
6 months
Status
In use

This generative AI case study is about a learning platform for opticians, where learners practise patient conversations by talking to an AI patient. Behind each session the work is split: OpenAI models play the patient and track which stage of the consultation the learner has reached, and a separate model writes the feedback against a written scoring guide. The average session fell from about 25 minutes to under 15.

Under 15 minutes
per role-play session on average, down from about 25
85 to 92%
of consultation stages identified correctly, in common scenarios
20 to 30%
fewer support enquiries
Under 1%
of sessions with a duplicated message, down from 2 to 5%

The challenge: natural conversation and consistent feedback

The platform teaches opticians with courses, assessments and guided practice, and realistic practice is the most nuanced part. A consultation moves through stages: the greeting and first questions, understanding what the patient needs, recommending a product, closing, and sometimes handling a complaint. Useful feedback depends on knowing which stage the learner is in, but there is no script or explicit stage marker. Learners speak freely, skip a question or return to an earlier point, and the scoring still needs to treat each learner consistently across every scenario.

The simulated patient also needed to feel natural and varied. Each scenario called for a patient with a prescription, a budget and day-to-day needs, without sounding scripted or unfolding the same way for every learner. Voice added another consideration because both sides speak. A pause longer than 1 to 2 seconds could make the exchange feel unnatural and make interruptions or repeated phrases more likely.

Then there was the network. On a shaky connection a message could arrive twice, and about 2 to 5% of sessions ended up with duplicate turns in their history, which could move the detected stage and repeat a piece of feedback.

What we built: a generative AI patient, a stage classifier and a feedback model

Learners pick a role-play from a set of scenarios, and a firm with many practices runs all its learners in one place. OpenAI models play the patient, inside the prescription, budget and needs the scenario sets. They also read the dialogue as it happens and label each part with its phase (greeting, discovery, recommendation and the rest), so the system knows which stage the learner has reached. In common scenarios, they name the stage correctly 85 to 92% of the time.

The feedback comes from a separate model, working from a written scoring guide. A live coaching panel guides the learner during the session.

The patient's voice is ElevenLabs, streamed and buffered to keep the back-and-forth smooth in a live session. Every message carries a request ID, so one that's sent twice is stored once.

Around the models: a Next.js front end built with Radix UI and shadcn/ui components, Clerk for sign-in and roles (so access can differ by user and by practice), and Apollo Client talking GraphQL to a NestJS back end. PostgreSQL and Prisma keep the data and Redis caches it. Files, email and background work run on AWS (Lambda, S3 and SES) and on Azure Blob Storage.

Which model does which job, and why

Every call to a large language model costs money, so which LLM handles which step sets the monthly bill. A large, expensive model on every step pushed running costs up by about 30 to 50%. Small models alone would have cost less, but the feedback could have weakened, especially in the hard moments: a complaint, a tight budget, a choice between prescriptions. So the build splits the work. OpenAI models run the conversation and the stage detection, and the feedback goes to a separate model. That split is how it balances cost against quality.

Three ways to give the work to models

Not chosen

A large model on every step

  • Running costs up by about 30 to 50%

Not chosen

Small models alone

  • Cheaper to run
  • Feedback that could weaken in the hard moments: a complaint, a tight budget, a choice between prescriptions

What was built

The split

  • OpenAI models run the conversation and the stage detection
  • A separate model writes the feedback, held to a written scoring guide
Which model handles which step sets the monthly bill, so the build gives each job to the model that fits it.

Who does what in a role-play session

  1. 01AI model

    Playing the patient, inside the scenario

    OpenAI models

  2. 02AI model

    The patient's voice

    ElevenLabs, streamed and buffered

  3. 03AI model

    Working out the learner's stage

    OpenAI models, classifying the dialogue by phase

  4. 04AI model

    Feedback on each stage

    A separate model, held to a written scoring guide

  5. 05Automation

    A message that arrives twice

    Stored once, by its request ID

  6. 06Automation

    Help while the session runs

    The live coaching panel

  7. 07People

    Following each learner's progress

    Managers, in the assessment tools

The feedback model doesn't decide what a good consultation looks like. It applies the written guide, so every learner's feedback rests on the same criteria, whichever way their conversation went. And the feedback follows the stage, which is why a duplicated message mattered: it could move the stage label and repeat a piece of feedback the learner had already had.

Results

Before and after launch

  • Average role-play session

    BeforeAbout 25 minutes

    After launchUnder 15 minutes

  • Support enquiries

    BeforeSupport enquiry volume before launch

    After launchDown around 20 to 30%

  • Sessions with duplicate messages

    BeforeAbout 2 to 5%

    After launchUnder 1%

  • Training across teams

    BeforeLess interactive, harder to manageAfter launchAssessments and progress tracked by managers

Sessions are shorter because learners spend less time restarting or wondering what to do next. Learners now take a full conversation from the greeting to the close and receive clear feedback on it. The support enquiries that fell most were the two the coaching and feedback now answer: what to do next, and how the scoring works. Stage detection, at 85 to 92% correct in common scenarios, has no before figure because the role-play itself is new.

Technologies and tools

  • Next.js
  • Radix UI
  • shadcn/ui
  • Clerk
  • Apollo Client
  • GraphQL
  • TanStack Table
  • NestJS
  • PostgreSQL
  • Prisma
  • Redis
  • OpenAI
  • ElevenLabs
  • AWS Lambda
  • Amazon S3
  • Amazon SES
  • Azure Blob Storage

Timeline

The build took six months.

If your own staff learn a conversation by practising it on each other, our page on LLM development services sets out how we choose a model for each job and work out the monthly bill before the build, and the one on conversational AI development services covers the voice side.

ServiceGenerative AI development services

Bring us the conversation your team wants to practise

Tell us about the conversation, the stages that matter and how you support learners today. An engineer replies within two business days with which model we'd use for each job and what the complete experience would cost to run.