Abstract:
Architectural proposals for privacy-preserving clinical artificial intelligence are more numerous than working implementations, and the question of whether a full
Retrieval-Augmented Generation (RAG) pipeline can in fact be built and operated within the hardware and connectivity envelope of an African county referral
hospital remains largely untested. This article reports the second objective of a design science study: the development of an On-Premises RAG system for
retrieving electronic health records in Level 5 hospitals in Kenya. Following the Design Science Research Methodology, a previously validated five-layer architecture was implemented as an Electron desktop application in which every component, comprising embedding generation, vector indexing and language- model inference, executes on local hardware. Embeddings were produced locally at 1,024 dimensions by qwen3-embedding-0.6b and indexed with Hierarchical
Navigable Small World graphs in a MongoDB-compatible document database, while inference was served locally by Microsoft Foundry Local with automatic
execution-provider selection. A synthetic corpus representing the electronic medical record database of a fictitious institution, comprising 60 patients and 120
clinical encounters across 25 referentially complete relational tables, yielded 1,603 source rows ingested as 1,603 chunks, each carrying lineage metadata to its
source record. The corpus is exactly reproducible from a fixed seed and its integrity is verified before ingestion, a safeguard introduced after a defect in an earlier corpus invalidated a complete evaluation cycle. The seven requirements in the specification were implemented and verified, role-based access control mapped five cadre-aligned roles to twelve application pages, every action over patient data was written to an append-only audit log, and network monitoring during operation confirmed that no external call was made. The system operated within a 32 GB memory envelope at approximately 70 per cent resident memory, with inference executing on an integrated Intel Arc graphics processor through OpenVINO. Two boundaries are stated rather than left to inference: operation on a central processing unit alone was not demonstrated, and the implemented security controls were verified functionally but not subjected to security testing.