docs: update README with detailed flowsheet architecture, nearest relatable matching, and updated diagrams

This commit is contained in:
Abhinav Gupta
2026-10-12 16:44:18 +05:30
parent f8b8b8291d
commit 0256904ee4
5 changed files with 261 additions and 141 deletions
+35 -32
View File
@@ -84,15 +84,18 @@ svg_content = """<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1150"
<text x="0" y="54" font-family="'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="14" font-weight="400" fill="#94a3b8">Deterministic-First LangGraph Workflow &bull; Offline GGUF Inference &bull; Hybrid BM25+FAISS Retrieval &bull; Strict UHDDS Compliance</text>
<!-- Top Badges -->
<g transform="translate(980, 8)">
<rect x="0" y="0" width="140" height="28" rx="14" fill="#0369a1" fill-opacity="0.25" stroke="#38bdf8" stroke-width="1.2"/>
<text x="70" y="18" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#38bdf8" text-anchor="middle">100% AIR-GAPPED</text>
<g transform="translate(930, 8)">
<rect x="0" y="0" width="135" height="28" rx="14" fill="#0369a1" fill-opacity="0.25" stroke="#38bdf8" stroke-width="1.2"/>
<text x="67" y="18" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#38bdf8" text-anchor="middle">100% AIR-GAPPED</text>
<rect x="152" y="0" width="165" height="28" rx="14" fill="#065f46" fill-opacity="0.25" stroke="#34d399" stroke-width="1.2"/>
<text x="234" y="18" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#34d399" text-anchor="middle">ZERO HALLUCINATION</text>
<rect x="145" y="0" width="155" height="28" rx="14" fill="#065f46" fill-opacity="0.25" stroke="#34d399" stroke-width="1.2"/>
<text x="222" y="18" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#34d399" text-anchor="middle">ZERO HALLUCINATION</text>
<rect x="328" y="0" width="170" height="28" rx="14" fill="#581c87" fill-opacity="0.25" stroke="#c084fc" stroke-width="1.2"/>
<text x="413" y="18" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#c084fc" text-anchor="middle">UHDDS &amp; HIPAA VERIFIED</text>
<rect x="310" y="0" width="135" height="28" rx="14" fill="#047857" fill-opacity="0.25" stroke="#10b981" stroke-width="1.2"/>
<text x="377" y="18" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#10b981" text-anchor="middle">199/199 TESTS (100%)</text>
<rect x="455" y="0" width="115" height="28" rx="14" fill="#581c87" fill-opacity="0.25" stroke="#c084fc" stroke-width="1.2"/>
<text x="512" y="18" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#c084fc" text-anchor="middle">UHDDS &amp; HIPAA</text>
</g>
</g>
@@ -249,12 +252,12 @@ svg_content = """<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1150"
<rect x="0" y="0" width="305" height="140" rx="12" fill="#20180a" stroke="#d97706" stroke-width="1.2" filter="url(#shadow)"/>
<rect x="14" y="14" width="70" height="20" rx="4" fill="#d97706" fill-opacity="0.3"/>
<text x="49" y="28" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="700" fill="#fbbf24" text-anchor="middle">CATALOG</text>
<text x="92" y="29" font-family="'Segoe UI', Roboto, sans-serif" font-size="14" font-weight="700" fill="#f8fafc">Local ICD-10 Dataset</text>
<text x="16" y="58" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fde68a">&bull; Official CMS / CDC Order Files</text>
<text x="16" y="78" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fde68a">&bull; Terminal billable leaf codes (HIPAA)</text>
<text x="16" y="98" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fde68a">&bull; Authoritative Excludes1 &amp; Inclusions</text>
<text x="92" y="29" font-family="'Segoe UI', Roboto, sans-serif" font-size="14" font-weight="700" fill="#f8fafc">83,319 Multi-System Records</text>
<text x="16" y="58" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fde68a">&bull; ICD-10-CM: 72,204 Diagnosis Codes</text>
<text x="16" y="78" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fde68a">&bull; ICD-O: 3,347 Morphology Codes</text>
<text x="16" y="98" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fde68a">&bull; CPT: 13,722 Surgical Procedure Codes</text>
<rect x="14" y="108" width="277" height="20" rx="4" fill="#78350f" fill-opacity="0.3"/>
<text x="152" y="122" font-family="'Segoe UI', Roboto, sans-serif" font-size="9.5" font-weight="600" fill="#f59e0b" text-anchor="middle">Zero cloud API &bull; 100% Local Dataset</text>
<text x="152" y="122" font-family="'Segoe UI', Roboto, sans-serif" font-size="9.5" font-weight="600" fill="#f59e0b" text-anchor="middle">Immutable Authority &bull; Database_2.xlsx Verified</text>
</g>
<!-- Down Arrow -->
@@ -284,7 +287,7 @@ svg_content = """<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1150"
<text x="16" y="136" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="600" fill="#fef3c7">Hybrid Fusion Formula:</text>
<text x="16" y="156" font-family="monospace" font-size="10" fill="#fde68a">Score = 0.6*Dense + 0.4*BM25</text>
<text x="16" y="180" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#fde047">&bull; Reciprocal Rank Fusion (RRF)</text>
<text x="16" y="200" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#fde047">&bull; Top-K candidate pool extraction (K=5..10)</text>
<text x="16" y="200" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#fde047">&bull; Prefix filtering narrows candidate pool</text>
<rect x="14" y="214" width="277" height="30" rx="4" fill="#451a03" stroke="#f59e0b" stroke-width="0.8"/>
<text x="152" y="233" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="600" fill="#fed7aa" text-anchor="middle">Catalog Boundary: Out-of-catalog codes purged</text>
@@ -300,15 +303,15 @@ svg_content = """<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1150"
<text x="44" y="28" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="700" fill="#fbbf24" text-anchor="middle">NODE 7</text>
<text x="82" y="29" font-family="'Segoe UI', Roboto, sans-serif" font-size="14" font-weight="700" fill="#f8fafc">rank_candidates</text>
<text x="16" y="58" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fef3c7">&bull; Evaluates candidate pool vs clinical quotes</text>
<text x="16" y="78" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fef3c7">&bull; Aligns clinical specificity (e.g. STEMI)</text>
<text x="16" y="98" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fef3c7">&bull; Computes confidence score &amp; justification</text>
<text x="16" y="78" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fef3c7">&bull; Nearest Relatable Match for unindexed terms</text>
<text x="16" y="98" font-family="'Segoe UI', Roboto, sans-serif" font-size="11.5" fill="#fef3c7">&bull; Preserves documented evidence provenance</text>
<rect x="14" y="114" width="277" height="46" rx="6" fill="#78350f" fill-opacity="0.5" stroke="#f59e0b" stroke-width="1"/>
<text x="152" y="132" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" font-weight="700" fill="#fed7aa" text-anchor="middle">&#10004; CONSTRAINED POOL INVARIANT</text>
<text x="152" y="149" font-family="'Segoe UI', Roboto, sans-serif" font-size="9.5" fill="#ffedd5" text-anchor="middle">Ranker strictly confined to retrieved candidates</text>
<text x="152" y="132" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" font-weight="700" fill="#fed7aa" text-anchor="middle">&#10004; NEAREST RELATABLE MATCH</text>
<text x="152" y="149" font-family="'Segoe UI', Roboto, sans-serif" font-size="9.5" fill="#ffedd5" text-anchor="middle">Assigns closest verified code + NEAREST_MATCH</text>
<text x="16" y="182" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#fde68a">&bull; Rejects out-of-pool choices</text>
<text x="16" y="202" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#fde68a">&bull; Low confidence (&lt;0.65) &rarr; flags for abstention</text>
<text x="16" y="182" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#fde68a">&bull; Rejects out-of-pool hallucinations</text>
<text x="16" y="202" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#fde68a">&bull; Zero match + no evidence &rarr; pure abstention</text>
</g>
</g>
@@ -330,18 +333,18 @@ svg_content = """<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1150"
<text x="44" y="28" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="700" fill="#34d399" text-anchor="middle">NODE 8</text>
<text x="82" y="29" font-family="'Segoe UI', Roboto, sans-serif" font-size="14" font-weight="700" fill="#f8fafc">validate_codes</text>
<rect x="200" y="14" width="90" height="20" rx="4" fill="#047857"/>
<text x="245" y="28" font-family="'Segoe UI', Roboto, sans-serif" font-size="9" font-weight="700" fill="#a7f3d0" text-anchor="middle">100% NON-LLM</text>
<text x="245" y="28" font-family="'Segoe UI', Roboto, sans-serif" font-size="9" font-weight="700" fill="#a7f3d0" text-anchor="middle">6 FIREWALLS</text>
<text x="16" y="58" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#6ee7b7">Deterministic Verification Engine:</text>
<text x="16" y="78" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">Catalog Check:</tspan> Code exists in local ICD dataset</text>
<text x="16" y="96" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">Leaf Specificity:</tspan> Must be terminal billable code</text>
<text x="16" y="78" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">CPT &amp; Procedure Firewalls:</tspan> Segregates surgery</text>
<text x="16" y="96" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">Medication Firewall:</tspan> Prevents drug false positives</text>
<text x="16" y="114" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">Excludes1 Rules:</tspan> Detects mutually exclusive pairs</text>
<text x="16" y="132" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">Duplicate Consolidation:</tspan> Merges duplicate codes</text>
<text x="16" y="150" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">Anti-Hallucination Specificity:</tspan> Demotes over-specific</text>
<text x="16" y="132" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">Leaf Specificity Check:</tspan> Terminal billable HIPAA</text>
<text x="16" y="150" font-family="'Segoe UI', Roboto, sans-serif" font-size="10.5" fill="#d1fae5">&bull; <tspan font-weight="600" fill="#34d399">Organism &amp; Attribute Equivalence:</tspan> Bracket match</text>
<rect x="14" y="172" width="277" height="42" rx="6" fill="#064e3b" stroke="#10b981" stroke-width="0.8"/>
<text x="152" y="188" font-family="'Segoe UI', Roboto, sans-serif" font-size="9.5" font-weight="700" fill="#a7f3d0" text-anchor="middle">AUDIT TRAIL GENERATION</text>
<text x="152" y="204" font-family="'Segoe UI', Roboto, sans-serif" font-size="9" fill="#d1fae5" text-anchor="middle">Every check logs rule code, evidence quote, timestamp</text>
<text x="152" y="188" font-family="'Segoe UI', Roboto, sans-serif" font-size="9.5" font-weight="700" fill="#a7f3d0" text-anchor="middle">AUDIT TRAIL &amp; NEAREST ACCEPTANCE</text>
<text x="152" y="204" font-family="'Segoe UI', Roboto, sans-serif" font-size="9" fill="#d1fae5" text-anchor="middle">Logs rule check, evidence quote, matching status</text>
</g>
<!-- Down Arrow -->
@@ -354,15 +357,15 @@ svg_content = """<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1150"
<text x="44" y="28" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="700" fill="#34d399" text-anchor="middle">NODE 9</text>
<text x="82" y="29" font-family="'Segoe UI', Roboto, sans-serif" font-size="14" font-weight="700" fill="#f8fafc">evaluate_confidence</text>
<text x="16" y="58" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#d1fae5">&bull; Composite Confidence Scoring (Extraction + Retrieval + Ranking)</text>
<text x="16" y="78" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="600" fill="#6ee7b7">Explicit Abstention Engine:</text>
<text x="24" y="98" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" fill="#fca5a5">&bull; INSUFFICIENT_CLINICAL_EVIDENCE</text>
<text x="24" y="114" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" fill="#fca5a5">&bull; MULTIPLE_AMBIGUOUS_PRIMARY</text>
<text x="24" y="130" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" fill="#fca5a5">&bull; SPECIFICITY_REQUIRED / UNSPECIFIED</text>
<text x="16" y="58" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" fill="#d1fae5">&bull; Composite Scoring: Extraction + Retrieval + Validation</text>
<text x="16" y="78" font-family="'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="600" fill="#6ee7b7">Dual Decision Paths:</text>
<text x="24" y="98" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" fill="#a7f3d0">&bull; <tspan font-weight="700" fill="#fef08a">NEAREST_MATCH:</tspan> Validated relatable code</text>
<text x="24" y="114" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" fill="#fca5a5">&bull; <tspan font-weight="700" fill="#fca5a5">PURE ABSTENTION:</tspan> No match &amp; zero evidence</text>
<text x="24" y="130" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" fill="#fca5a5">&bull; MULTIPLE_AMBIGUOUS_PRIMARY</text>
<text x="24" y="146" font-family="'Segoe UI', Roboto, sans-serif" font-size="10" fill="#fca5a5">&bull; EXCLUDES1_CONFLICT_DETECTED</text>
<rect x="14" y="160" width="277" height="22" rx="4" fill="#14532d" stroke="#22c55e" stroke-width="0.8"/>
<text x="152" y="175" font-family="'Segoe UI', Roboto, sans-serif" font-size="9.5" font-weight="600" fill="#bbf7d0" text-anchor="middle">Responsible AI: Refuses to guess under ambiguity</text>
<text x="152" y="175" font-family="'Segoe UI', Roboto, sans-serif" font-size="9.5" font-weight="600" fill="#bbf7d0" text-anchor="middle">Responsible AI: Refuses to hallucinate codes</text>
</g>
<!-- Down Arrow -->