Qiri · Confidential

Solution architecture

Internal & investor material. Sign in with your @qiri.ai Google account to continue.

Qiri
Qiri · Solution Design

Pharmacist Console & Patient Kiosk — Reference Architecture

End-to-end clinical-intelligence platform on Google Cloud. The in-pharmacy console is the wedge (Phase 1); the patient kiosk and central command centre extend it (Phase 2); the neuro-symbolic Qiri reasoning engine and the context graph are the business underneath both.

GCP · australia-southeast1 Claude + Gemini on Vertex AI Full 2-way dispense integration PBS + My Health Record (now) v0.1 · 2026-05-30

Decisions this design is built on

Non-negotiable design law (from project CLAUDE.md)

Qiri is neuro-symbolic, not an LLM wrapper. Model output never flows directly to a dispensing decision. Every clinical proposal passes the symbolic safety layer (CQL rules, hard ceilings) and is gated by a licensed pharmacist — on the console (Phase 1) or via the command centre (Phase 2 kiosk). Every decision emits a full reasoning trace. PHI stays in-region and is redacted by default in logs.

01System architecture

Five layers: client surfaces → on-site edge → GCP perimeter (security, services, reasoning engine, data) → external & government integrations. Dashed boxes are placeholders you still need to choose, procure, or build.

Pharmacist ConsolePhase 1 · in-store
Command CentrePhase 2 · remote
Patient KioskPhase 2 · self-service
Patient PWAscript lodge
↓  clinical events  ↓

On-site Edge

semi-trusted zone
Dispense ConnectorFHIR R4 · HL7v2
Kiosk Edge Runtimeoffline cache · local safety
Kiosk Hardwarepartner-built

Qiri Platform

GCP · australia-southeast1 · VPC-SC perimeter
Application services · Cloud Run
Dispense Orchestrator
Kiosk Orchestrator
Integration
Consent & Audit
Reasoning engine · neuro-symbolic
Claude · Vertex AIreasoning · counselling
Gemini · Vertex AImultimodal · OCR · scale
Model Router
Grounding · RAGAMH · PBS · guidelines
★ SYMBOLIC SAFETY GATECQL rules · hard ceilings — every model output passes here before any dispense

Government & Partners

external integrations
PBS · My Health RecordPRODA · NASH PKI
SafeScript / RTPMcontrolled drugs
AHPRAregistration
PaymentsTyro · Stripe
Telepharmacy AVWebRTC
mTLS
Qiri Integration Bus  ·  API Gateway · Apigee · Identity Platform
OAuth / OIDC
AlloyDBPHI · scripts
Context Graphthe moat
BigQueryde-identified
Cloud Storagedocs · A/V
Cloud KMSCMEK · secrets

02Clinical decision flow — the gate

This is the heart of the system and the regulatory story. The LLM proposes; the symbolic layer disposes; the pharmacist decides; the trace compounds. Same flow whether the script arrives at the console (Phase 1) or the kiosk (Phase 2) — only the human-in-the-loop location changes.

sequenceDiagram
  autonumber
  participant SRC as Script source
PMS · eScript · kiosk participant ORCH as Orchestrator participant ENG as Reasoning engine
Claude · Gemini participant GATE as Symbolic safety gate
CQL · hard ceilings participant REV as Pharmacist
console / command centre participant DISP as Dispense + hardware participant GRAPH as Context graph + audit SRC->>ORCH: New script + patient history (PHI) Note over ORCH: normalize to FHIR R4 · redact for prompt ORCH->>ENG: De-identified clinical context ENG->>ENG: Draft proposal · cite AMH / PBS ENG->>GATE: Proposal (advisory only) Note over GATE: LLM output never dispenses.
Hard rules decide. alt Hard rule violated GATE-->>REV: HALT + full reasoning trace REV->>DISP: Hold · contact prescriber else Within safe bounds GATE-->>REV: Recommendation + counselling note + trace REV->>DISP: Approve / modify DISP-->>SRC: Write-back status (FHIR) end REV-)GRAPH: Pharmacist action + outcome GATE-)GRAPH: Rules fired · model · citations Note over GRAPH: Every decision traced →
indemnity defence + network moat

