Kestrel: Voice Qualification Agent
A voice-driven qualification agent: a deterministic slot-filling state machine with speech input and output where the browser supports it, and an honest degraded mode where it does not.
This is a working demonstration, not a client engagement. The brand and data are fictional.

Background
Kestrel is an invented fleet-services company. The agent qualifies an inbound enquiry by filling a small set of slots: who is calling, fleet size, what they need, and how soon.
The challenge
Browser speech support is inconsistent and fails in ways that look like nothing happening. Headless Chromium, for example, exposes the speech APIs, reports zero voices and never returns a recognition result: an interface that trusts the capability check will simply hang.
Objectives
- Qualify an inbound enquiry by filling a small set of slots, by voice where the browser allows it.
- Degrade honestly to typed input where speech is unavailable, rather than appearing to listen.
- Keep the dialogue inspectable and testable without any speech at all.
My role
Sole designer and developer
- Designed the dialogue as an explicit state machine with required and optional slots, so its behaviour is inspectable rather than emergent
- Wrote the extraction layer: names, numbers written as words, timeframes, and intent phrases
- Added a loop guard: an unrecognised answer to an optional slot records "not given" and moves on, while a required slot is re-asked once, then hands off
- Integrated the Web Speech API with capability detection, a listening timeout and voice-count checks
- Made the interface degrade honestly to typed input when speech is unavailable, rather than appearing to listen and never responding
- Wrote 28 unit tests and 20 browser checks
Technical approach
The dialogue is deterministic and fully testable without any speech at all; speech is an input and output layer on top of it. Capability detection checks for a non-empty voice list, not merely for the API's existence, and recognition has an eight-second timeout so a silent failure surfaces as a message rather than a hang.
What is implemented
- Deterministic slot-filling state machine with required and optional slots
- Extraction of names, numbers written as words, timeframes and intent phrases
- Speech recognition and synthesis via the Web Speech API, behind capability detection
- An eight-second listening timeout so a silent failure surfaces as a message
- A visible transcript and a live summary of the answers captured so far
Process
- Modelled the slots and transitions, then tested the state machine directly with text input.
- Built extraction with regular expressions, testing each against phrasings people actually use.
- Added the speech layer last, behind capability detection.
- Ran the browser suite in headless Chromium, which exposed the zero-voices case described above.
Engineering and creative decisions
An explicit state machine
The dialogue is a set of states and transitions rather than emergent behaviour, so it can be driven by text in tests and its paths enumerated.
Capability detection checks for voices, not just APIs
Headless Chromium exposes the speech APIs, reports zero voices and never returns a result. Checking that getVoices() is non-empty is what separates 'supported' from 'present but useless'.
A loop guard on every slot
An unrecognised answer to an optional slot records 'not given' and moves on; a required slot is re-asked once and then hands off. The first version re-asked for ever.
Extraction tested against real phrasings
Four genuine defects came out of this: a greedy pattern matching a bare 'a', 'for now' read as 'immediately', a case-sensitive name pattern, and plurals breaking a word boundary.
What was delivered
A qualification flow that completes by voice where speech works and by typing where it does not, and that says which mode it is in instead of pretending.
Results
- 28 unit tests and 20 browser checks pass.
- Testing found four genuine extraction defects: a greedy pattern matching a bare "a", "for now" being read as "immediately", a case-sensitive name pattern missing lowercase "i'm", and plurals breaking a word boundary.
- It also found an infinite loop: an unrecognised answer to an optional slot re-asked the same question for ever. Now bounded.
- The interface never claims to be listening when the browser cannot listen.
These are tested capabilities of the demonstration, not commercial outcomes.
Technology stack
Visual demonstration
Captured from the running application.

