06.06

Patient memory and digital twin

Executive summary

Patient memory is the longitudinal context Copilot reads: summarised history, extracted items and the timeline of confirmed facts. The digital twin is a per-tooth projection of the patient’s current state, maintained from confirmed facts and completed exams. Both are projections — they never become a source of truth that bypasses clinician confirmation.

Overview

  • ProductionReason · Patient memory and digital twin
    Give every module the patient’s current state and history without re-reading every record, and without promoting anything unconfirmed.

Pipeline

  1. Confirmed facts and completed exams publish events on the fact bus.
  2. The projection worker updates the timeline, per-tooth state and twin.
  3. Memory extraction and summarisation turn conversations and records into memory items and summaries.
  4. Copilot and the HUD read memory and twin as context; twin analyses (change detection, risk estimates, simulation) run on demand as drafts.

Data owned

  • Memory conversations, messages, events, items, summaries
    Holds
    Longitudinal memory and its provenance
  • Digital twins
    Holds
    Per-patient, per-tooth state projection
  • Timeline
    Holds
    Ordered clinical events from confirmed facts

Models and engines

  • Memory extraction and summary
    Model or engine
    Gemini 3 Flash-Lite (flash tier)
    Notes
    Self-hosted Qwen3-8B memory adapter when the worker is enabled
  • Twin change detection, risk estimates, simulation, insights
    Model or engine
    Gemini 3 Flash (pro tier)
    Notes
    Drafts, never facts

Guardrails

  • Projections are rebuilt from confirmed facts; a draft never changes them.
  • Memory summaries are governed artifacts under the same review rules as every other AI output.
  • Timeline dual-read compares the new projection with the legacy timeline before it replaces it.

Rollout and status

  • ProductionMemory and twin projections
    Fed by Scribe and Perio fact writers
  • ShadowTimeline dual-read
    New projection compared against the legacy read

Interfaces

  • Consumes
    What
    Confirmed facts and completed exams
  • Emits
    What
    Patient context for Copilot, HUD and Treatment Planning
SOURCE OF TRUTH
  • server/services/memory/
  • server/services/clinicalFacts/
  • server/db/schema/memory.ts
Every figure in this specification is generated from the repository and checked in CI.