03Patient kiosk — edge & hardware

Qiri is the intelligence layer, not a hardware manufacturer. The physical kiosk is partner-built (ScriptPro / Parata / Wellmation class). Edge compute holds an offline cache and a local safety fallback so the unit degrades safely if the WAN drops, and the camera/mic bridge a remote pharmacist for telepharmacy.

Patient Kiosk

secure cabinet · partner-built hardware
Patient I/O
Touchscreenno keyboard
ScannerMedicare · ID · eScript QR
Camera · mic · speakertelepharmacy A/V
Label + receipt
Edge Runtimeoffline cache · local safety fallback · orchestration
Dispense mechanism
OTC / S2-S3 vending
Robotic Rx dispense
EFTPOS
online: edge sends full reasoning to platform, receives approved dispense  ·  live A/V counselling bridges to the command centre  ·  WAN down: edge falls back to local rules, safe-deny + queue

04Component reference

Named GCP services per layer, with the phase each is needed. "Build now" vs phased is a sequencing hint, not a hard line.

Compute, API & identity

ComponentGCP serviceRolePhase
Pharmacist console hostFirebase Hosting + Cloud CDNServe Next.js console to in-store workstationsP1
API edgeApigee / API Gateway + Cloud ArmorAuth, rate limit, routing, WAF/DDoSP1
IdentityIdentity Platform + Cloud IAMPharmacist + patient auth; service-account least privilege; AHPRA-linked rolesP1
Application servicesCloud Run (or GKE Autopilot)Dispense orchestration, counselling, integration, audit, kiosk orchestration, command centreP1 P2
EventingPub/Sub, Eventarc, WorkflowsDispense events, async pipelines, orchestrationP1

Reasoning engine (neuro-symbolic)

ComponentGCP serviceRolePhase
Reasoning modelsVertex AI — Claude + GeminiClaude: clinical reasoning, counselling, patient-level translation. Gemini: multimodal triage, OCR, high-volume.P1
Model routerCloud Run serviceRoute per task type / cost / latency; fail-over between modelsP1
Symbolic safety layerCustom CQL rules engine on Cloud RunHard ceilings + clinical rules gate every proposal. Source of truth for "do not dispense".P1
Knowledge retrieval (RAG)Vertex AI Search + Vector SearchAMH, PBS schedule, clinical guidelines groundingP1
Document OCRDocument AIScript / label extraction at kiosk and consoleP1
VoiceSpeech-to-Text / Text-to-SpeechKiosk voice counselling, accessibilityP2
Trace + context graphBigQuery + graph store (TBD)Structured decision traces — the compounding moatP1

Data & security

ComponentGCP serviceRolePhase
Operational / PHI storeAlloyDB or Cloud SQL (Postgres)Scripts, patients, transactions — CMEK encryptedP1
Real-time stateFirestoreConsole + kiosk live session stateP1
Object storeCloud Storage (CMEK)Documents, telepharmacy recordings, imagesP1
Cache / sessionsMemorystore (Redis)Low-latency session + lookup cacheP1
AnalyticsBigQueryPopulation health (de-identified via DLP API), A/B, opsP1
Keys & secretsCloud KMS (CMEK) + Secret ManagerCustomer-managed encryption, credential storageP1
Compliance perimeterVPC Service Controls, Private Service Connect, DLP API, Security Command CenterData exfil prevention, PHI scanning/redaction, postureP1
ObservabilityCloud Logging / Monitoring / Trace + Audit LogsImmutable audit trail, alerting, distributed tracingP1
CI/CD + IaCCloud Build, Artifact Registry, Cloud Deploy, TerraformReproducible, auditable deploysP1

