Rakesh commited on
Commit
bc1bb5c
·
verified ·
1 Parent(s): e0b6db2

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +1154 -19
index.html CHANGED
@@ -1,19 +1,1154 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Pharmaceutical AI Agent - Visual Architecture Flows</title>
7
+ <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
8
+ <style>
9
+ * {
10
+ margin: 0;
11
+ padding: 0;
12
+ box-sizing: border-box;
13
+ }
14
+
15
+ body {
16
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
17
+ line-height: 1.6;
18
+ color: #333;
19
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
20
+ min-height: 100vh;
21
+ }
22
+
23
+ .container {
24
+ max-width: 1400px;
25
+ margin: 0 auto;
26
+ padding: 20px;
27
+ }
28
+
29
+ .header {
30
+ text-align: center;
31
+ margin-bottom: 40px;
32
+ background: rgba(255, 255, 255, 0.95);
33
+ padding: 30px;
34
+ border-radius: 15px;
35
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
36
+ }
37
+
38
+ .header h1 {
39
+ color: #2c3e50;
40
+ font-size: 2.5em;
41
+ margin-bottom: 10px;
42
+ background: linear-gradient(45deg, #667eea, #764ba2);
43
+ -webkit-background-clip: text;
44
+ -webkit-text-fill-color: transparent;
45
+ background-clip: text;
46
+ }
47
+
48
+ .header p {
49
+ color: #7f8c8d;
50
+ font-size: 1.2em;
51
+ max-width: 800px;
52
+ margin: 0 auto;
53
+ }
54
+
55
+ .navigation {
56
+ display: flex;
57
+ justify-content: center;
58
+ flex-wrap: wrap;
59
+ gap: 15px;
60
+ margin-bottom: 40px;
61
+ }
62
+
63
+ .nav-btn {
64
+ background: linear-gradient(45deg, #667eea, #764ba2);
65
+ color: white;
66
+ border: none;
67
+ padding: 12px 25px;
68
+ border-radius: 25px;
69
+ cursor: pointer;
70
+ font-size: 16px;
71
+ font-weight: 600;
72
+ transition: all 0.3s ease;
73
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
74
+ }
75
+
76
+ .nav-btn:hover {
77
+ transform: translateY(-2px);
78
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
79
+ }
80
+
81
+ .nav-btn.active {
82
+ background: linear-gradient(45deg, #2c3e50, #34495e);
83
+ transform: translateY(-2px);
84
+ }
85
+
86
+ .flow-section {
87
+ display: none;
88
+ background: rgba(255, 255, 255, 0.95);
89
+ border-radius: 15px;
90
+ padding: 30px;
91
+ margin-bottom: 30px;
92
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
93
+ }
94
+
95
+ .flow-section.active {
96
+ display: block;
97
+ animation: fadeIn 0.5s ease-in;
98
+ }
99
+
100
+ @keyframes fadeIn {
101
+ from { opacity: 0; transform: translateY(20px); }
102
+ to { opacity: 1; transform: translateY(0); }
103
+ }
104
+
105
+ .flow-title {
106
+ color: #2c3e50;
107
+ font-size: 2em;
108
+ margin-bottom: 15px;
109
+ text-align: center;
110
+ border-bottom: 3px solid #667eea;
111
+ padding-bottom: 10px;
112
+ }
113
+
114
+ .flow-description {
115
+ background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
116
+ padding: 20px;
117
+ border-radius: 10px;
118
+ margin-bottom: 25px;
119
+ border-left: 5px solid #667eea;
120
+ }
121
+
122
+ .flow-description h3 {
123
+ color: #2c3e50;
124
+ margin-bottom: 10px;
125
+ font-size: 1.3em;
126
+ }
127
+
128
+ .flow-description ul {
129
+ margin-left: 20px;
130
+ }
131
+
132
+ .flow-description li {
133
+ margin-bottom: 5px;
134
+ color: #555;
135
+ }
136
+
137
+ .mermaid-container {
138
+ background: white;
139
+ border-radius: 10px;
140
+ padding: 20px;
141
+ margin: 20px 0;
142
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
143
+ overflow-x: auto;
144
+ }
145
+
146
+ .key-features {
147
+ display: grid;
148
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
149
+ gap: 20px;
150
+ margin-top: 30px;
151
+ }
152
+
153
+ .feature-card {
154
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
155
+ color: white;
156
+ padding: 20px;
157
+ border-radius: 10px;
158
+ text-align: center;
159
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
160
+ }
161
+
162
+ .feature-card h4 {
163
+ margin-bottom: 10px;
164
+ font-size: 1.2em;
165
+ }
166
+
167
+ .feature-card p {
168
+ font-size: 0.9em;
169
+ opacity: 0.9;
170
+ }
171
+
172
+ .stats-grid {
173
+ display: grid;
174
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
175
+ gap: 20px;
176
+ margin: 30px 0;
177
+ }
178
+
179
+ .stat-card {
180
+ background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
181
+ color: white;
182
+ padding: 20px;
183
+ border-radius: 10px;
184
+ text-align: center;
185
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
186
+ }
187
+
188
+ .stat-number {
189
+ font-size: 2.5em;
190
+ font-weight: bold;
191
+ margin-bottom: 5px;
192
+ }
193
+
194
+ .stat-label {
195
+ font-size: 0.9em;
196
+ opacity: 0.9;
197
+ }
198
+
199
+ .footer {
200
+ text-align: center;
201
+ margin-top: 50px;
202
+ padding: 30px;
203
+ background: rgba(255, 255, 255, 0.95);
204
+ border-radius: 15px;
205
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
206
+ }
207
+
208
+ .footer h3 {
209
+ color: #2c3e50;
210
+ margin-bottom: 15px;
211
+ }
212
+
213
+ .footer p {
214
+ color: #7f8c8d;
215
+ max-width: 600px;
216
+ margin: 0 auto;
217
+ }
218
+
219
+ @media (max-width: 768px) {
220
+ .container {
221
+ padding: 10px;
222
+ }
223
+
224
+ .header h1 {
225
+ font-size: 2em;
226
+ }
227
+
228
+ .navigation {
229
+ flex-direction: column;
230
+ align-items: center;
231
+ }
232
+
233
+ .nav-btn {
234
+ width: 200px;
235
+ }
236
+ }
237
+ </style>
238
+ </head>
239
+ <body>
240
+ <div class="container">
241
+ <!-- Header -->
242
+ <div class="header">
243
+ <h1>🧬 Pharmaceutical AI Agent</h1>
244
+ <p>Comprehensive Visual Architecture Flows for Medical Affairs Research System</p>
245
+ </div>
246
+
247
+ <!-- Navigation -->
248
+ <div class="navigation">
249
+ <button class="nav-btn active" onclick="showFlow('complete')">🔄 Complete System Flow</button>
250
+ <button class="nav-btn" onclick="showFlow('user')">👤 User Journey Flow</button>
251
+ <button class="nav-btn" onclick="showFlow('technical')">⚙️ Technical Architecture</button>
252
+ <button class="nav-btn" onclick="showFlow('data')">📊 Data Flow Diagram</button>
253
+ </div>
254
+
255
+ <!-- Complete System Flow -->
256
+ <div id="complete" class="flow-section active">
257
+ <h2 class="flow-title">🔄 Complete System Flow</h2>
258
+ <div class="flow-description">
259
+ <h3>📋 Overview</h3>
260
+ <p>This comprehensive diagram shows the complete end-to-end journey from user input to final report delivery, including all system components and their interactions.</p>
261
+ <ul>
262
+ <li><strong>User Interface Steps:</strong> Molecule selection → Indication discovery → Country selection</li>
263
+ <li><strong>Backend Processing:</strong> Multi-agent analysis → Independent sections → Quality assurance</li>
264
+ <li><strong>Technical Infrastructure:</strong> Session management → LLM integration → Storage systems</li>
265
+ <li><strong>Quality Control:</strong> Citation verification → Medical review → Compliance checks</li>
266
+ </ul>
267
+ </div>
268
+ <div class="mermaid-container">
269
+ <div class="mermaid">
270
+ graph TD
271
+ %% User Interface Layer
272
+ A[User Login] --> B[New Analysis Dashboard]
273
+ B --> C[Molecule Selection]
274
+
275
+ %% Step 1: Molecule Selection
276
+ C --> D{Select Data Source}
277
+ D -->|GBQ Database| E[GBQ Molecule Search]
278
+ D -->|DailyMed FDA| F[FDA Label Search]
279
+ E --> G[Molecule: Empagliflozin Selected]
280
+ F --> G
281
+
282
+ %% Step 2: Indication Discovery
283
+ G --> H[AI Discovers Related Indications]
284
+ H --> I[User Selects Indications]
285
+ I --> J["Selected: Type 2 Diabetes<br/>Heart Failure<br/>Chronic Kidney Disease"]
286
+
287
+ %% Step 3: Drug Class & Product Comparison
288
+ J --> K[AI Suggests Comparisons]
289
+ K --> L[Drug Class Comparison]
290
+ K --> M[Product Comparison]
291
+ L --> N["GLP-1 Agonists<br/>SGLT2 Inhibitors<br/>DPP4 Inhibitors"]
292
+ M --> O["Dapagliflozin<br/>Canagliflozin<br/>Ertugliflozin"]
293
+
294
+ %% Step 4: Multi-Country Guidelines
295
+ N --> P[Select Countries]
296
+ O --> P
297
+ P --> Q["United States: ADA Guidelines<br/>Europe: ESC Guidelines<br/>China: CDS Guidelines<br/>India: RSSDI Guidelines<br/>Russia: RDA Guidelines"]
298
+
299
+ %% Step 5: Clinical Studies
300
+ Q --> R[AI Discovers Clinical Studies]
301
+ R --> S["Study 1: EMPA-REG OUTCOME<br/>Study 2: CANVAS Program<br/>Study 3: CREDENCE<br/>Study 4: EMPEROR-Reduced<br/>Study 5: DAPA-HF<br/>Study 6: VERTIS CV"]
302
+
303
+ %% Step 6: Document Corpus Formation
304
+ S --> T[Document Corpus Created]
305
+ T --> U["Total Documents: 247<br/>Data Size: 2.8 GB<br/>Processing Time: 45 min"]
306
+
307
+ %% Backend Processing Architecture
308
+ U --> V[Long-Running Session Created]
309
+ V --> W[Background Processing Starts]
310
+
311
+ %% Document Processing Pipeline
312
+ W --> X[Multi-Method Document Processing]
313
+ X --> Y[OCR Extraction]
314
+ X --> Z[Vision LLM Analysis]
315
+ X --> AA[PDF Structure Parsing]
316
+ X --> BB[Table Extraction]
317
+
318
+ Y --> CC[Consensus Validation]
319
+ Z --> CC
320
+ AA --> CC
321
+ BB --> CC
322
+
323
+ %% Multi-Agent Analysis
324
+ CC --> DD[6 Specialized Agents Activated]
325
+
326
+ %% Track A - Clinical Focus
327
+ DD --> EE[Track A: Clinical Analysis]
328
+ EE --> FF[Efficacy Analysis Agent]
329
+ EE --> GG[Safety Profile Agent]
330
+ EE --> HH[Clinical Evidence Agent]
331
+
332
+ %% Track B - Strategic Focus
333
+ DD --> II[Track B: Strategic Analysis]
334
+ II --> JJ[Competitive Landscape Agent]
335
+ II --> KK[Regulatory Guidelines Agent]
336
+ II --> LL[Market Access Agent]
337
+
338
+ %% LLM Processing
339
+ FF --> MM[Claude Opus<br/>Medical Reasoning]
340
+ GG --> NN[Claude Opus<br/>Safety Analysis]
341
+ HH --> OO[Claude Sonnet<br/>Evidence Synthesis]
342
+ JJ --> PP[GPT-4<br/>Competitive Analysis]
343
+ KK --> QQ[Claude Sonnet<br/>Regulatory Review]
344
+ LL --> RR[Gemini Pro<br/>Market Analysis]
345
+
346
+ %% Independent Section Generation
347
+ MM --> SS[Independent Section: Efficacy]
348
+ NN --> TT[Independent Section: Safety]
349
+ OO --> UU[Independent Section: Evidence]
350
+ PP --> VV[Independent Section: Competitive]
351
+ QQ --> WW[Independent Section: Regulatory]
352
+ RR --> XX[Independent Section: Market Access]
353
+
354
+ %% Cross-Validation
355
+ SS --> YY[Cross-Track Validation]
356
+ TT --> YY
357
+ UU --> YY
358
+ VV --> YY
359
+ WW --> YY
360
+ XX --> YY
361
+
362
+ %% Citation Verification
363
+ YY --> ZZ[Citation Integrity Check]
364
+ ZZ --> AAA[99% Citation Accuracy Verified]
365
+
366
+ %% Report Stitching
367
+ AAA --> BBB[Intelligent Report Stitching]
368
+ BBB --> CCC[Consistency Check]
369
+ BBB --> DDD[Transition Generation]
370
+ BBB --> EEE[Executive Summary Creation]
371
+
372
+ CCC --> FFF[Final Report Assembly]
373
+ DDD --> FFF
374
+ EEE --> FFF
375
+
376
+ %% Quality Assurance
377
+ FFF --> GGG[Quality Assurance System]
378
+ GGG --> HHH[Medical Accuracy Review]
379
+ GGG --> III[Regulatory Compliance Check]
380
+ GGG --> JJJ[Statistical Validation]
381
+ GGG --> KKK[Language Quality Check]
382
+
383
+ HHH --> LLL{QA Score > 90%?}
384
+ III --> LLL
385
+ JJJ --> LLL
386
+ KKK --> LLL
387
+
388
+ LLL -->|No| MMM[Human Expert Review]
389
+ LLL -->|Yes| NNN[Report Ready for Delivery]
390
+ MMM --> NNN
391
+
392
+ %% Final Delivery
393
+ NNN --> OOO[Multi-Format Report Generation]
394
+ OOO --> PPP[PDF Report]
395
+ OOO --> QQQ[Excel Data Tables]
396
+ OOO --> RRR[Interactive Dashboard]
397
+
398
+ %% User Notification
399
+ PPP --> SSS[User Notification]
400
+ QQQ --> SSS
401
+ RRR --> SSS
402
+ SSS --> TTT[Analysis Complete<br/>Ready for Download]
403
+
404
+ %% Progress Tracking (Parallel Process)
405
+ V --> UUU[Real-Time Progress Tracking]
406
+ UUU --> VVV["Progress: 0% - Initialization<br/>Progress: 25% - Document Collection<br/>Progress: 50% - Processing<br/>Progress: 75% - Analysis<br/>Progress: 100% - Complete"]
407
+
408
+ %% Error Handling & Recovery
409
+ W --> WWW[Session Monitoring]
410
+ WWW --> XXX{Session Healthy?}
411
+ XXX -->|No| YYY[Auto-Recovery]
412
+ XXX -->|Yes| ZZZ[Continue Processing]
413
+ YYY --> ZZZ
414
+
415
+ %% Data Storage Architecture
416
+ T --> AAAA[Distributed Storage]
417
+ AAAA --> BBBB[Redis: Session Metadata]
418
+ AAAA --> CCCC[PostgreSQL: Persistence]
419
+ AAAA --> DDDD[MinIO: Large Documents]
420
+
421
+ %% Styling
422
+ classDef userInterface fill:#e1f5fe,stroke:#01579b,stroke-width:2px
423
+ classDef dataSource fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
424
+ classDef processing fill:#e8f5e8,stroke:#1b5e20,stroke-width:2px
425
+ classDef aiAgent fill:#fff3e0,stroke:#e65100,stroke-width:2px
426
+ classDef llmModel fill:#fce4ec,stroke:#880e4f,stroke-width:2px
427
+ classDef quality fill:#f1f8e9,stroke:#33691e,stroke-width:2px
428
+ classDef storage fill:#e3f2fd,stroke:#0d47a1,stroke-width:2px
429
+ classDef output fill:#f9fbe7,stroke:#827717,stroke-width:2px
430
+
431
+ class A,B,C,I,P userInterface
432
+ class D,E,F,G dataSource
433
+ class X,Y,Z,AA,BB,CC,W processing
434
+ class FF,GG,HH,JJ,KK,LL,DD,EE,II aiAgent
435
+ class MM,NN,OO,PP,QQ,RR llmModel
436
+ class GGG,HHH,III,JJJ,KKK,LLL,MMM quality
437
+ class AAAA,BBBB,CCCC,DDDD storage
438
+ class PPP,QQQ,RRR,TTT output
439
+ </div>
440
+ </div>
441
+ <div class="stats-grid">
442
+ <div class="stat-card">
443
+ <div class="stat-number">247</div>
444
+ <div class="stat-label">Documents Processed</div>
445
+ </div>
446
+ <div class="stat-card">
447
+ <div class="stat-number">2.8GB</div>
448
+ <div class="stat-label">Data Volume</div>
449
+ </div>
450
+ <div class="stat-card">
451
+ <div class="stat-number">6</div>
452
+ <div class="stat-label">Specialized Agents</div>
453
+ </div>
454
+ <div class="stat-card">
455
+ <div class="stat-number">99%</div>
456
+ <div class="stat-label">Citation Accuracy</div>
457
+ </div>
458
+ </div>
459
+ </div>
460
+
461
+ <!-- User Journey Flow -->
462
+ <div id="user" class="flow-section">
463
+ <h2 class="flow-title">👤 User Journey Flow</h2>
464
+ <div class="flow-description">
465
+ <h3>🎯 Detailed 7-Step User Journey</h3>
466
+ <p>This diagram shows the complete user workflow with dynamic corpus expansion and multi-source data integration.</p>
467
+ <ul>
468
+ <li><strong>Step 1:</strong> User enters molecule name (GBQ + FDA/DailyMed)</li>
469
+ <li><strong>Step 2:</strong> LLM discovers indications → User multi-selects</li>
470
+ <li><strong>Step 3:</strong> System populates drug class + similar molecules</li>
471
+ <li><strong>Step 4:</strong> Corpus auto-expands with similar molecule data</li>
472
+ <li><strong>Step 5:</strong> LLM searches 5-region guidelines + User fills gaps</li>
473
+ <li><strong>Step 6:</strong> Clinical studies categorized → User selects</li>
474
+ <li><strong>Step 7:</strong> Full analysis engine launches → Multi-format reports</li>
475
+ </ul>
476
+ </div>
477
+ <div class="mermaid-container">
478
+ <div class="mermaid">
479
+ graph TD
480
+ %% Detailed 7-Step User Journey Flow
481
+ A[👤 User Login] --> B[🏠 Dashboard]
482
+
483
+ %% Step 1: Molecule Entry
484
+ B --> C1[📝 Step 1: Enter Molecule Name]
485
+ C1 --> C2[🔍 Search GBQ + FDA/DailyMed]
486
+ C2 --> C3[💊 Empagliflozin Found]
487
+
488
+ %% Step 2: Indication Discovery
489
+ C3 --> D1[🧠 Step 2: LLM Discovers Indications]
490
+ D1 --> D2[📋 AI Analysis:<br/>• Inherent Knowledge<br/>• GBQ Corpus<br/>• FDA Data]
491
+ D2 --> D3[✅ User Multi-Selects:<br/>• Type 2 Diabetes<br/>• Heart Failure<br/>• CKD]
492
+
493
+ %% Step 3: Drug Class & Product Comparison
494
+ D3 --> E1[⚖️ Step 3: System Populates]
495
+ E1 --> E2[🏷️ Drug Class: SGLT2 Inhibitors]
496
+ E2 --> E3[🔄 Similar Molecules:<br/>• Dapagliflozin<br/>• Canagliflozin<br/>• Ertugliflozin]
497
+
498
+ %% Step 4: Corpus Auto-Expansion
499
+ E3 --> F1[📈 Step 4: Corpus Auto-Expands]
500
+ F1 --> F2[🔄 Parallel Data Collection]
501
+ F2 --> F3[📚 Similar Molecule Data Added<br/>from GBQ + FDA]
502
+
503
+ %% Step 5: Geographic Guidelines
504
+ F3 --> G1[🌍 Step 5: Geographic Guidelines]
505
+ G1 --> G2[🔍 LLM Web Search:<br/>• US • EU • APAC<br/>• LATAM • MEA]
506
+ G2 --> G3[📤 User Uploads Gap Documents]
507
+ G3 --> G4[📋 5-Region Guidelines Complete]
508
+
509
+ %% Step 6: Clinical Studies
510
+ G4 --> H1[📊 Step 6: Clinical Studies]
511
+ H1 --> H2[🔍 Web Search + Categorization]
512
+ H2 --> H3[📑 Categories:<br/>• Phase I/II/III<br/>• RWE • Meta-Analyses<br/>• Safety • Efficacy]
513
+ H3 --> H4[✅ User Selects Studies]
514
+
515
+ %% Step 7: Full Analysis
516
+ H4 --> I1[🚀 Step 7: Analysis Engine Launches]
517
+ I1 --> I2[🤖 Multi-Agent Processing<br/>Vertex AI + Azure AI + Claude]
518
+ I2 --> I3[📈 Progress Tracking 0-100%]
519
+ I3 --> I4[📋 Multi-Format Reports<br/>PDF • XML • Interactive]
520
+
521
+ %% Styling
522
+ classDef step fill:#e3f2fd,stroke:#1976d2,stroke-width:3px
523
+ classDef llm fill:#fff3e0,stroke:#f57c00,stroke-width:2px
524
+ classDef user fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px
525
+ classDef system fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
526
+ classDef final fill:#ffebee,stroke:#c62828,stroke-width:3px
527
+
528
+ class C1,D1,E1,F1,G1,H1,I1 step
529
+ class D2,G2,H2,I2 llm
530
+ class D3,G3,H4 user
531
+ class E2,E3,F2,F3,G4,H3 system
532
+ class I4 final
533
+
534
+ class A,B start
535
+ class C,D,E,F,G,H,I selection
536
+ class J,K processing
537
+ class L,M,N,O progress
538
+ class P,Q,R,S,T complete
539
+ </div>
540
+ </div>
541
+ <div class="key-features">
542
+ <div class="feature-card">
543
+ <h4>🎯 Intelligent Suggestions</h4>
544
+ <p>AI automatically discovers relevant indications and suggests optimal comparisons</p>
545
+ </div>
546
+ <div class="feature-card">
547
+ <h4>🌍 Global Coverage</h4>
548
+ <p>Multi-country regulatory guidelines and approval status tracking</p>
549
+ </div>
550
+ <div class="feature-card">
551
+ <h4>📈 Real-Time Progress</h4>
552
+ <p>Live updates on analysis progress with detailed status information</p>
553
+ </div>
554
+ <div class="feature-card">
555
+ <h4>📋 Multiple Formats</h4>
556
+ <p>Professional reports in PDF, Excel, and interactive dashboard formats</p>
557
+ </div>
558
+ </div>
559
+ </div>
560
+
561
+ <!-- Technical Architecture -->
562
+ <div id="technical" class="flow-section">
563
+ <h2 class="flow-title">⚙️ Technical Architecture Flow</h2>
564
+ <div class="flow-description">
565
+ <h3>🏗️ Backend System Architecture</h3>
566
+ <p>This diagram shows the comprehensive backend system architecture with all technical components and their interactions.</p>
567
+ <ul>
568
+ <li><strong>Frontend Layer:</strong> React dashboard + REST API gateway</li>
569
+ <li><strong>Session Management:</strong> Redis + PostgreSQL + MinIO for GB-scale data</li>
570
+ <li><strong>Multi-Agent System:</strong> 6 specialized agents with parallel processing tracks</li>
571
+ <li><strong>Quality Assurance:</strong> Citation validation + medical review + compliance checks</li>
572
+ <li><strong>Background Processing:</strong> Celery workers for long-running analytical tasks</li>
573
+ </ul>
574
+ </div>
575
+ <div class="mermaid-container">
576
+ <div class="mermaid">
577
+ graph TB
578
+ %% Frontend Layer
579
+ subgraph "Frontend Layer"
580
+ UI[React Dashboard]
581
+ API[REST API Gateway]
582
+ end
583
+
584
+ %% Session Management Layer
585
+ subgraph "Session Management"
586
+ SM[Session Manager]
587
+ Redis[(Redis Cache)]
588
+ PG[(PostgreSQL)]
589
+ MinIO[(MinIO Storage)]
590
+ end
591
+
592
+ %% Data Sources Layer
593
+ subgraph "Data Sources"
594
+ GBQ[Google BigQuery]
595
+ DM[DailyMed API]
596
+ GL[Guidelines Sources]
597
+ CS[Clinical Studies]
598
+ end
599
+
600
+ %% LLM Integration Layer
601
+ subgraph "LLM Integration"
602
+ LM[LiteLLM Manager]
603
+ GPT[OpenAI GPT-4]
604
+ Claude[Vertex AI Claude]
605
+ Gemini[Vertex AI Gemini]
606
+ GSDK[Google AI SDK]
607
+ end
608
+
609
+ %% Processing Layer
610
+ subgraph "Document Processing"
611
+ DP[Document Processor]
612
+ OCR[OCR Engine]
613
+ VLM[Vision LLM]
614
+ TE[Table Extractor]
615
+ CV[Consensus Validator]
616
+ end
617
+
618
+ %% Multi-Agent System
619
+ subgraph "Multi-Agent System"
620
+ direction TB
621
+ AO[Agent Orchestrator]
622
+
623
+ subgraph "Track A - Clinical"
624
+ EA[Efficacy Agent]
625
+ SA[Safety Agent]
626
+ CE[Evidence Agent]
627
+ end
628
+
629
+ subgraph "Track B - Strategic"
630
+ CA[Competitive Agent]
631
+ RA[Regulatory Agent]
632
+ MA[Market Access Agent]
633
+ end
634
+ end
635
+
636
+ %% Independent Section Generation
637
+ subgraph "Section Generation"
638
+ ISG[Independent Section Generator]
639
+ ES[Efficacy Section]
640
+ SS[Safety Section]
641
+ CS2[Competitive Section]
642
+ RS[Regulatory Section]
643
+ EVS[Evidence Section]
644
+ MAS[Market Section]
645
+ end
646
+
647
+ %% Quality Assurance
648
+ subgraph "Quality Assurance"
649
+ QAS[QA System]
650
+ CV2[Citation Validator]
651
+ MR[Medical Reviewer]
652
+ RC[Regulatory Compliance]
653
+ HR[Human Review Queue]
654
+ end
655
+
656
+ %% Report Generation
657
+ subgraph "Report Generation"
658
+ IRS[Intelligent Report Stitcher]
659
+ CC[Consistency Checker]
660
+ TG[Transition Generator]
661
+ ESG[Executive Summary Generator]
662
+ RF[Report Formatter]
663
+ end
664
+
665
+ %% Background Processing
666
+ subgraph "Background Processing"
667
+ Celery[Celery Workers]
668
+ TaskQueue[Task Queue]
669
+ Monitor[Session Monitor]
670
+ end
671
+
672
+ %% Flow Connections
673
+ UI --> API
674
+ API --> SM
675
+ SM --> Redis
676
+ SM --> PG
677
+ SM --> MinIO
678
+
679
+ %% Data Collection
680
+ SM --> GBQ
681
+ SM --> DM
682
+ SM --> GL
683
+ SM --> CS
684
+
685
+ %% Document Processing Flow
686
+ GBQ --> DP
687
+ DM --> DP
688
+ GL --> DP
689
+ CS --> DP
690
+
691
+ DP --> OCR
692
+ DP --> VLM
693
+ DP --> TE
694
+ OCR --> CV
695
+ VLM --> CV
696
+ TE --> CV
697
+
698
+ %% LLM Integration
699
+ CV --> LM
700
+ LM --> GPT
701
+ LM --> Claude
702
+ LM --> Gemini
703
+ LM --> GSDK
704
+
705
+ %% Agent Processing
706
+ LM --> AO
707
+ AO --> EA
708
+ AO --> SA
709
+ AO --> CE
710
+ AO --> CA
711
+ AO --> RA
712
+ AO --> MA
713
+
714
+ %% Section Generation
715
+ EA --> ISG
716
+ SA --> ISG
717
+ CE --> ISG
718
+ CA --> ISG
719
+ RA --> ISG
720
+ MA --> ISG
721
+
722
+ ISG --> ES
723
+ ISG --> SS
724
+ ISG --> CS2
725
+ ISG --> RS
726
+ ISG --> EVS
727
+ ISG --> MAS
728
+
729
+ %% Quality Assurance Flow
730
+ ES --> QAS
731
+ SS --> QAS
732
+ CS2 --> QAS
733
+ RS --> QAS
734
+ EVS --> QAS
735
+ MAS --> QAS
736
+
737
+ QAS --> CV2
738
+ QAS --> MR
739
+ QAS --> RC
740
+ QAS --> HR
741
+
742
+ %% Report Generation Flow
743
+ QAS --> IRS
744
+ IRS --> CC
745
+ IRS --> TG
746
+ IRS --> ESG
747
+ CC --> RF
748
+ TG --> RF
749
+ ESG --> RF
750
+
751
+ %% Background Processing
752
+ SM --> Celery
753
+ Celery --> TaskQueue
754
+ TaskQueue --> Monitor
755
+ Monitor --> API
756
+
757
+ %% Final Output
758
+ RF --> MinIO
759
+ MinIO --> API
760
+ API --> UI
761
+
762
+ %% Styling
763
+ classDef frontend fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
764
+ classDef session fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
765
+ classDef data fill:#e8f5e8,stroke:#388e3c,stroke-width:2px
766
+ classDef llm fill:#fff3e0,stroke:#f57c00,stroke-width:2px
767
+ classDef processing fill:#fce4ec,stroke:#c2185b,stroke-width:2px
768
+ classDef agents fill:#e0f2f1,stroke:#00695c,stroke-width:2px
769
+ classDef quality fill:#f1f8e9,stroke:#558b2f,stroke-width:2px
770
+ classDef background fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
771
+
772
+ class UI,API frontend
773
+ class SM,Redis,PG,MinIO session
774
+ class GBQ,DM,GL,CS data
775
+ class LM,GPT,Claude,Gemini,GSDK llm
776
+ class DP,OCR,VLM,TE,CV processing
777
+ class AO,EA,SA,CE,CA,RA,MA agents
778
+ class QAS,CV2,MR,RC,HR quality
779
+ class Celery,TaskQueue,Monitor background
780
+ </div>
781
+ </div>
782
+ <div class="key-features">
783
+ <div class="feature-card">
784
+ <h4>🚀 Scalable Architecture</h4>
785
+ <p>Microservices-based design with horizontal scaling capabilities</p>
786
+ </div>
787
+ <div class="feature-card">
788
+ <h4>🔄 Parallel Processing</h4>
789
+ <p>Multi-track agent processing for enhanced speed and accuracy</p>
790
+ </div>
791
+ <div class="feature-card">
792
+ <h4>💾 Distributed Storage</h4>
793
+ <p>Redis, PostgreSQL, and MinIO for optimal data management</p>
794
+ </div>
795
+ <div class="feature-card">
796
+ <h4>🤖 Multi-LLM Integration</h4>
797
+ <p>LiteLLM for seamless integration with GPT-4, Claude, and Gemini</p>
798
+ </div>
799
+ </div>
800
+ </div>
801
+
802
+ <!-- Data Flow Diagram -->
803
+ <div id="data" class="flow-section">
804
+ <h2 class="flow-title">📊 Data Flow Diagram</h2>
805
+ <div class="flow-description">
806
+ <h3>📈 Dynamic Corpus Expansion & Processing Pipeline</h3>
807
+ <p>This diagram shows how the corpus dynamically expands at multiple stages and data flows through progressive transformations.</p>
808
+ <ul>
809
+ <li><strong>Stage 1-2:</strong> Initial molecule + indication data collection</li>
810
+ <li><strong>Stage 4:</strong> Auto-expansion with similar molecule data</li>
811
+ <li><strong>Stage 5:</strong> Geographic guideline collection (5 regions)</li>
812
+ <li><strong>Stage 6:</strong> Clinical studies categorization and selection</li>
813
+ <li><strong>Processing:</strong> Multi-method extraction with web-grounded search</li>
814
+ <li><strong>Analysis:</strong> Multi-agent processing with cross-validation</li>
815
+ </ul>
816
+ </div>
817
+ <div class="mermaid-container">
818
+ <div class="mermaid">
819
+ flowchart TD
820
+ %% Stage 1-2: Initial Data
821
+ subgraph "Stage 1-2: Initial Corpus"
822
+ USER["👤 User Input:<br/>Molecule: Empagliflozin"]
823
+ IND["🧠 LLM Discovers Indications:<br/>T2D, HF, CKD"]
824
+ INIT["📚 Initial Corpus:<br/>GBQ: 25 docs<br/>FDA: 8 docs"]
825
+ end
826
+
827
+ %% Stage 4: Similar Molecules
828
+ subgraph "Stage 4: Auto-Expansion"
829
+ SIM["🔄 Similar Molecules Found:<br/>Dapagliflozin, Canagliflozin<br/>Ertugliflozin"]
830
+ EXP1["📈 Corpus Expands:<br/>+45 GBQ docs<br/>+12 FDA labels"]
831
+ CORPUS1["📚 Expanded Corpus: 90 docs"]
832
+ end
833
+
834
+ %% Stage 5: Geographic Guidelines
835
+ subgraph "Stage 5: Geographic Guidelines"
836
+ GEO["🌍 5-Region Search:<br/>US • EU • APAC • LATAM • MEA"]
837
+ WEB1["🔍 Web Search + Scrapers"]
838
+ GAPS["📤 User Fills Gaps"]
839
+ GUIDE["📋 Guidelines Added:<br/>+85 documents"]
840
+ end
841
+
842
+ %% Stage 6: Clinical Studies
843
+ subgraph "Stage 6: Clinical Studies"
844
+ CLIN["📊 Web Search Clinical Studies"]
845
+ CAT["📑 AI Categorization:<br/>Phase I/II/III • RWE<br/>Safety • Efficacy"]
846
+ SEL["✅ User Selection"]
847
+ STUD["📈 Studies Added:<br/>+67 documents"]
848
+ end
849
+
850
+ %% Final Corpus
851
+ subgraph "Complete Corpus"
852
+ FINAL_CORPUS["📚 Final Corpus:<br/>242 Documents • 2.8 GB<br/>Multi-Source • Multi-Format"]
853
+ end
854
+
855
+ %% Document Processing
856
+ subgraph "Processing Phase"
857
+ PROC["🔄 Multi-Method Processing"]
858
+ TEXT["📝 Text Extraction"]
859
+ TABLES["📊 Table Data: 156 tables"]
860
+ IMAGES["🖼️ Image Analysis: 89 figures"]
861
+ META["🏷️ Metadata: Citations, Sources"]
862
+ CORPUS["📚 Structured Corpus<br/>Ready for Analysis"]
863
+ end
864
+
865
+ %% AI Analysis
866
+ subgraph "AI Analysis Phase"
867
+ AGENTS["🤖 6 Specialized Agents"]
868
+
869
+ subgraph "Clinical Track"
870
+ EFF["💊 Efficacy Data:<br/>Primary endpoints<br/>Secondary outcomes<br/>Subgroup analyses"]
871
+ SAF["⚠️ Safety Data:<br/>Adverse events<br/>Laboratory values<br/>Drug interactions"]
872
+ EVI["📈 Evidence Synthesis:<br/>Meta-analyses<br/>Real-world data<br/>Quality assessment"]
873
+ end
874
+
875
+ subgraph "Strategic Track"
876
+ COMP["⚖️ Competitive Analysis:<br/>Market positioning<br/>Head-to-head comparisons<br/>Pricing strategies"]
877
+ REG["🏛️ Regulatory Status:<br/>Approval timelines<br/>Label differences<br/>Guidelines positioning"]
878
+ MKT["💼 Market Access:<br/>Reimbursement status<br/>Health economics<br/>Payer perspectives"]
879
+ end
880
+ end
881
+
882
+ %% Section Generation
883
+ subgraph "Section Generation"
884
+ INDEP["🔒 Independent Sections"]
885
+ SEC1["📋 Efficacy Section<br/>12 pages, 45 citations"]
886
+ SEC2["📋 Safety Section<br/>8 pages, 32 citations"]
887
+ SEC3["📋 Competitive Section<br/>10 pages, 28 citations"]
888
+ SEC4["📋 Regulatory Section<br/>15 pages, 67 citations"]
889
+ SEC5["📋 Evidence Section<br/>9 pages, 38 citations"]
890
+ SEC6["📋 Market Section<br/>7 pages, 21 citations"]
891
+ end
892
+
893
+ %% Quality Assurance
894
+ subgraph "Quality Assurance"
895
+ QA["✅ Quality Validation"]
896
+ CITE["🔍 Citation Check:<br/>231 of 231 verified"]
897
+ MED["🩺 Medical Review:<br/>Accuracy score: 96%"]
898
+ COMP2["📊 Compliance Check:<br/>All requirements met"]
899
+ CONF["📈 Confidence Score: 94%"]
900
+ end
901
+
902
+ %% Report Assembly
903
+ subgraph "Report Assembly"
904
+ STITCH["🧩 Intelligent Stitching"]
905
+ EXEC["📄 Executive Summary<br/>2 pages"]
906
+ TOC["📑 Table of Contents"]
907
+ MAIN["📖 Main Report<br/>61 pages total"]
908
+ APPEND["📎 Appendices<br/>Data tables, references"]
909
+ end
910
+
911
+ %% Final Output
912
+ subgraph "Output Layer"
913
+ FINAL["📤 Final Deliverables"]
914
+ PDF["📄 PDF Report<br/>Professional format"]
915
+ EXCEL["📊 Excel Workbook<br/>Data tables and charts"]
916
+ DASH["🖥️ Interactive Dashboard<br/>Web-based exploration"]
917
+ end
918
+
919
+ %% Flow Connections
920
+ USER --> DC
921
+ DC --> DOC1
922
+ DC --> DOC2
923
+ DC --> DOC3
924
+ DC --> DOC4
925
+ DC --> DOC5
926
+ DC --> DOC6
927
+ DOC1 --> TOTAL
928
+ DOC2 --> TOTAL
929
+ DOC3 --> TOTAL
930
+ DOC4 --> TOTAL
931
+ DOC5 --> TOTAL
932
+ DOC6 --> TOTAL
933
+
934
+ TOTAL --> PROC
935
+ PROC --> TEXT
936
+ PROC --> TABLES
937
+ PROC --> IMAGES
938
+ PROC --> META
939
+ TEXT --> CORPUS
940
+ TABLES --> CORPUS
941
+ IMAGES --> CORPUS
942
+ META --> CORPUS
943
+
944
+ CORPUS --> AGENTS
945
+ AGENTS --> EFF
946
+ AGENTS --> SAF
947
+ AGENTS --> EVI
948
+ AGENTS --> COMP
949
+ AGENTS --> REG
950
+ AGENTS --> MKT
951
+
952
+ EFF --> INDEP
953
+ SAF --> INDEP
954
+ EVI --> INDEP
955
+ COMP --> INDEP
956
+ REG --> INDEP
957
+ MKT --> INDEP
958
+
959
+ INDEP --> SEC1
960
+ INDEP --> SEC2
961
+ INDEP --> SEC3
962
+ INDEP --> SEC4
963
+ INDEP --> SEC5
964
+ INDEP --> SEC6
965
+
966
+ SEC1 --> QA
967
+ SEC2 --> QA
968
+ SEC3 --> QA
969
+ SEC4 --> QA
970
+ SEC5 --> QA
971
+ SEC6 --> QA
972
+
973
+ QA --> CITE
974
+ QA --> MED
975
+ QA --> COMP2
976
+ QA --> CONF
977
+
978
+ CITE --> STITCH
979
+ MED --> STITCH
980
+ COMP2 --> STITCH
981
+ CONF --> STITCH
982
+
983
+ STITCH --> EXEC
984
+ STITCH --> TOC
985
+ STITCH --> MAIN
986
+ STITCH --> APPEND
987
+
988
+ EXEC --> FINAL
989
+ TOC --> FINAL
990
+ MAIN --> FINAL
991
+ APPEND --> FINAL
992
+
993
+ FINAL --> PDF
994
+ FINAL --> EXCEL
995
+ FINAL --> DASH
996
+
997
+ %% Styling
998
+ classDef input fill:#e8f5e8,stroke:#2e7d32,stroke-width:3px
999
+ classDef collection fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
1000
+ classDef processing fill:#fff3e0,stroke:#f57c00,stroke-width:2px
1001
+ classDef analysis fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
1002
+ classDef sections fill:#e0f2f1,stroke:#00695c,stroke-width:2px
1003
+ classDef quality fill:#f1f8e9,stroke:#558b2f,stroke-width:2px
1004
+ classDef assembly fill:#fce4ec,stroke:#c2185b,stroke-width:2px
1005
+ classDef output fill:#e8f5e8,stroke:#388e3c,stroke-width:3px
1006
+
1007
+ class USER input
1008
+ class DC,DOC1,DOC2,DOC3,DOC4,DOC5,DOC6,TOTAL collection
1009
+ class PROC,TEXT,TABLES,IMAGES,META,CORPUS processing
1010
+ class AGENTS,EFF,SAF,EVI,COMP,REG,MKT analysis
1011
+ class INDEP,SEC1,SEC2,SEC3,SEC4,SEC5,SEC6 sections
1012
+ class QA,CITE,MED,COMP2,CONF quality
1013
+ class STITCH,EXEC,TOC,MAIN,APPEND assembly
1014
+ class FINAL,PDF,EXCEL,DASH output
1015
+ </div>
1016
+ </div>
1017
+ <div class="stats-grid">
1018
+ <div class="stat-card">
1019
+ <div class="stat-number">156</div>
1020
+ <div class="stat-label">Tables Extracted</div>
1021
+ </div>
1022
+ <div class="stat-card">
1023
+ <div class="stat-number">89</div>
1024
+ <div class="stat-label">Figures Analyzed</div>
1025
+ </div>
1026
+ <div class="stat-card">
1027
+ <div class="stat-number">231</div>
1028
+ <div class="stat-label">Citations Verified</div>
1029
+ </div>
1030
+ <div class="stat-card">
1031
+ <div class="stat-number">61</div>
1032
+ <div class="stat-label">Pages Generated</div>
1033
+ </div>
1034
+ </div>
1035
+ </div>
1036
+
1037
+ <!-- Footer -->
1038
+ <div class="footer">
1039
+ <h3>🚀 Next Steps</h3>
1040
+ <p>This comprehensive visual architecture provides the foundation for building a state-of-the-art pharmaceutical AI agent system. The modular design ensures scalability, accuracy, and regulatory compliance for medical affairs research.</p>
1041
+ </div>
1042
+ </div>
1043
+
1044
+ <script>
1045
+ // Mermaid will be initialized in DOMContentLoaded event
1046
+
1047
+ // Navigation functionality
1048
+ async function showFlow(flowId) {
1049
+ // Hide all flow sections
1050
+ const sections = document.querySelectorAll('.flow-section');
1051
+ sections.forEach(section => {
1052
+ section.classList.remove('active');
1053
+ });
1054
+
1055
+ // Remove active class from all buttons
1056
+ const buttons = document.querySelectorAll('.nav-btn');
1057
+ buttons.forEach(button => {
1058
+ button.classList.remove('active');
1059
+ });
1060
+
1061
+ // Show selected flow section
1062
+ document.getElementById(flowId).classList.add('active');
1063
+
1064
+ // Add active class to clicked button
1065
+ event.target.classList.add('active');
1066
+
1067
+ // Ensure mermaid diagram is rendered for this section
1068
+ setTimeout(async () => {
1069
+ await renderMermaidInSection(flowId);
1070
+ }, 100);
1071
+
1072
+ // Scroll to top of the section
1073
+ document.getElementById(flowId).scrollIntoView({
1074
+ behavior: 'smooth',
1075
+ block: 'start'
1076
+ });
1077
+ }
1078
+
1079
+ // Function to render mermaid diagrams in a specific section
1080
+ async function renderMermaidInSection(sectionId) {
1081
+ const section = document.getElementById(sectionId);
1082
+ if (section) {
1083
+ const mermaidElements = section.querySelectorAll('.mermaid');
1084
+
1085
+ for (let i = 0; i < mermaidElements.length; i++) {
1086
+ const element = mermaidElements[i];
1087
+ if (!element.getAttribute('data-processed')) {
1088
+ const uniqueId = `mermaid-${sectionId}-${i}`;
1089
+ const graphDefinition = element.textContent.trim();
1090
+
1091
+ try {
1092
+ // Clear the element first
1093
+ element.innerHTML = '';
1094
+
1095
+ // Use the newer mermaid.render API
1096
+ const { svg } = await mermaid.render(uniqueId, graphDefinition);
1097
+ element.innerHTML = svg;
1098
+ element.setAttribute('data-processed', 'true');
1099
+
1100
+ console.log(`Successfully rendered diagram for ${sectionId}-${i}`);
1101
+ } catch (error) {
1102
+ console.error(`Error rendering mermaid diagram for ${sectionId}-${i}:`, error);
1103
+
1104
+ // Fallback: try the old API
1105
+ try {
1106
+ element.innerHTML = graphDefinition;
1107
+ mermaid.init(undefined, element);
1108
+ element.setAttribute('data-processed', 'true');
1109
+ } catch (fallbackError) {
1110
+ console.error('Fallback also failed:', fallbackError);
1111
+ element.innerHTML = `<div style="color: red; padding: 20px; border: 1px solid red;">
1112
+ <strong>Diagram Error:</strong> Unable to render Mermaid diagram.
1113
+ <br><br>Graph definition: <pre>${graphDefinition.substring(0, 200)}...</pre>
1114
+ </div>`;
1115
+ }
1116
+ }
1117
+ }
1118
+ }
1119
+ }
1120
+ }
1121
+
1122
+ // Initialize and render all diagrams
1123
+ document.addEventListener('DOMContentLoaded', function() {
1124
+ console.log('DOM loaded, initializing Mermaid...');
1125
+
1126
+ // Configure mermaid
1127
+ mermaid.initialize({
1128
+ startOnLoad: false,
1129
+ theme: 'default',
1130
+ themeVariables: {
1131
+ fontFamily: 'Arial, sans-serif'
1132
+ },
1133
+ flowchart: {
1134
+ useMaxWidth: true,
1135
+ htmlLabels: true,
1136
+ curve: 'basis'
1137
+ },
1138
+ securityLevel: 'loose',
1139
+ logLevel: 'debug'
1140
+ });
1141
+
1142
+ // Wait a bit for the page to fully load, then render all diagrams
1143
+ setTimeout(async () => {
1144
+ console.log('Starting diagram rendering...');
1145
+ await renderMermaidInSection('complete');
1146
+ await renderMermaidInSection('user');
1147
+ await renderMermaidInSection('technical');
1148
+ await renderMermaidInSection('data');
1149
+ console.log('All diagrams rendered');
1150
+ }, 500);
1151
+ });
1152
+ </script>
1153
+ </body>
1154
+ </html>