Self-Hosted AI for Health Information: Architecture, Data Sovereignty, and Multi-Audience Access
Artificial intelligence in public health is frequently discussed as a future possibility. In Bangladesh, a production-grade AI assistant is already running inside the national health system infrastructure — grounded in verified official documentation, served from a secure national datacenter, and accessible to a diverse range of audiences.
This article describes the architecture, design principles, and rationale behind the AI assistant deployed at the Management Information System (MIS) of the Directorate General of Health Services (DGHS), Bangladesh.
The Problem This System Solves
Bangladesh’s national digital health ecosystem has grown substantially in recent years. Health ID, hospital automation systems, health information exchange frameworks, and DHIS2 implementations represent significant investments in infrastructure and standardisation.
But information about these systems — how they work, how they connect, what they require — is scattered across technical documentation, policy circulars, implementation guides, and institutional knowledge held by a small number of specialists.
This creates friction for everyone who needs to engage with the system:
- Technical staff navigating implementation details
- Researchers and academics studying national digital health architecture
- Journalists covering health system developments
- Citizens seeking to understand how national health platforms affect them
A single, authoritative, always-available knowledge interface addresses all of these simultaneously.
Why Self-Hosted, and Why It Matters
The deployment decision to self-host within the national datacenter was not merely technical — it was a governance position.
Public health information systems handle sensitive institutional knowledge. Routing queries through external commercial AI infrastructure introduces risks that are difficult to mitigate: data leaving national jurisdiction, responses shaped by models trained on unverified external content, and dependency on third-party uptime and pricing decisions.
A self-hosted architecture eliminates these risks entirely:
- Data sovereignty — all queries and responses remain within national infrastructure
- Auditability — every response is traceable to its source documents
- No external data leakage — institutional documentation does not leave the secure environment
- Cost predictability — no per-query commercial API costs at scale
- Institutional control — response behaviour is governed by institutional rules, not vendor defaults
For a national health authority, these are not optional features. They are requirements.
The Architecture
The system is built entirely on open-source components, demonstrating that production-grade AI infrastructure does not require proprietary platforms or commercial model APIs.
Orchestration — Dify Dify manages complex workflow logic, prompt engineering, and the overall conversation flow. It provides the control layer that enforces institutional rules — ensuring responses remain grounded in official documentation and adhere to defined response constraints.
Document Parsing and Knowledge Extraction — RAGFlow RAGFlow handles advanced document parsing, chunking, and knowledge base construction from official DGHS documentation. This is the retrieval foundation of the system — the corpus from which answers are drawn.
Inference and Embedding — vLLM and Infinity vLLM provides high-concurrency, GPU-accelerated model serving for response generation. Infinity handles embedding model serving for semantic retrieval. Together they deliver the performance characteristics needed for real-time, multi-user access.
Security Layer A robust proxy layer bridges secure web traffic with internal AI services, maintaining the security boundary between public-facing access and the internal datacenter infrastructure.
Integration The system is integrated directly into the existing DGHS portal rather than deployed as a standalone application — reducing friction for existing users and maintaining a consistent institutional interface.
Language and Audience Design
The system responds in English. This is a deliberate design decision reflecting the diversity of its audience.
The knowledge base covers technical architecture, interoperability standards, implementation specifications, and policy frameworks. These domains require precise, unambiguous expression. English serves as the common technical language across the full audience spectrum — from software implementers and health informaticians to international researchers and institutional partners.
This is not a constraint. It is an architectural choice that ensures consistent, methodical communication across a diverse user base that no single vernacular language could serve with equal precision.
What the System Knows
The knowledge base is grounded in official documentation covering Bangladesh’s core national health system components:
- Health ID — the national citizen health identity framework
- Hospital Automation System — implementation and operational guidance
- Health Information Exchange — interoperability architecture and standards
- DHIS2 — national health data reporting and analytics infrastructure
Responses are strictly grounded in this documentation. The system does not speculate beyond its knowledge base, does not draw on external internet sources, and does not generate responses unsupported by retrieved content. This design ensures that every answer reflects verified institutional knowledge rather than model inference.
The Open-Source Commitment
Every component of this stack — Dify, RAGFlow, vLLM, Infinity — is open-source. This reflects a broader principle in national digital health infrastructure development: sustainable, sovereign systems should not be built on proprietary lock-in.
Open-source infrastructure offers:
- Full auditability of system behaviour
- Community-driven development and security review
- No licensing costs that constrain deployment scale
- Institutional ownership of the full stack
This project demonstrates that production-grade AI capability is achievable within a national health authority using open-source technology, modest GPU infrastructure, and careful architectural design.
Implications for Digital Health Systems
The deployment at MIS DGHS represents something beyond a single implementation. It demonstrates a replicable model for how national health authorities in resource-constrained settings can deploy AI responsibly.
The key principles this implementation establishes:
- AI grounded in verified official documentation is more trustworthy than general-purpose AI for institutional use
- Data sovereignty is achievable without sacrificing capability
- Open-source infrastructure is production-ready for national health system deployment
- A single knowledge interface can serve technical, academic, journalistic, and citizen audiences simultaneously
As digital health ecosystems mature across low- and middle-income countries, the question is not whether AI will play a role — it is whether that role will be defined by national institutions or delegated to external commercial platforms.
This implementation is an answer to that question.