05Placeholders — what you still need to choose, procure, or build

Everything dashed in the diagrams, grouped so you can hand each cluster to the right owner (Jon = product/UX/vendors, Javed = AI/architecture, David Hanin = clinical/regulatory).

🖥️ Hardware (Phase 2)

  • Kiosk OEM partner — ScriptPro / Parata / Wellmation (decide buy-vs-partner)
  • Robotic Rx dispense unit model + capacity
  • OTC / S2-S3 vending mechanism
  • Touchscreen, camera, mic/speaker array spec
  • Medicare/ID + eScript QR scanner
  • Label + receipt printer
  • EFTPOS terminal (Tyro / Smartpay)
  • Edge compute device (industrial mini-PC / ChromeOS / Android kiosk)
  • Secure cabinet, tamper sensors, environmental/temp monitoring
  • UPS + 4G/5G failover modem

🧱 Apps / software to build

  • Pharmacist console (Next.js) — in build
  • Kiosk client app (kiosk-mode, offline-first)
  • Central command-centre console
  • Dispense connector agent (per-PMS adapters)
  • Model router + CQL safety engine
  • Patient mobile / PWA (optional)
  • Consent + audit service

🔌 Third-party SaaS / vendors

  • Payment processor (Tyro / Stripe / Adyen)
  • Telepharmacy AV transport (WebRTC: LiveKit / Twilio / Daily)
  • SMS / email / push (notifications)
  • eScript exchange access (eRx / MediSecure)
  • Error/observability add-ons (Sentry, if any)

☁️ Cloud / GCP to stand up

  • GCP org + folder/project structure (prod / staging / dev)
  • VPC-SC perimeter + Private Service Connect
  • Vertex AI: enable Claude (Model Garden) + Gemini, quotas
  • CMEK key rings in australia-southeast1
  • Graph store choice for context graph (Spanner Graph / Neo4j on GKE / BigQuery)
  • DR region (-southeast2) + backup policy
  • Cloud VPN / Interconnect to pharmacy sites

⚖️ Regulatory / accreditation

  • My Health Record CSP onboarding + NASH PKI certificates
  • PBS Online via PRODA (Services Australia)
  • SafeScript / RTPM connection (controlled drugs)
  • Active Script List registration
  • AHPRA pharmacist verification process
  • Privacy Act / APP compliance + DPIA
  • State pharmacy board sign-off for kiosk model (Phase 2)
  • Clinical validation owner (David Hanin — CCO & Head of Pharmacy)

🤝 Partner / data agreements

  • PMS vendor integration agreements (FRED, Minfos, Z, LOTS, Aquarius)
  • Anthropic + Google data-processing terms on Vertex
  • Drug knowledge licensing (AMH, MIMS)
  • Pilot pharmacy partner agreements

06Open architecture decisions

Questions worth resolving before you commit code or spend. None block drawing the system, but each changes a box above.

#DecisionWhy it mattersOwner
1Context-graph store: Spanner Graph vs Neo4j-on-GKE vs BigQuery relationalIt's the moat; query shape + scale + ops burden differ a lotJaved
2Cloud Run vs GKE Autopilot for servicesCloud Run is cheaper/simpler; GKE if you need fine-grained networking or sidecars for VPC-SCJaved
3Dispense connector: on-prem agent vs cloud-hosted with site VPNOn-prem is more resilient/offline-friendly but more to maintain across sitesJaved / Jon
4How much safety logic runs at the kiosk edge offlineDetermines safe-degradation behaviour when WAN drops (CLAUDE.md principle 5)Javed + David
5Kiosk OEM: integrate an existing dispenser vs spec a custom cabinetSpeed, capex, and regulatory surface for Phase 2Jon
6Telepharmacy transport (LiveKit self-host vs Twilio/Daily)Latency, cost, and whether AV recordings stay in your GCP boundaryJon / Javed
scroll to zoom · drag to pan · Esc to close