Skip to main content

Architecture One-Pager

Historical snapshot

Written in May 2026 for a pilot review; revised for this public edition. It describes the pilot built for ZOL by a PXL University College graduation project and is not an official ZOL publication. Figures are self-reported.

A five-minute read for a technical reader. The full engineering description is in the Voice Stack Compendium; this page is the one-page distillation.

What it does​

The ZOL Intelligent Search system replaces the hospital website's keyword search with a natural-language interface across two channels — web chat and telephony — sharing one retrieval backend. A caller dialling the Belgian PSTN number reaches a self-hosted SIP gateway that bridges into a LiveKit room; a voice worker streams audio through Deepgram Nova-3 for speech-to-text, hands transcripts to the FastAPI backend, runs the answer through the cognitive core (regex pre-filter → agentic LLM → safety post-filter → answer-shaper → disclaimer), and synthesises audio back through ElevenLabs Multilingual v2. The chat channel skips the SIP and TTS stages but reuses the same backend cognition end-to-end.

How it is structured​

The system composes seven layers, each with a single responsibility (Compendium §2). The composition is intentionally rigid: layers do not bypass each other, and each was chosen against named alternatives recorded in an ADR. The cognitive core (ADR-0049, ADR-0051) is agentic-only — a single GPT-4.1 agent wraps the existing retrieval pipeline. The base tool set is three tools (search the knowledge base, transfer to the helpdesk, end the call); from June 2026 three scheduling lookups (find consulting doctors, list a department's doctors, get a doctor's schedule) are added, giving six tools on the pilot. There is no dialogue manager and no state machine; the earlier eight-stage voice orchestrator and the dialogue manager were retired together in May 2026, removing roughly 7,000 lines of code. Embeddings are OpenAI text-embedding-3-large over pgvector (ADR-0048); the knowledge representation is PostgreSQL taxonomy tables (ADR-0053, which retired Neo4j after its graph algorithms proved non-load-bearing in retrieval).

What is distinctive​

Three engineering decisions characterise the design. Conditional knowledge-graph injection (graph context is added only when the query contains recognised medical entities) scored 1.7 percentage points higher than graph-off in the project's own golden-question runs (self-reported, 2026-03; entity recall and must-refuse behaviour only), while unconditional injection slightly lowered the average (thesis §4.3, Table 4.7). Language locking at first utterance (ADR-0052) trades mid-call language switching for Flemish acoustic accuracy, after two empirical pilot regressions where multi-language Deepgram emitted gibberish or zero transcripts. The Value Framework is a 7-intent × 6-category affinity matrix (voice/value-framework) intended to prevent cross-category contamination — a wheelchair-accessibility query gets a parking answer, not an orthopaedic-reimbursement answer.

The seven-layer stack​

Figure 1 — Layered stack. Adapted from Voice Stack Compendium §2, Figure 2.1.

The per-turn request path​

Figure 2 — Per-turn path through the seven layers. Reproduced from Voice Stack Compendium §2, Figure 2.1.

Deployment​

The pilot deploys on a single hosted server using containers: the backend (FastAPI), the voice worker (LiveKit Agents), a SIP gateway, a LiveKit media server, PostgreSQL with pgvector, Redis, and MinIO for object storage. A Twilio SIP trunk forwards inbound calls over an encrypted connection with an IP allowlist; OpenAI, Deepgram, and ElevenLabs are subprocessors of record under GDPR Art. 28 (safety/dpia §5.2). The SIP gateway is self-hosted rather than using a managed one; the cost reasoning is in Compendium §2 Layer 1. The integration is described in Twilio and LiveKit SIP.

Where to read more​