Overview
Documentation for UPAS - an offline-first procedural guidance prototype for humanitarian responders
Introduction
UPAS (Unified Procedures and Advisory System) is a prototype of an offline-first procedural guidance system designed for humanitarian responders operating under pressure. It is intended to run entirely in the browser with no server-side APIs, keys, or external credentials required.
Prototype Status: UPAS is currently in early development. This documentation describes the intended architecture and functionality. A pilot programme is planned for Q3 2026.
Planned key capabilities include:
- Offline availability with cached procedure packs
- On-device AI inference via WebGPU (with WASM fallback)
- Provenance display for source attribution at point of use
- Safe degradation when model artefacts are unavailable
Quick Example
Here's how UPAS works at a high level:
// Load cached procedure pack
const pack = await loadProcedurePack({
domain: "emergency-response",
version: "3.2.1",
locale: "en",
});
// Query guidance locally (no network required)
const guidance = await pack.query({
question: "What is the triage protocol?",
context: { role: "field-medic" },
});
// Returns stepwise actions with provenance
console.log(guidance.steps); // Clear action sequence
console.log(guidance.source); // SOP title + version
console.log(guidance.provenance); // Publisher, date, hashCore Components
UPAS is being designed with several core parts:
Offline Runtime
Browser-based PWA with service worker caching. Once procedure packs are cached, UPAS operates entirely offline with no network dependency.
Provenance Layer
Every piece of guidance carries explicit source metadata: publisher, document identity, version, date, and integrity hash. Responders know where guidance comes from.
Stepwise Guidance
Clear, actionable steps with explicit sequencing. Designed to reduce cognitive load and sequencing errors when responders are under pressure.
Procedure Packs
Versioned, offline-capable bundles of SOPs, checklists, and reference materials. Each pack includes embeddings for local semantic search.
Getting Started (Planned)
The following workflow describes the intended user experience for the production release:
Open the PWA
Navigate to the UPAS application URL in a modern browser. WebGPU-capable browsers (Chrome, Edge, Safari) will provide the best performance.
Cache Procedure Packs
On first load, UPAS will download and cache the configured procedure packs. This may take a few minutes depending on pack size and connection speed.
Query Offline
Once cached, you will be able to query guidance without any network connection. The service worker ensures all assets are available locally.
Safety Disclaimer
Important: UPAS is an advisory tool, not a replacement for professional judgement, training, or established command structures. Guidance is derived from cached procedure packs and may not reflect the most recent updates. Always verify critical procedures through authoritative channels when possible.
Runtime Architecture (Prototype)
The prototype uses a progressive enhancement strategy for AI inference:
// Primary path: GPU-accelerated inference via WebLLM
import { CreateMLCEngine } from '@mlc-ai/web-llm';
const engine = await CreateMLCEngine(modelId, {
initProgressCallback: (progress) => {
updateStatus(progress.text);
},
});
// Streaming chat completion
const response = await engine.chat.completions.create({
messages: [{ role: "user", content: prompt }],
stream: true,
});// Fallback path: CPU-based inference via wllama
import { Wllama } from '@wllama/wllama';
const wllama = new Wllama(wasmAssets);
await wllama.loadModelFromUrl(modelUrl);
const result = await wllama.createCompletion(prompt, {
nPredict: 128,
sampling: { temp: 0.7, top_k: 40 },
});// Graceful degradation when AI is unavailable
function showDegradedMode() {
// Show manual navigation interface
showOfflineLibrary();
// Display clear notice
showRuntimeNotice(
"AI-assisted guidance unavailable. " +
"Browse procedures manually."
);
}Procedure Packs
Procedure packs are the core data structure in UPAS:
interface ProcedurePack {
id: string;
version: string;
publisher: string;
publishedAt: Date;
domain: string; // e.g., "wash", "health", "logistics"
locale: string; // e.g., "en", "fr", "ar"
integrity: string; // SHA-256 hash
documents: Document[]; // SOPs, checklists, forms
embeddings: Float32Array; // For local semantic search
}
interface Document {
id: string;
title: string;
type: "sop" | "checklist" | "form" | "reference";
effectiveDate: Date;
content: string;
hash: string;
}Privacy by Design
UPAS is being built for environments with vulnerable populations:
- No prompt exfiltration: Queries never leave the device
- Minimised logging: Operational logs focus on cache health, not query content
- No API keys: No external credentials or server-side processing
- Explicit provenance: Source attribution without tracking user queries
UPAS does not collect, store, or transmit user queries. All inference happens on-device using cached model artefacts and procedure packs.