Start with the data funnel and the privacy boundary, then build inward.
Ingestion — the patient's annotated VCF / clinical report is imported onto
the device.
Processing (on-device) — chunk the report and annotated variants → embed each
chunk with a small on-device model → store vectors in sqlite-vec.
Query time (on-device) — embed the user's question → hybrid retrieve (BM25 for
gene/rsID exactness + dense for paraphrase) → optionally re-rank → assemble
the top chunks.
Generation — send {query + retrieved chunk text} to the LLM (on-device model,
or a hosted model under a BAA, or a controlled backend), with a strict
grounding+citation prompt and a clinical-boundary disclaimer. Return a cited
answer; log the call (ids only).
Surround it with eval/observability.
Lead the answer with "raw genome stays on-device; only query+snippets ever leave," because that's the constraint that shapes everything.