File size: 75,445 Bytes
429a4f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8da4b29
7c8b457
 
 
 
 
 
 
 
 
 
d9f9fca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7c8b457
 
 
 
 
429a4f6
7c8b457
 
 
8da4b29
7c8b457
 
 
 
 
 
 
 
 
 
429a4f6
7c8b457
429a4f6
7c8b457
429a4f6
7c8b457
 
 
 
 
 
 
 
 
 
d9f9fca
7c8b457
d9f9fca
 
 
 
 
 
 
 
 
 
 
7c8b457
d9f9fca
7c8b457
 
 
 
 
 
 
 
 
 
 
 
 
 
429a4f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7c8b457
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Enterprise System Architecture</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f5f7fa;
            color: #333;
        }
        
        header {
            background-color: #4a6ee0;
            color: white;
            padding: 1rem;
            text-align: center;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        .container {
            width: 95%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        
        .diagram-container {
            position: relative;
            width: 100%;
            height: 650px;
            margin: 20px 0;
            background-color: #fff;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            background-image: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px), 
                             linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
            background-size: 20px 20px;
            overflow: hidden;
        }
        
        .box {
            position: absolute;
            border: 2px solid #333;
            border-radius: 5px;
            padding: 5px;
            text-align: center;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .box:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
            z-index: 100;
        }
        
        .box-title {
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .subcomponent {
            background-color: rgba(255,255,255,0.6);
            border: 1px solid #666;
            border-radius: 3px;
            margin: 2px;
            padding: 3px;
            font-size: 11px;
            cursor: pointer;
            transition: background-color 0.2s;
        }
        
        .subcomponent:hover {
            background-color: rgba(255,255,255,0.9);
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
        
        .connection {
            position: absolute;
            background-color: #333;
        }
        
        .arrow {
            position: absolute;
            width: 0;
            height: 0;
            border-style: solid;
        }
        
        .arrow-right {
            border-width: 4px 0 4px 8px;
            border-color: transparent transparent transparent #333;
        }
        
        .arrow-left {
            border-width: 4px 8px 4px 0;
            border-color: transparent #333 transparent transparent;
        }
        
        .arrow-down {
            border-width: 8px 4px 0 4px;
            border-color: #333 transparent transparent transparent;
        }
        
        .arrow-up {
            border-width: 0 4px 8px 4px;
            border-color: transparent transparent #333 transparent;
        }
        
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.7);
            overflow-y: auto;
        }
        
        .modal-content {
            background-color: #fefefe;
            margin: 50px auto;
            padding: 20px;
            border-radius: 8px;
            width: 80%;
            max-width: 900px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
            position: relative;
        }
        
        .close {
            position: absolute;
            top: 10px;
            right: 20px;
            color: #888;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
        }
        
        .close:hover {
            color: #000;
        }
        
        .tab {
            overflow: hidden;
            border-bottom: 1px solid #ccc;
            margin-bottom: 20px;
        }
        
        .tab button {
            background-color: inherit;
            float: left;
            border: none;
            outline: none;
            cursor: pointer;
            padding: 10px 16px;
            transition: 0.3s;
            font-size: 16px;
            border-bottom: 3px solid transparent;
        }
        
        .tab button:hover {
            background-color: #f1f1f1;
        }
        
        .tab button.active {
            border-bottom: 3px solid #4a6ee0;
            color: #4a6ee0;
            font-weight: 600;
        }
        
        .tabcontent {
            display: none;
            padding: 20px 0;
            animation: fadeEffect 0.5s;
        }
        
        @keyframes fadeEffect {
            from {opacity: 0;}
            to {opacity: 1;}
        }
        
        .tech-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .tech-card {
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 10px;
            transition: all 0.3s;
        }
        
        .tech-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        
        .tech-title {
            font-weight: bold;
            color: #4a6ee0;
            margin-bottom: 5px;
        }
        
        .example-box {
            background-color: #f9f9f9;
            border-left: 4px solid #4a6ee0;
            padding: 15px;
            margin-bottom: 20px;
        }
        
        .example-title {
            font-weight: bold;
            margin-bottom: 10px;
        }
        
        .button {
            background-color: #4a6ee0;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s;
        }
        
        .button:hover {
            background-color: #3a56a8;
        }
        
        /* Colors for boxes */
        .client-layer { background-color: #f0f0f0; }
        .api-layer { background-color: #e2e3e5; }
        .orchestration-layer { background-color: #d9d2e9; }
        .service-layer { background-color: #d9ead3; }
        .integration-layer { background-color: #f9cb9c; }
        .data-layer { background-color: #cfe2f3; }
        .ai-layer { background-color: #d5a6bd; }
        .devops-layer { background-color: #ffe599; }
        
        /* Badges for tech cards */
        .badge {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 11px;
            font-weight: 600;
            margin-right: 5px;
            margin-top: 5px;
        }
        
        .badge-open-source { background-color: #c6efce; color: #006100; }
        .badge-enterprise { background-color: #ffc7ce; color: #9c0006; }
        .badge-cloud { background-color: #bdd7ee; color: #1f497d; }
        .badge-self-hosted { background-color: #fff2cc; color: #856404; }
        
          .guardrails-overlay {
              background-color: transparent;
              border: 2px dotted #333;
              border-radius: 8px;
              z-index: 50;
              pointer-events: none;
          }
          
          /* Position the label on the right side of the box */
          
          
            .border-legend {
            position: absolute;
            right: 30px;      /* Position on the right side */
            top: -10px;       /* Position to overlap the top border */
            font-weight: bold;
            font-size: 14px;
            color: #333;
            background-color: white; /* Solid background to "break" the border */
            padding: 0 8px;
            pointer-events: none;
        }
    </style>
</head>
<body>
    <header>
        <h1>Svaas AI Agent Approach</h1>
    </header>
    
    <div class="container">
       <!--  <button id="homeBtn" class="button">Home</button> -->
        
        <div class="diagram-container" id="diagram">
            <textarea id="architecture-editor" style="width:100%; height:100%; padding:20px; font-family:monospace; border:none; background:transparent;">
     </textarea>
        </div>
    </div>
    
    <!-- Will generate modals for each component via JavaScript -->
    
    <script>
        // Component definitions with detailed subcomponents
        const components = [
            {
                id: 'frontend',
                type: 'client-layer',
                title: 'Frontend Layer',
                x: 150,
                y: 50,
                width: 500,
                height: 120,
                subcomponents: [
                    { id: 'webapp', name: 'Web App (PWA)', 
                      description: 'Progressive web applications that provide responsive interfaces with offline capabilities',
                      technologies: [
                          { name: 'React.js', description: 'JavaScript library for building user interfaces' },
                          { name: 'Retool', description: 'No Code solution for interal ops team' },
                          { name: 'Powerapps', description: 'No code web UI for internal teams' },
                          { name: 'Gradio', description: 'Python library for quickly creating web interfaces', badge: 'open-source' },
                          { name: 'Streamlit', description: 'Python framework for data apps', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Healthcare Dashboard', description: 'A PWA built with React/Next.js that provides doctors with patient monitoring capabilities, accessible from any device.' },
                          { name: 'Data Visualization Portal', description: 'A Streamlit-based application for visualizing patient data and treatment outcomes.' }
                      ]
                    },
                    { id: 'mobile', name: 'Mobile Apps', 
                      description: 'Native and cross-platform mobile applications for iOS and Android devices',
                      technologies: [
                          ,
                          { name: 'Flutter', description: 'Google\'s UI toolkit for cross-platform apps', badge: 'open-source' },
                          { name: 'Swift/SwiftUI', description: 'Apple\'s language and framework for iOS' },
                          
                      ],
                      examples: [
                          { title: 'Patient Companion App', description: 'A React Native application that helps patients track medications, appointments, and communicate with providers.' },
                          { title: 'Provider Mobile Suite', description: 'A Flutter-based app for healthcare providers to access patient records on the go.' }
                      ]
                    },
                    { id: 'messaging', name: 'Bot Interface', 
                      description: 'Unified communication platform that integrates with various messaging services',
                      technologies: [
                          { name: 'Yellow.ai', description: 'Conversational AI platform for WhatsApp integration', badge: 'enterprise' },
                          { name: 'SCE Engine', description: 'Mssg API ', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Multi-channel Patient Support', description: 'A Yellow.ai implementation that allows patients to communicate via WhatsApp, SMS, or web chat using a single backend.' },
                          { title: 'Appointment Bot', description: 'A conversational assistant for booking and managing appointments via messaging platforms.' }
                      ]
                    },
                   
                    { id: 'voice', name: 'Voice Assistant', 
                      description: 'Voice-based interface for hands-free interaction with the system',
                      technologies: [
                          { name: 'Amazon Alexa', description: 'Voice assistant platform', badge: 'cloud' },
                          { name: 'Google Assistant', description: 'AI-powered virtual assistant', badge: 'cloud' },
                          { name: 'Rasa', description: 'Open source conversational AI', badge: 'open-source' },
                          { name: 'Mozilla DeepSpeech', description: 'Open source speech-to-text engine', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Hands-free Clinical Assistant', description: 'Voice assistant that allows doctors to query patient information during procedures.' },
                          { title: 'Home Care Voice Interface', description: 'Alexa skill that helps patients with medication reminders and basic health questions.' }
                      ]
                    }
                ]
            },
            {
                id: 'api',
                type: 'api-layer',
                title: 'API Gateway Layer',
                x: 150,
                y: 180,
                width: 500,
                height: 70,
                subcomponents: [
                    { id: 'authentication', name: 'Authentication', 
                      description: 'Identity verification and access control services',
                      technologies: [
                          { name: 'OAuth 2.0 / OpenID Connect', description: 'Industry standard authorization frameworks' },
                          { name: 'Auth0', description: 'Identity platform as a service', badge: 'cloud' },
                          { name: 'Okta', description: 'Identity and access management', badge: 'cloud' },
                          { name: 'KeyCloak', description: 'Open source identity and access management', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Single Sign-On Implementation', description: 'A centralized authentication system that works across all applications in the ecosystem.' },
                          { title: 'Role-Based Access Control', description: 'Fine-grained permission system based on user roles and attributes.' }
                      ]
                    },
                    { id: 'rate-limiting', name: 'Rate Limiting', 
                      description: 'Controls the rate of requests to protect backend services',
                      technologies: [
                          { name: 'Kong Gateway', description: 'API gateway with rate limiting', badge: 'open-source' },
                          { name: 'AWS API Gateway', description: 'Managed API gateway service', badge: 'cloud' },
                          { name: 'NGINX', description: 'Web server with rate limiting capabilities', badge: 'open-source' },
                          { name: 'Azure API Management', description: 'API management platform', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Tiered API Access', description: 'Different rate limits for different client tiers to ensure fair usage.' },
                          { title: 'DDoS Protection', description: 'Rate limiting combined with anomaly detection to prevent abuse.' }
                      ]
                    },
                    { id: 'logging', name: 'Logging  ', 
                      description: 'Tracking and analysis of API requests and system performance',
                      technologies: [
                          { name: 'ELK Stack', description: 'Elasticsearch, Logstash, Kibana', badge: 'open-source' },
                          { name: 'Datadog', description: 'Monitoring and analytics platform', badge: 'enterprise' },
                          { name: 'New Relic', description: 'Application performance monitoring', badge: 'enterprise' },
                          { name: 'Prometheus & Grafana', description: 'Monitoring and alerting', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Real-time API Dashboard', description: 'A Grafana dashboard showing API performance, errors, and usage patterns.' },
                          { title: 'Audit Trail System', description: 'Comprehensive logging of all data access for compliance requirements.' }
                      ]
                    },
                    { id: 'Monitoring', name: 'Monitoring', 
                      description: 'Tracking and analysis of API requests and system performance',
                      technologies: [
                          { name: 'langsmith', description: 'Focuses on building and deploying LLM applications, offering features for tracing, debugging, and evaluating model', badge: 'open-source' },
                          { name: 'Arize AI Phoenix', description: 'A platform designed to monitor and explain machine learning models, including LLMs, offering features for tracking performance over time, detecting anomalies, and understanding the factors that contribute to model predictions. ', badge: 'enterprise' },
                          { name: 'AzureAI', description: 'Enable users to track metrics, analyze model performance, and identify areas for improvement. ', badge: 'enterprise' },
                          { name: 'VertexAi', description: 'Enable users to track metrics, analyze model performance, and identify areas for improvement. ', badge: 'enterprise' }
                      ],
                      examples: [
                          { title: 'Real-time API Dashboard', description: 'A Grafana dashboard showing API performance, errors, and usage patterns.' },
                          { title: 'Audit Trail System', description: 'Comprehensive logging of all data access for compliance requirements.' }
                      ]
                    }
                ]
            },
            {
                id: 'orchestration',
                type: 'orchestration-layer',
                title: 'Orchestration Agents',
                x: 150,
                y: 270,
                width: 500,
                height: 80,
                subcomponents: [
                    { id: 'service-orchestrator', name: 'Service Orchestrator (Mini LLM Agent)', 
                      description: 'LLM-powered coordinator that intelligently routes requests and manages workflows across services',
                      technologies: [
                          { name: 'Apache Airflow', description: 'Workflow orchestration platform', badge: 'open-source' },
                          { name: 'Temporal', description: 'Microservice orchestration platform', badge: 'open-source' },
                          { name: 'AWS Step Functions', description: 'Serverless workflow service', badge: 'cloud' },
                          { name: 'LangChain Agents', description: 'Framework for LLM-powered agents', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Intelligent Healthcare Workflow', description: 'A mini LLM agent that analyzes incoming patient requests and dynamically creates optimized workflows across multiple services.' },
                          { title: 'Adaptive Treatment Protocol', description: 'Orchestration agent that coordinates complex treatment processes across departments with real-time adjustments based on patient responses.' }
                      ]
                    },
                ]
            },
            {
                id: 'service',
                type: 'service-layer',
                title: 'Service Agents ',
                x: 150,
                y: 380,
                width: 500,
                height: 100,
                subcomponents: [
                    { id: 'diet-service', name: 'Diet Service (LLM Agent)', 
                      description: 'AI-powered agent that generates and validates personalized nutrition plans  for different health consditions using LLMs',
                      technologies: [
                          { name: 'GPT-4o', description: 'Advanced language model for nutrition planning', badge: 'cloud' },
                          { name: 'Nutrition Knowledge Graph', description: 'Structured nutrition data', badge: 'proprietary' },
                          { name: 'LangChain', description: 'Framework for LLM applications', badge: 'open-source' },
                          { name: 'Cuisine Database', description: 'Bon appetite Database', badge: 'enterprise' }
                      ],
                      examples: [
                          { title: 'AI Nutritionist', description: 'LLM agent that creates, validates, and adjusts meal plans based on real-time patient feedback and health metrics, ensuring clinical nutrition guidelines are met.' },
                          { title: 'Dietary Compliance Coach', description: 'AI agent that analyzes food logs, provides personalized guidance, and adapts plans based on patient adherence patterns and medical needs.' }
                      ]
                    },
                    { id: 'support-service', name: 'Support Service (LLM Agent)', 
                      description: 'MyFlexa is a specialized mobile application designed to help individuals dealing with chronic pain. The app offers personalized exercise plans tailored to each user\'s unique needs, making it an effective tool for managing and alleviating pain. MyFlexa\'s key features include:\n\n1. Personalized Exercise Plans: Based on your specific condition and current pain levels, MyFlexa creates customized exercise programs to help strengthen your back muscles and improve overall mobility.\n\n2. AI Virtual Trainer: MyFlexa\'s advanced AI technology provides real-time support and guidance as you complete your exercise routine. The virtual trainer ensures proper form and technique, maximizing the benefits of each exercise.\n\n3. Progress Tracking: Monitor your progress with ease using MyFlexa\'s built-in tracking features. By keeping track of your improvements, you\'ll be able to see the positive effects of your exercise routine and stay motivated.\n\n4. Mobility Assessments: Regular mobility assessments help you understand the impact of your exercises and provide valuable insights into your overall condition. This information can be shared with your healthcare provider for a more comprehensive treatment plan.\n\n5. Expert Physiotherapist Support (when applicable): MyFlexa offers access to expert physiotherapist support for more complex cases. This added level of professional guidance ensures you receive the best possible care and advice for your chronic lower back pain.',
                      technologies: [
                          { name: 'Llama, Mistral', description: 'LLM models for rag and conversation', badge: 'AI model' },
                          { name: 'Knowledge Base Integration', description: 'Connected enterprise documentation', badge: 'proprietary' },
                          { name: 'CRM, ITMS', description: 'Customer service platform', badge: 'enterprise' },
                          { name: 'Sentence Transformers', description: 'Text embedding models', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Autonomous Support Agent', description: 'LLM-powered system that handles 85% of support tickets without human intervention, understanding complex medical queries and providing accurate information with citations.' },
                          { title: 'Proactive Issue Resolution', description: 'AI agent that identifies potential support issues from patient behavior patterns and reaches out with preventative guidance before problems occur.' }
                      ]
                    },
                    { id: 'analytics-service', name: 'Analytics Service (LLM Agent)', 
                      description: 'AI-driven analytics agent that discovers insights and generates reports with natural language explanations',
                      technologies: [
                          { name: 'Mistral Large', description: 'Open-weight large language model', badge: 'cloud' },
                          { name: 'Python Data Stack', description: 'Pandas, NumPy, SciPy', badge: 'open-source' },
                          { name: 'Apache Spark', description: 'Distributed computing system', badge: 'open-source' },
                          { name: 'Visualization Generation AI', description: 'Auto-generated visuals', badge: 'proprietary' }
                      ],
                      examples: [
                          { title: 'AI Insights Narrator', description: 'LLM agent that automatically analyzes population health data, identifies significant patterns, and generates executive reports with natural language explanations that non-technical stakeholders can understand.' },
                          { title: 'Treatment Efficacy Analyzer', description: 'AI agent that continuously evaluates treatment outcomes across protocols, patient demographics, and comorbidities, surfacing unexpected correlations and providing evidence-based recommendations.' }
                      ]
                    },
                    { id: 'medical-research', name: 'Medical Research Agent (LLM)', 
                      description: 'Advanced AI agent for pharmaceutical and medical research analysis',
                      technologies: [
                          { name: 'Claude Opus', description: 'Advanced reasoning model', badge: 'cloud' },
                          { name: 'LlamaIndex', description: 'Framework for LLM data augmentation', badge: 'open-source' },
                          { name: 'PubMed API', description: 'Medical literature access', badge: 'open-source' },
                          { name: 'BioBERT', description: 'Biomedical language model', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Pharmaceutical Research Assistant', description: 'LLM agent that autonomously researches drug compounds by analyzing thousands of papers, extracting molecular interactions, adverse effects, and clinical outcomes, synthesizing findings into actionable reports with full citations.' },
                          { title: 'Evidence Synthesis Engine', description: 'AI agent that continuously monitors new clinical research, compares methodologies across studies, identifies conflicts in findings, and generates comprehensive meta-analyses that highlight confidence levels for different conclusions.' }
                      ]
                    },
                    { id: 'marketing-service', name: 'Marketing Service (LLM Agent)', 
                      description: 'AI-powered agent that creates, optimizes, and manages personalized marketing campaigns',
                      technologies: [
                          { name: 'GPT-4', description: 'Advanced language model for content', badge: 'cloud' },
                          { name: 'Cohort Analysis AI', description: 'Patient segmentation model', badge: 'proprietary' },
                          { name: 'Salesforce Marketing Cloud', description: 'Digital marketing platform', badge: 'enterprise' },
                          { name: 'Multi-channel Optimization Model', description: 'Channel selection AI', badge: 'proprietary' }
                      ],
                      examples: [
                          { title: 'Autonomous Campaign Manager', description: 'LLM agent that designs, implements, and optimizes marketing campaigns across channels, dynamically adjusting messaging based on real-time engagement metrics and healthcare regulations.' },
                          { title: 'Personalized Health Journey', description: 'AI agent that develops individualized content strategies for patients based on their health status, history, and preferences, creating a cohesive narrative across touchpoints.' }
                      ]
                    },
                    { id: 'compliance', name: 'Compliance Agent (LLM)', 
                      description: 'LLM-powered agent that enforces regulatory compliance through continuous monitoring',
                      technologies: [
                          { name: 'Claude 3', description: 'Advanced reasoning LLM', badge: 'cloud' },
                          { name: 'Regulatory Knowledge Graph', description: 'Structured compliance data', badge: 'proprietary' },
                          { name: 'Static Code Analysis', description: 'Automated code scanning', badge: 'open-source' },
                          { name: 'Document Understanding AI', description: 'Regulatory document analysis', badge: 'proprietary' }
                      ],
                      examples: [
                          { title: 'Autonomous Compliance Validator', description: 'LLM agent that ingests regulatory documentation, continuously scans code repositories and data access patterns for violations, and generates comprehensive audit reports with remediation recommendations.' },
                          { title: 'Proactive Regulatory Monitor', description: 'AI system that analyzes new healthcare regulations, identifies areas of potential non-compliance in the system architecture, and suggests implementation changes before violations occur.' }
                      ]
                    }
                ]
            },
            {
                id: 'guardrails-overlay',
                type: 'guardrails-overlay',
                title: '',
                x: 160,
                y: 390,
                width: 470,
                height: 80,
                relatedTo: 'service'
            },
            {
                id: 'integration',
                type: 'integration-layer',
                title: 'Integration Layer(Tools)',
                x: 150,
                y: 500,
                width: 500,
                height: 100,
                subcomponents: [
                    { id: 'crm-erp', name: 'CRM/ERP', 
                      description: 'Integration with customer relationship and enterprise resource planning systems',
                      technologies: [
                          { name: 'Salesforce API', description: 'CRM integration platform', badge: 'enterprise' },
                          { name: 'SAP Connector', description: 'ERP integration', badge: 'enterprise' },
                          { name: 'Microsoft Dynamics', description: 'Business applications', badge: 'enterprise' },
                          { name: 'MuleSoft', description: 'Integration platform', badge: 'enterprise' }
                      ],
                      examples: [
                          { title: 'Healthcare CRM Integration', description: 'Bidirectional sync between clinical systems and Salesforce Health Cloud for unified patient view.' },
                          { title: 'Supply Chain Management', description: 'Integration with ERP systems for medical supply ordering and inventory management.' }
                      ]
                    },
                    { id: 'web-search', name: 'Web Search', 
                      description: 'Integration with search engines and search functionality',
                      technologies: [
                          { name: 'Elasticsearch', description: 'Search and analytics engine', badge: 'open-source' },
                          { name: 'Algolia', description: 'Search-as-a-service', badge: 'cloud' },
                          { name: 'Solr', description: 'Search platform', badge: 'open-source' },
                          { name: 'Google Custom Search', description: 'Programmable search engine', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Medical Knowledge Search', description: 'A specialized search engine that indexes medical literature, protocols, and guidelines for provider reference.' },
                          { title: 'Patient-Friendly Search', description: 'Search functionality that presents complex medical information in accessible language.' }
                      ]
                    },
                    { id: 'pdf-service', name: 'PDF Service', 
                      description: 'Generation and processing of PDF documents',
                      technologies: [
                          { name: 'PDFKit', description: 'PDF generation library', badge: 'open-source' },
                          { name: 'PDFTron', description: 'PDF SDK', badge: 'enterprise' },
                          { name: 'Apache PDFBox', description: 'PDF manipulation library', badge: 'open-source' },
                          { name: 'wkhtmltopdf', description: 'HTML to PDF converter', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Clinical Documentation Generator', description: 'Service that transforms structured data into standardized clinical documents and reports.' },
                          { title: 'Secure Patient Records', description: 'System for generating encrypted PDF records with authentication requirements.' }
                      ]
                    },
                    { id: 'translation', name: 'Translation Services', 
                      description: 'Multi-language support and translation capabilities',
                      technologies: [
                          { name: 'DeepL API', description: 'Neural machine translation', badge: 'cloud' },
                          { name: 'Google Cloud Translation', description: 'Machine translation service', badge: 'cloud' },
                          { name: 'Microsoft Translator', description: 'Text translation API', badge: 'cloud' },
                          { name: 'LibreTranslate', description: 'Open source machine translation', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Real-time Patient Communication', description: 'Translation service that enables providers to communicate with patients in their preferred language.' },
                          { title: 'Multilingual Documentation', description: 'System that automatically translates educational materials and instructions.' }
                      ]
                    },
                    { id: 'visualization', name: 'Visualization', 
                      description: 'Data visualization and reporting tools',
                      technologies: [
                          { name: 'Power BI', description: 'Business analytics platform', badge: 'enterprise' },
                          { name: 'Tableau', description: 'Visual analytics platform', badge: 'enterprise' },
                          { name: 'D3.js', description: 'JavaScript visualization library', badge: 'open-source' },
                          { name: 'Plotly', description: 'Interactive visualization library', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Clinical Dashboard', description: 'Interactive visualizations of patient data and clinical metrics for healthcare providers.' },
                          { title: 'Population Health Maps', description: 'Geographic visualization of health trends and resource allocation.' }
                      ]
                    },
                    { id: 'config-management', name: 'Configuration Management', 
                      description: 'Tools for system configuration and management',
                      technologies: [
                          { name: 'Ansible', description: 'Automation platform', badge: 'open-source' },
                          { name: 'Chef', description: 'Configuration management tool', badge: 'open-source' },
                          { name: 'Puppet', description: 'IT automation software', badge: 'enterprise' },
                          { name: 'Salt', description: 'Infrastructure automation', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Compliance-as-Code', description: 'Automated system configuration that ensures all components meet security and regulatory standards.' },
                          { title: 'Environment Parity', description: 'Configuration management ensuring consistency across development, testing, and production environments.' }
                      ]
                    },                    
                    
                    { id: 'IMage processing', name: 'IMage processing', 
                      description: 'Tools for image processing and real time video processing',
                      technologies: [
                          { name: 'OCR', description: 'Automation platform', badge: 'open-source' },
                          { name: 'Image processing', description: 'Configuration management tool', badge: 'open-source' },
                          { name: 'Magmam', description: 'Lightweight for eral time detections', badge: 'open-source' },
                          { name: 'OpenCV', description: 'Image processing framework', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Compliance-as-Code', description: 'Automated system configuration that ensures all components meet security and regulatory standards.' },
                          { title: 'Environment Parity', description: 'Configuration management ensuring consistency across development, testing, and production environments.' }
                      ]
                    },
                    
                    { id: 'IDM', name: 'identity management and authentication', 
                      description: 'Tools for autheitacation for each agents . each agent will have its own id for acccess management',
                      technologies: [
                          { name: 'Azure Ad', description: 'IAM', badge: 'open-source' },
                          { name: 'OKta', description: 'Configuration management tool', badge: 'open-source' },
                       ],   
                      examples: [
                          { title: 'Compliance-as-Code', description: 'Automated system configuration that ensures all components meet security and regulatory standards.' },
                          { title: 'Environment Parity', description: 'Configuration management ensuring consistency across development, testing, and production environments.' }
                      ]
                    },
                    
                    { id: 'email-sms', name: 'Email/SMS/WhatsApp/Teams', 
                      description: 'Traditional communication channels for notifications and alerts',
                      technologies: [
                          { name: 'SendGrid', description: 'Email delivery service', badge: 'cloud' },
                          { name: 'Twilio SMS', description: 'Programmable SMS service', badge: 'cloud' },
                          { name: 'Nodemailer', description: 'Email sending from Node.js', badge: 'open-source' },
                          { name: 'Amazon SES', description: 'Email sending service', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Automated Appointment Reminders', description: 'System that sends SMS and email reminders for upcoming appointments, reducing no-shows.' },
                          { title: 'Test Result Notifications', description: 'Secure email delivery of test results with patient authentication.' }
                      ]
                    }
                ]
            },
            {
                id: 'data',
                type: 'data-layer',
                title: 'Data Layer (RAG-Enabled)',
                x: 30,
                y: 260,
                width: 100,
                height: 340,
                subcomponents: [
                    { id: 'vector-db', name: 'Vector DB (RAG Core)', 
                      description: 'Database optimized for storing and querying vector embeddings, forming the foundation of Retrieval-Augmented Generation (RAG) systems',
                      technologies: [
                          { name: 'Pinecone', description: 'Vector database for RAG implementations', badge: 'cloud' },
                          { name: 'Weaviate', description: 'Vector search engine with semantic capabilities', badge: 'open-source' },
                          { name: 'Qdrant', description: 'Vector similarity engine for RAG pipelines', badge: 'open-source' },
                          { name: 'Milvus', description: 'Vector database for embeddings and retrieval', badge: 'open-source' },
                          { name: 'ChromaDB', description: 'Embedding database for RAG applications', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Medical Knowledge RAG', description: 'Vector database storing embeddings of medical literature for retrieval augmented generation in clinical decision support, enabling LLMs to access accurate, up-to-date medical information.' },
                          { title: 'Semantic Patient Search', description: 'RAG-powered system that allows searching for patients with similar conditions based on narrative descriptions rather than exact codes, improving clinical pattern recognition.' }
                      ]
                    },
                    { id: 'sql-db', name: 'SQL DB', 
                      description: 'Relational database for structured data storage, providing factual data to complement RAG systems',
                      technologies: [
                          { name: 'PostgreSQL', description: 'Advanced open-source database', badge: 'open-source' },
                          { name: 'MySQL/MariaDB', description: 'Open-source relational database', badge: 'open-source' },
                          { name: 'MS SQL Server', description: 'Microsoft\'s relational database', badge: 'enterprise' },
                          { name: 'Oracle Database', description: 'Enterprise database system', badge: 'enterprise' }
                      ],
                      examples: [
                          { title: 'Patient Record System', description: 'A normalized database design that efficiently stores and retrieves patient demographic and clinical data, serving as a structured data source for RAG systems.' },
                          { title: 'Billing and Claims Database', description: 'SQL database optimized for financial transactions and reporting, providing factual context for RAG-powered analytics.' }
                      ]
                    },
                    { id: 'document-db', name: 'Document DB', 
                      description: 'NoSQL database for storing semi-structured documents that serve as knowledge sources for RAG pipelines',
                      technologies: [
                          { name: 'MongoDB', description: 'Document-oriented database', badge: 'open-source' },
                          { name: 'Couchbase', description: 'NoSQL document database', badge: 'enterprise' },
                          { name: 'Amazon DocumentDB', description: 'MongoDB-compatible database', badge: 'cloud' },
                          { name: 'Firestore', description: 'NoSQL document database', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Clinical Notes Repository', description: 'A document database storing unstructured and semi-structured clinical notes with flexible schema, providing rich content for RAG retrieval.' },
                          { title: 'Patient Journey Documentation', description: 'System that captures the full timeline of patient interactions across different care settings, enabling context-aware RAG responses.' }
                      ]
                    },
                    { id: 'graph-db', name: 'Knowledge Graph DB', 
                      description: 'Database optimized for storing and querying connected data, enhancing RAG with structured relationships',
                      technologies: [
                          { name: 'Neo4j', description: 'Graph database platform for knowledge representation', badge: 'enterprise' },
                          { name: 'Amazon Neptune', description: 'Graph database service for connected data', badge: 'cloud' },
                          { name: 'ArangoDB', description: 'Multi-model database with graph capabilities', badge: 'open-source' },
                          { name: 'JanusGraph', description: 'Distributed graph database for complex relationships', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Healthcare Knowledge Graph for RAG', description: 'A comprehensive knowledge graph connecting diseases, treatments, medications, and contraindications that enhances retrieval quality in RAG systems.' },
                          { title: 'Patient Relationship Network', description: 'Graph database mapping relationships between patients, providers, facilities, and social determinants of health for context-aware RAG responses.' }
                      ]
                    },
                    { id: 'time-series', name: 'Time Series DB', 
                      description: 'Database optimized for time-stamped data, providing temporal context for RAG systems',
                      technologies: [
                          { name: 'InfluxDB', description: 'Time series database', badge: 'open-source' },
                          { name: 'TimescaleDB', description: 'PostgreSQL for time-series', badge: 'open-source' },
                          { name: 'Prometheus', description: 'Monitoring and time series DB', badge: 'open-source' },
                          { name: 'Amazon Timestream', description: 'Time series database service', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Patient Monitoring Analytics', description: 'Time series database storing continuous patient monitoring data for real-time and historical analysis, enabling RAG systems to incorporate temporal trends.' },
                          { title: 'Treatment Effectiveness Tracking', description: 'System that correlates treatment protocols with vital sign trends over time, providing evidence-based data for RAG-powered clinical recommendations.' }
                      ]
                    },
                    { id: 'cache', name: 'Cache Layer', 
                      description: 'In-memory data store for high-performance data access, accelerating RAG retrieval operations',
                      technologies: [
                          { name: 'Redis', description: 'In-memory data structure store', badge: 'open-source' },
                          { name: 'Memcached', description: 'Distributed memory caching', badge: 'open-source' },
                          { name: 'Elasticsearch Cache', description: 'Search engine with caching', badge: 'open-source' },
                          { name: 'Hazelcast', description: 'In-memory data grid', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'RAG Results Cache', description: 'In-memory caching of frequently accessed retrieval results for sub-millisecond response times in RAG applications.' },
                          { title: 'Session Management', description: 'Distributed Redis implementation for managing user sessions and context across RAG-powered services.' }
                      ]
                    },
                    { id: 'rag-orchestration', name: 'RAG Orchestration', 
                      description: 'Specialized components for managing the RAG pipeline from chunking to retrieval to generation',
                      technologies: [
                          { name: 'LangChain', description: 'Framework for RAG workflows', badge: 'open-source' },
                          { name: 'LlamaIndex', description: 'Data framework for LLM applications', badge: 'open-source' },
                          { name: 'Haystack', description: 'End-to-end RAG framework', badge: 'open-source' },
                          { name: 'Semantic Kernel', description: 'Microsoft\'s orchestration framework', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Multi-Source Medical RAG', description: 'Orchestration system that retrieves from multiple knowledge sources (research papers, clinical guidelines, formularies) to provide comprehensive medical information.' },
                          { title: 'Adaptive Retrieval System', description: 'RAG pipeline that dynamically adjusts retrieval strategies based on query complexity and available knowledge sources.' }
                      ]
                    }
                ]
            },
            {
                id: 'ai',
                type: 'ai-layer',
                title: 'Model',
                x: 670,
                y: 260,
                width: 100,
                height: 180,
                subcomponents: [
                    { id: 'self-hosted-llm', name: 'Self-hosted LLMs', 
                      description: 'On-premises large language models for control and privacy',
                      technologies: [
                          { name: 'Llama 3', description: 'Meta\'s open source LLM', badge: 'open-source' },
                          { name: 'Mistral', description: 'Efficient open source LLM', badge: 'open-source' },
                          { name: 'Falcon', description: 'Open source LLM', badge: 'open-source' },
                          { name: 'MPT', description: 'MosaicML Pretrained Transformer', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Clinical Documentation Assistant', description: 'Self-hosted LLM for generating and analyzing clinical notes with protected health information (PHI) never leaving the premises.' },
                          { title: 'Medical Literature Analysis', description: 'On-premises model fine-tuned on medical corpora for specialized healthcare applications.' }
                      ]
                    },
                    { id: 'cloud-llm', name: 'Cloud LLMs', 
                      description: 'API-based access to leading commercial language models',
                      technologies: [
                          { name: 'OpenAI API (GPT-4)', description: 'Advanced language model', badge: 'cloud' },
                          { name: 'Anthropic Claude', description: 'Conversational AI assistant', badge: 'cloud' },
                          { name: 'Google Gemini', description: 'Multimodal AI model', badge: 'cloud' },
                          { name: 'Azure OpenAI', description: 'Enterprise OpenAI deployment', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Patient Communication Platform', description: 'Claude-powered system that generates personalized health education content.' },
                          { title: 'Medical Q&A System', description: 'GPT-4 implementation for answering complex medical questions with citations.' }
                      ]
                    },
                    { id: 'vision-models', name: 'Vision Models', 
                      description: 'AI models for image analysis and interpretation',
                      technologies: [
                          { name: 'CLIP', description: 'Connecting text and images', badge: 'open-source' },
                          { name: 'MedicalVisionBERT', description: 'Medical imaging model', badge: 'open-source' },
                          { name: 'Segment Anything', description: 'Image segmentation model', badge: 'open-source' },
                          { name: 'Google Vision AI', description: 'Cloud vision API', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Radiology Assistant', description: 'AI system that analyzes medical images to flag potential abnormalities for radiologist review.' },
                          { title: 'Wound Assessment Tool', description: 'Vision model that measures and tracks wound healing progress from smartphone photos.' }
                      ]
                    },
                    { id: 'voice-models', name: 'Voice Models', 
                      description: 'Speech recognition and synthesis technologies',
                      technologies: [
                          { name: 'Whisper', description: 'Speech recognition model', badge: 'open-source' },
                          { name: 'Amazon Polly', description: 'Text-to-speech service', badge: 'cloud' },
                          { name: 'Tacotron 2', description: 'Neural text-to-speech', badge: 'open-source' },
                          { name: 'NVIDIA Riva', description: 'Speech AI SDK', badge: 'enterprise' }
                      ],
                      examples: [
                          { title: 'Medical Dictation System', description: 'Whisper-based transcription service optimized for medical terminology.' },
                          { title: 'Accessible Patient Instructions', description: 'Text-to-speech system that converts written instructions to natural-sounding audio for patients with reading difficulties.' }
                      ]
                    },
                    { id: 'domain-models', name: 'Domain-Specific Models', 
                      description: 'AI models specialized for healthcare and related domains',
                      technologies: [
                          { name: 'BioBERT', description: 'Biomedical language model', badge: 'open-source' },
                          { name: 'ClinicalBERT', description: 'Clinical notes understanding', badge: 'open-source' },
                          { name: 'MedPaLM', description: 'Medical Q&A model', badge: 'enterprise' },
                          { name: 'RadBERT', description: 'Radiology report analysis', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Automated Coding Assistant', description: 'Domain-specific model that suggests accurate ICD-10 and CPT codes based on clinical documentation.' },
                          { title: 'Drug Interaction Predictor', description: 'Healthcare-specific model trained to identify potential adverse interactions in complex medication regimens.' }
                      ]
                    }
                ]
            },
            {
                id: 'devops',
                type: 'devops-layer',
                title: 'Governance',
                x: 670,
                y: 460,
                width: 100,
                height: 140,
                subcomponents: [
                    { id: 'monitoring', name: 'Monitoring', 
                      description: 'System monitoring and observability tools',
                      technologies: [
                          { name: 'Prometheus', description: 'Monitoring system & time series DB', badge: 'open-source' },
                          { name: 'Grafana', description: 'Observability platform', badge: 'open-source' },
                          { name: 'Datadog', description: 'Monitoring and security platform', badge: 'enterprise' },
                          { name: 'New Relic', description: 'Observability platform', badge: 'enterprise' }
                      ],
                      examples: [
                          { title: 'Healthcare System Dashboard', description: 'Comprehensive monitoring of all system components with healthcare-specific KPIs and alerts.' },
                          { title: 'Compliance Monitoring', description: 'Real-time tracking of system metrics relevant to regulatory compliance.' }
                      ]
                    },
                    { id: 'cicd', name: 'CI/CD', 
                      description: 'Continuous integration and deployment pipeline',
                      technologies: [
                          { name: 'GitHub Actions', description: 'CI/CD platform', badge: 'cloud' },
                          { name: 'Jenkins', description: 'Automation server', badge: 'open-source' },
                          { name: 'GitLab CI', description: 'CI/CD platform', badge: 'open-source' },
                          { name: 'Azure DevOps', description: 'Development platform', badge: 'cloud' }
                      ],
                      examples: [
                          { title: 'Regulated Software Pipeline', description: 'CI/CD pipeline with built-in validation steps for healthcare software compliance requirements.' },
                          { title: 'Infrastructure as Code Deployment', description: 'Automated deployment process for consistent environment provisioning.' }
                      ]
                    },
                    { id: 'ai-devops', name: 'AI DevOps', 
                      description: 'AI-powered automation and optimization for operations',
                      technologies: [
                          { name: 'MLflow', description: 'ML lifecycle platform', badge: 'open-source' },
                          { name: 'Kubeflow', description: 'ML toolkit for Kubernetes', badge: 'open-source' },
                          { name: 'BentoML', description: 'Model serving framework', badge: 'open-source' },
                          { name: 'Seldon Core', description: 'ML deployment on Kubernetes', badge: 'open-source' }
                      ],
                      examples: [
                          { title: 'Predictive Resource Scaling', description: 'AI system that anticipates usage patterns and scales infrastructure ahead of demand.' },
                          { title: 'Automated Incident Response', description: 'ML models that detect, classify, and suggest resolutions for system incidents.' }
                      ]
                    }
                ]
            }
        ];
        
        // Connection definitions
        const connections = [
            { from: 'client', to: 'api', type: 'vertical' },
            { from: 'api', to: 'orchestration', type: 'vertical' },
            { from: 'orchestration', to: 'service', type: 'vertical' },
            { from: 'service', to: 'integration', type: 'vertical' },
            { from: 'data', to: 'orchestration', type: 'horizontal' },
            { from: 'orchestration', to: 'ai', type: 'horizontal' },
            { from: 'ai', to: 'devops', type: 'vertical' }
        ];
        
        // Create components
        const diagram = document.getElementById('diagram');
        
        components.forEach(comp => {
            // Create the component box
            const box = document.createElement('div');
            box.id = comp.id;
            box.className = `box ${comp.type}`;
            box.style.left = `${comp.x}px`;
            box.style.top = `${comp.y}px`;
            box.style.width = `${comp.width}px`;
            box.style.height = `${comp.height}px`;
            
            // Add title
            const title = document.createElement('div');
            title.className = 'box-title';
            title.textContent = comp.title;
            box.appendChild(title);
            
            // Add subcomponents if any
            if (comp.subcomponents && comp.subcomponents.length > 0) {
                const subContainer = document.createElement('div');
                subContainer.style.display = 'flex';
                subContainer.style.flexWrap = 'wrap';
                subContainer.style.justifyContent = 'center';
                
                comp.subcomponents.forEach(sub => {
                    const subcomp = document.createElement('div');
                    subcomp.className = 'subcomponent';
                    subcomp.textContent = sub.name;
                    subcomp.setAttribute('data-id', sub.id);
                    subcomp.addEventListener('click', (e) => {
                        e.stopPropagation(); // Prevent triggering parent's click
                        showSubcomponentModal(comp.id, sub.id);
                    });
                    subContainer.appendChild(subcomp);
                });
                
                box.appendChild(subContainer);
            }
            
            // Add click event for the entire component
            box.addEventListener('click', () => {
                showComponentModal(comp.id);
            });
            
            diagram.appendChild(box);
        });
        
              components.filter(comp => comp.type === 'guardrails-overlay').forEach(overlay => {
                  const overlayBox = document.createElement('div');
                  overlayBox.id = overlay.id;
                  overlayBox.className = overlay.type;
                  overlayBox.style.position = 'absolute';
                  overlayBox.style.left = `${overlay.x}px`;
                  overlayBox.style.top = `${overlay.y}px`;
                  overlayBox.style.width = `${overlay.width}px`;
                  overlayBox.style.height = `${overlay.height}px`;
                  
                  // Add the border legend
                  const label = document.createElement('div');
                  label.className = 'border-legend';
                  label.textContent = 'guardrails'; // lowercase to match your image
                  overlayBox.appendChild(label);
                  
                  diagram.appendChild(overlayBox);
              });
        // Create connections
        connections.forEach(conn => {
            const fromBox = document.getElementById(conn.from);
            const toBox = document.getElementById(conn.to);
            
            if (!fromBox || !toBox) return;
            
            // Calculate positions based on box dimensions
            const fromRect = fromBox.getBoundingClientRect();
            const toRect = toBox.getBoundingClientRect();
            const diagramRect = diagram.getBoundingClientRect();
            
            const fromX = fromRect.left + fromRect.width / 2 - diagramRect.left;
            const fromY = fromRect.top + fromRect.height / 2 - diagramRect.top;
            const toX = toRect.left + toRect.width / 2 - diagramRect.left;
            const toY = toRect.top + toRect.height / 2 - diagramRect.top;
            
            // Create connection based on type
            if (conn.type === 'vertical') {
                // Vertical connection (top to bottom)
                const line = document.createElement('div');
                line.className = 'connection';
                
                // Position line between bottom of first box and top of second
                const startY = fromY + fromRect.height / 2;
                const endY = toY - toRect.height / 2;
                const height = endY - startY;
                
                line.style.left = `${fromX}px`;
                line.style.top = `${startY}px`;
                line.style.width = '2px';
                line.style.height = `${height}px`;
                
                // Add arrow at the end
                const arrow = document.createElement('div');
                arrow.className = 'arrow arrow-down';
                arrow.style.left = `${fromX - 4}px`;
                arrow.style.top = `${endY - 8}px`;
                
                diagram.appendChild(line);
                diagram.appendChild(arrow);
                
            } else if (conn.type === 'horizontal') {
                // Horizontal connection (left to right or right to left)
                const line = document.createElement('div');
                line.className = 'connection';
                
                // Determine direction
                const isLeftToRight = fromX < toX;
                
                // Position line between right of first box and left of second (or vice versa)
                const startX = isLeftToRight ? 
                    fromX + fromRect.width / 2 : 
                    fromX - fromRect.width / 2;
                const endX = isLeftToRight ? 
                    toX - toRect.width / 2 : 
                    toX + toRect.width / 2;
                const width = Math.abs(endX - startX);
                
                line.style.left = `${Math.min(startX, endX)}px`;
                line.style.top = `${fromY}px`;
                line.style.width = `${width}px`;
                line.style.height = '2px';
                
                // Add arrow at the end
                const arrow = document.createElement('div');
                arrow.className = isLeftToRight ? 'arrow arrow-right' : 'arrow arrow-left';
                arrow.style.left = isLeftToRight ? `${endX - 8}px` : `${endX}px`;
                arrow.style.top = `${fromY - 4}px`;
                
                diagram.appendChild(line);
                diagram.appendChild(arrow);
            }
        });
        
        // Function to show a component modal
        function showComponentModal(componentId) {
            const component = components.find(c => c.id === componentId);
            if (!component) return;
            
            // Check if modal already exists
            let modal = document.getElementById(`${componentId}-modal`);
            if (!modal) {
                // Create modal
                modal = document.createElement('div');
                modal.id = `${componentId}-modal`;
                modal.className = 'modal';
                
                const content = `
                    <div class="modal-content">
                        <span class="close">&times;</span>
                        <h2>${component.title}</h2>
                        
                        <div class="tab">
                            <button class="tablinks active" onclick="openTab(event, '${componentId}-overview')">Overview</button>
                            <button class="tablinks" onclick="openTab(event, '${componentId}-subcomponents')">Subcomponents</button>
                        </div>
                        
                        <div id="${componentId}-overview" class="tabcontent" style="display: block;">
                            <p>The ${component.title} contains the following key components:</p>
                            <ul>
                                ${component.subcomponents.map(sub => `<li><strong>${sub.name}:</strong> ${sub.description}</li>`).join('')}
                            </ul>
                            <p>Click on any specific subcomponent to see more details about its technologies and implementation examples.</p>
                        </div>
                        
                        <div id="${componentId}-subcomponents" class="tabcontent">
                            <div class="tech-grid">
                                ${component.subcomponents.map(sub => `
                                    <div class="tech-card" onclick="showSubcomponentModal('${componentId}', '${sub.id}')">
                                        <div class="tech-title">${sub.name}</div>
                                        <div>${sub.description}</div>
                                    </div>
                                `).join('')}
                            </div>
                        </div>
                    </div>
                `;
                
                modal.innerHTML = content;
                document.body.appendChild(modal);
                
                // Add close functionality
                const closeBtn = modal.querySelector('.close');
                closeBtn.addEventListener('click', () => {
                    modal.style.display = 'none';
                });
            }
            
            // Show the modal
            modal.style.display = 'block';
        }
        
        // Function to show a subcomponent modal
        function showSubcomponentModal(componentId, subcomponentId) {
        const component = components.find(c => c.id === componentId);
    if (!component) return;
    
    const subcomponent = component.subcomponents.find(s => s.id === subcomponentId);
    if (!subcomponent) return;
    
    let modal = document.getElementById(`${componentId}-${subcomponentId}-modal`);
    if (!modal) {
        modal = document.createElement('div');
        modal.id = `${componentId}-${subcomponentId}-modal`;
        modal.className = 'modal';
        const architectureImages = {
        'service': {
            'diet-service': {
                img: 'diet-engine-arch.png',
                description: 'Diet Service Architecture',
                components: [
                    'Main Agent with Task Delegation',
                    'Prompt Engineering',
                    'RAG Integration',
                    'Diet Plan Generation',
                    'Diet Validation with Guardrails'
                ]
            },
            'support-service': {
                img: 'support-service-arch.png',
                description: 'Support Service Architecture',
                components: [
                    'Ticket Management',
                    'Knowledge Base Integration',
                    'Response Generation',
                    'Customer Interaction Flow'
                ]
            },
            'analytics-service': {
                img: 'analytics-arch.png',
                description: 'Analytics Service Architecture',
                components: [
                    'Data Processing Pipeline',
                    'Statistical Analysis',
                    'Reporting Engine',
                    'Visualization Generation'
                ]
            }
            // Add more service architectures as needed
            }
           };
           const archConfig = architectureImages[componentId]?.[subcomponentId];
        const content = `
            <div class="modal-content">
                <span class="close">&times;</span>
                <h2>${subcomponent.name}</h2>
                <p>${subcomponent.description}</p>
                
                <div class="tab">
                    <button class="tablinks active" onclick="openTab(event, '${subcomponentId}-tech')">Technologies</button>
                    <button class="tablinks" onclick="openTab(event, '${subcomponentId}-examples')">Examples</button>
                    <button class="tablinks" onclick="openTab(event, '${subcomponentId}-arch')">Architecture</button>
                </div>
                
                <div id="${subcomponentId}-tech" class="tabcontent" style="display: block;">
                    <h3>Key Technologies</h3>
                    <div class="tech-grid">
                        ${subcomponent.technologies.map(tech => `
                            <div class="tech-card">
                                <div class="tech-title">${tech.name}</div>
                                <div>${tech.description}</div>
                                ${tech.badge ? `<span class="badge badge-${tech.badge}">${tech.badge}</span>` : ''}
                            </div>
                        `).join('')}
                    </div>
                </div>
                
                <div id="${subcomponentId}-examples" class="tabcontent">
                    <h3>Implementation Examples</h3>
                    ${subcomponent.examples.map(example => `
                        <div class="example-box">
                            <div class="example-title">${example.title}</div>
                            <p>${example.description}</p>
                        </div>
                    `).join('')}
                </div>

                ${archConfig ? `
                <div id="${subcomponentId}-arch" class="tabcontent">
                    <h3>${archConfig.description}</h3>
                    <div class="arch-image-container" style="text-align: center; margin: 20px 0;">
                        <img src="${archConfig.img}" alt="${archConfig.description}" 
                             style="max-width: 100%; height: auto; border: 1px solid #ddd; border-radius: 4px; padding: 10px;">
                        <div style="margin-top: 15px; text-align: left;">
                            <h4>Key Components:</h4>
                            <ul>
                                ${archConfig.components.map(comp => `<li>${comp}</li>`).join('')}
                            </ul>
                        </div>
                    </div>
                </div>
            ` : ''}
            </div>
        `;
        
        modal.innerHTML = content;
        document.body.appendChild(modal);
        
        const closeBtn = modal.querySelector('.close');
        closeBtn.addEventListener('click', () => {
            modal.style.display = 'none';
        });
    }
    
    modal.style.display = 'block';
}
        
        // Tab functionality
        function openTab(event, tabName) {
            const tabcontent = document.getElementsByClassName('tabcontent');
            for (let i = 0; i < tabcontent.length; i++) {
                tabcontent[i].style.display = 'none';
            }
            
            const tablinks = document.getElementsByClassName('tablinks');
            for (let i = 0; i < tablinks.length; i++) {
                tablinks[i].className = tablinks[i].className.replace(' active', '');
            }
            
            document.getElementById(tabName).style.display = 'block';
            event.currentTarget.className += ' active';
        }
        
        // Make the openTab function globally available
        window.openTab = openTab;
        
        // Make the showSubcomponentModal function globally available
        window.showSubcomponentModal = showSubcomponentModal;
        
        // Close modal when clicking outside of the content
        window.addEventListener('click', (event) => {
            const modals = document.getElementsByClassName('modal');
            for (let i = 0; i < modals.length; i++) {
                if (event.target == modals[i]) {
                    modals[i].style.display = 'none';
                }
            }
        });
        
        // Home button functionality
        document.getElementById('homeBtn').addEventListener('click', () => {
            const modals = document.getElementsByClassName('modal');
            for (let i = 0; i < modals.length; i++) {
                modals[i].style.display = 'none';
            }
        });
    </script>
</body>
</html>// ... existing code ...