Spaces:
Sleeping
Sleeping
| <mxGraphModel dx="1800" dy="1100" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1920" pageHeight="1080" math="0" shadow="1"> | |
| <root> | |
| <mxCell id="0" /> | |
| <mxCell id="1" parent="0" /> | |
| <mxCell id="bg" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#0D1117;strokeColor=none;" vertex="1" parent="1"> | |
| <mxGeometry x="-20" y="-20" width="1960" height="1120" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="title_bg" value="" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#161B22;strokeColor=#30363D;" vertex="1" parent="1"> | |
| <mxGeometry x="20" y="20" width="1880" height="70" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="title" value="<font style="font-size:24px;font-weight:bold;" color="#58A6FF">Semantic Neuro-Symbolic VQA -- Enterprise Architecture</font><br><font style="font-size:11px;" color="#8B949E">React Native Mobile UI | FastAPI (Uvicorn) | PyTorch | OpenAI CLIP | Wikidata SPARQL | Groq LLM (Llama-3.3-70B-Versatile)</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;" vertex="1" parent="1"> | |
| <mxGeometry x="20" y="20" width="1880" height="70" as="geometry" /> | |
| </mxCell> | |
| <!-- ===================== CLIENT LAYER ===================== --> | |
| <mxCell id="client_layer" value="<font style="font-size:14px;font-weight:bold;" color="#79C0FF">[1] CLIENT LAYER</font>" style="swimlane;startSize=30;fillColor=#161B22;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontStyle=1;fontSize=13;rounded=10;" vertex="1" parent="1"> | |
| <mxGeometry x="20" y="110" width="350" height="870" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="mobile_label" value="[React Native / Expo]" style="text;html=1;fontSize=20;align=center;fillColor=none;strokeColor=none;fontColor=#58A6FF;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="80" y="38" width="190" height="35" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="mobile_app" value="<b>React Native Mobile App</b><br><font color="#8B949E">Expo Framework | iOS and Android</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1C2128;strokeColor=#30363D;fontColor=#FFFFFF;fontSize=12;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="85" width="290" height="60" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="screen_login" value="<b>LoginScreen.js</b><br><font color="#8B949E">Auth | Session Management</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#0D2137;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="165" width="290" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="screen_camera" value="<b>CameraScreen.js</b><br><font color="#8B949E">Image Capture | Upload</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#0D2137;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="225" width="290" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="screen_home" value="<b>HomeScreen.js</b><br><font color="#8B949E">Main Dashboard | History</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#0D2137;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="285" width="290" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="screen_qa" value="<b>QuestionScreen.js</b><br><font color="#8B949E">Q and A Interface | Conversation</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#0D2137;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="345" width="290" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="screen_result" value="<b>ResultScreen.js</b><br><font color="#8B949E">Answer Display | KG Enhancement</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#0D2137;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="405" width="290" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="api_js" value="<b>api.js (API Service)</b><br><font color="#8B949E">Axios | FormData | Session Tokens<br>REST calls to FastAPI backend</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1A2820;strokeColor=#3FB950;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="478" width="290" height="70" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep1" value="POST /api/answer" style="rounded=5;whiteSpace=wrap;html=1;fillColor=#0D1117;strokeColor=#3FB950;fontColor=#3FB950;fontSize=10;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="565" width="135" height="30" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep2" value="POST /api/conversation/answer" style="rounded=5;whiteSpace=wrap;html=1;fillColor=#0D1117;strokeColor=#3FB950;fontColor=#3FB950;fontSize=10;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="177" y="565" width="143" height="30" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep3" value="GET /api/models/info" style="rounded=5;whiteSpace=wrap;html=1;fillColor=#0D1117;strokeColor=#3FB950;fontColor=#3FB950;fontSize=10;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="605" width="135" height="30" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep4" value="GET/DELETE /api/conversation/{id}" style="rounded=5;whiteSpace=wrap;html=1;fillColor=#0D1117;strokeColor=#3FB950;fontColor=#3FB950;fontSize=10;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="177" y="605" width="143" height="30" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="client_tech" value="<b>Tech:</b> Expo | React Navigation | Axios | FormData<br><b>Auth:</b> Session tokens | Context API" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#161B22;strokeColor=#21262D;fontColor=#8B949E;fontSize=10;" vertex="1" parent="client_layer"> | |
| <mxGeometry x="30" y="660" width="290" height="55" as="geometry" /> | |
| </mxCell> | |
| <!-- ===================== API GATEWAY LAYER ===================== --> | |
| <mxCell id="api_layer" value="<font style="font-size:14px;font-weight:bold;" color="#56D364">[2] API GATEWAY LAYER</font>" style="swimlane;startSize=30;fillColor=#161B22;strokeColor=#3FB950;fontColor=#FFFFFF;fontStyle=1;fontSize=13;rounded=10;" vertex="1" parent="1"> | |
| <mxGeometry x="400" y="110" width="360" height="870" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="apigw_label" value="[FastAPI + Uvicorn]" style="text;html=1;fontSize=20;align=center;fillColor=none;strokeColor=none;fontColor=#3FB950;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="85" y="38" width="190" height="35" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="fastapi_main" value="<b>FastAPI Backend (Uvicorn)</b><br><font color="#8B949E">backend_api.py<br>Host: 0.0.0.0 | Port: 8000<br>CORS enabled | Auto-reload dev mode</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#162415;strokeColor=#3FB950;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="88" width="320" height="80" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="startup" value="<b>Startup Event</b><br><font color="#8B949E">Load checkpoints | Init models<br>Init Groq service | Health check</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#1C2128;strokeColor=#30363D;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="188" width="320" height="60" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep_health" value="GET /health<br><font color="#8B949E">Model status check</font>" style="rounded=6;whiteSpace=wrap;html=1;fillColor=#0D2137;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="268" width="145" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep_root" value="GET /<br><font color="#8B949E">API info and docs</font>" style="rounded=6;whiteSpace=wrap;html=1;fillColor=#0D2137;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="175" y="268" width="145" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep_answer" value="POST /api/answer<br><font color="#8B949E">image + question -> JSON answer</font>" style="rounded=6;whiteSpace=wrap;html=1;fillColor=#132D0E;strokeColor=#3FB950;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="328" width="300" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep_conv" value="POST /api/conversation/answer<br><font color="#8B949E">Multi-turn | session_id | pronouns</font>" style="rounded=6;whiteSpace=wrap;html=1;fillColor=#132D0E;strokeColor=#3FB950;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="388" width="300" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep_hist" value="GET /api/conversation/{id}/history" style="rounded=6;whiteSpace=wrap;html=1;fillColor=#1C2128;strokeColor=#30363D;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="448" width="300" height="38" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep_del" value="DELETE /api/conversation/{id}" style="rounded=6;whiteSpace=wrap;html=1;fillColor=#1C2128;strokeColor=#30363D;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="496" width="300" height="38" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ep_models" value="GET /api/models/info" style="rounded=6;whiteSpace=wrap;html=1;fillColor=#1C2128;strokeColor=#30363D;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="544" width="300" height="38" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="middleware" value="<b>Middleware</b><br><font color="#8B949E">CORS | Error handling | HTTP 400/503/500</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#1C2128;strokeColor=#30363D;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="600" width="320" height="50" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="conv_manager" value="<b>ConversationManager</b><br><font color="#8B949E">conversation_manager.py<br>Session 30min timeout | Pronoun resolution<br>History storage | Context retrieval</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1A1A2E;strokeColor=#7B2FBE;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="api_layer"> | |
| <mxGeometry x="20" y="670" width="320" height="80" as="geometry" /> | |
| </mxCell> | |
| <!-- ===================== ML INFERENCE ENGINE ===================== --> | |
| <mxCell id="ml_layer" value="<font style="font-size:14px;font-weight:bold;" color="#FFA657">[3] ML INFERENCE ENGINE</font>" style="swimlane;startSize=30;fillColor=#161B22;strokeColor=#D29922;fontColor=#FFFFFF;fontStyle=1;fontSize=13;rounded=10;" vertex="1" parent="1"> | |
| <mxGeometry x="800" y="110" width="380" height="870" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ml_label" value="[PyTorch + CLIP + DistilGPT-2]" style="text;html=1;fontSize=16;align=center;fillColor=none;strokeColor=none;fontColor=#D29922;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="40" y="38" width="300" height="35" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ensemble_vqa" value="<b>ProductionEnsembleVQA</b><br><font color="#8B949E">ensemble_vqa_app.py<br>Device: CUDA / CPU auto-detect<br>Beam Search width=5 | Top-K Decoding</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#2D2000;strokeColor=#D29922;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="20" y="88" width="340" height="80" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="router" value="<b>Question Router (Keyword Classifier)</b><br><font color="#8B949E">is_spatial_question()<br>Spatial keywords: left, right, above, below, next to...<br>Routes to Base or Spatial model</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#1E1E00;strokeColor=#D29922;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="20" y="188" width="340" height="75" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="base_model_box" value="<b>Base VQA Model</b><br><font color="#8B949E">model.py | VQAModel<br>CLIP ViT-B/32 + GPT-2<br>vqa_checkpoint.pt (731 MB)<br>hidden=512 | layers=2 | acc~50%</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#162415;strokeColor=#3FB950;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="20" y="285" width="158" height="120" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="spatial_model_box" value="<b>Spatial VQA Model</b><br><font color="#8B949E">model_spatial.py<br>SpatialAdapter + 8-head attn<br>vqa_spatial_checkpoint.pt (739 MB)<br>dropout=0.3 | acc~40%</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#0D2137;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="192" y="285" width="168" height="120" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="gpt2" value="<b>DistilGPT-2 Tokenizer</b><br><font color="#8B949E">Text tokenization | Vocab<br>BOS / EOS / PAD tokens | Beam search decoding</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#1C2128;strokeColor=#30363D;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="20" y="425" width="340" height="65" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="clip_box" value="<b>OpenAI CLIP (ViT-B/32)</b><br><font color="#8B949E">Image encoder + Text encoder<br>Zero-shot object detection (80+ nouns)<br>Question routing: visual vs knowledge<br>Anchor similarity | Softmax x10</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1A1A0D;strokeColor=#E3B341;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="20" y="508" width="340" height="90" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="img_proc" value="<b>Image Preprocessor (PIL)</b><br><font color="#8B949E">JPEG/PNG -> RGB | CLIP preprocess | Tensor</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#1C2128;strokeColor=#30363D;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="20" y="615" width="340" height="55" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="pt_files" value="<b>PyTorch Checkpoints (Local Disk)</b><br><font color="#8B949E">vqa_checkpoint.pt (731 MB)<br>vqa_spatial_checkpoint.pt (739 MB)<br>state_dict | vocab | tokenizer config</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#251A00;strokeColor=#D29922;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="20" y="688" width="340" height="80" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="gpu_badge" value="GPU: CUDA | ~4 GB VRAM | 2x Model Parallel loading" style="rounded=5;whiteSpace=wrap;html=1;fillColor=#0D1117;strokeColor=#D29922;fontColor=#E3B341;fontSize=10;" vertex="1" parent="ml_layer"> | |
| <mxGeometry x="20" y="785" width="340" height="28" as="geometry" /> | |
| </mxCell> | |
| <!-- ===================== NEURO-SYMBOLIC PIPELINE ===================== --> | |
| <mxCell id="ns_layer" value="<font style="font-size:14px;font-weight:bold;" color="#BC8CFF">[4] NEURO-SYMBOLIC PIPELINE</font>" style="swimlane;startSize=30;fillColor=#161B22;strokeColor=#8957E5;fontColor=#FFFFFF;fontStyle=1;fontSize=13;rounded=10;" vertex="1" parent="1"> | |
| <mxGeometry x="1220" y="110" width="370" height="870" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ns_label" value="[CLIP + Wikidata SPARQL + Groq LLM]" style="text;html=1;fontSize=14;align=center;fillColor=none;strokeColor=none;fontColor=#8957E5;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="15" y="38" width="340" height="35" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ns_main" value="<b>SemanticNeurosymbolicVQA</b><br><font color="#8B949E">semantic_neurosymbolic_vqa.py<br>Neural -> Symbolic -> Verbalize pipeline</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1A0D2E;strokeColor=#8957E5;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="20" y="88" width="330" height="65" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ns_step1" value="<b>Step 1: CLIP Routing</b><br><font color="#8B949E">should_use_neurosymbolic()<br>VISUAL anchor vs KNOWLEDGE anchor<br>Temperature softmax x10</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#0D1A30;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="20" y="173" width="330" height="78" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="route_decision" value="VISUAL question?<br>-> Neural VQA only<br>KNOWLEDGE question?<br>-> Neuro-Symbolic" style="rhombus;whiteSpace=wrap;html=1;fillColor=#21262D;strokeColor=#8957E5;fontColor=#FFFFFF;fontSize=10;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="75" y="268" width="220" height="88" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ns_step2" value="<b>Step 2: CLIP Object Detection</b><br><font color="#8B949E">detect_objects_with_clip()<br>80+ noun vocabulary | Top-3 objects<br>Cosine similarity | prompt: 'a photo of a {label}'</font>" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#0D1A30;strokeColor=#1F6FEB;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="20" y="375" width="330" height="80" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="wikidata_box" value="<b>Step 3: WikidataKnowledgeBase</b><br><font color="#8B949E">SPARQL: query.wikidata.org<br>P31 (category) | P186 (material) | P366 (uses)<br>P2101 (melting pt) | P2054 (density)<br>lru_cache(500) | timeout=10s</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#0D2E2E;strokeColor=#2EA8A8;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="20" y="473" width="330" height="100" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="groq_box" value="<b>Step 4: Groq LLM Verbalizer</b><br><font color="#8B949E">WikidataGroqAnswerer<br>Model: llama-3.3-70b-versatile<br>Temp=0.1 | max_tokens=180 | top_p=0.9<br>Answers ONLY from Wikidata facts</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1A2B1A;strokeColor=#F85149;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="20" y="592" width="330" height="95" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="groq_access" value="<b>Groq Accessibility Service</b><br><font color="#8B949E">groq_service.py | GroqDescriptionService<br>2-sentence narrations for blind users<br>Temp=0.7 | max_tokens=150</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1A2B1A;strokeColor=#F85149;fontColor=#FFFFFF;fontSize=11;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="20" y="706" width="330" height="85" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="groq_badge" value="Groq API | Llama-3.3-70B-Versatile | GROQ_API_KEY env var" style="rounded=5;whiteSpace=wrap;html=1;fillColor=#0D1117;strokeColor=#F85149;fontColor=#F85149;fontSize=10;" vertex="1" parent="ns_layer"> | |
| <mxGeometry x="20" y="808" width="330" height="28" as="geometry" /> | |
| </mxCell> | |
| <!-- ===================== EXTERNAL SERVICES ===================== --> | |
| <mxCell id="wikidata_ext" value="<b>Wikidata SPARQL API</b><br><font color="#8B949E">query.wikidata.org/sparql<br>wikidata.org/w/api.php<br>Entity lookup | Property values<br>Free and Open Knowledge Base</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#0A2525;strokeColor=#2EA8A8;fontColor=#FFFFFF;fontSize=12;" vertex="1" parent="1"> | |
| <mxGeometry x="1640" y="200" width="250" height="130" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="groq_cloud" value="<b>Groq Cloud API</b><br><font color="#8B949E">api.groq.com<br>Llama-3.3-70B-Versatile<br>Ultra-low latency inference<br>chat.completions endpoint</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1A0A0A;strokeColor=#F85149;fontColor=#FFFFFF;fontSize=12;" vertex="1" parent="1"> | |
| <mxGeometry x="1640" y="385" width="250" height="130" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="hf_clip" value="<b>OpenAI / HuggingFace Hub</b><br><font color="#8B949E">CLIP ViT-B/32 weights<br>GPT-2 / DistilGPT-2 tokenizer<br>Cached locally after first download</font>" style="rounded=10;whiteSpace=wrap;html=1;fillColor=#1A1000;strokeColor=#E3B341;fontColor=#FFFFFF;fontSize=12;" vertex="1" parent="1"> | |
| <mxGeometry x="1640" y="565" width="250" height="105" as="geometry" /> | |
| </mxCell> | |
| <!-- ===================== LEGEND ===================== --> | |
| <mxCell id="legend" value="<b>LEGEND</b><br>[1] Blue = Client Layer (React Native)<br>[2] Green = API Gateway (FastAPI)<br>[3] Orange = ML Inference (PyTorch)<br>[4] Purple = Neuro-Symbolic Pipeline<br>Solid arrow = Primary data flow<br>Dashed arrow = Conditional / supplement<br>Animated = Live request flow" style="rounded=8;whiteSpace=wrap;html=1;fillColor=#161B22;strokeColor=#30363D;fontColor=#8B949E;fontSize=11;align=left;" vertex="1" parent="1"> | |
| <mxGeometry x="1640" y="710" width="250" height="155" as="geometry" /> | |
| </mxCell> | |
| <!-- ===================== EDGES / ANIMATED FLOWS ===================== --> | |
| <!-- 1. api.js -> FastAPI (HTTP REST) --> | |
| <mxCell id="flow_1" value="<font color="#3FB950">HTTP REST (JSON/FormData)</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;strokeColor=#3FB950;strokeWidth=3;fontSize=10;fontColor=#3FB950;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="api_js" target="fastapi_main"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 2. FastAPI -> Ensemble VQA --> | |
| <mxCell id="flow_2" value="<font color="#FFA657">answer()</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;strokeColor=#D29922;strokeWidth=3;fontSize=10;fontColor=#FFA657;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="fastapi_main" target="ensemble_vqa"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 3. Ensemble -> Router --> | |
| <mxCell id="flow_3" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#D29922;strokeWidth=2;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="ensemble_vqa" target="router"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 4a. Router -> Base Model --> | |
| <mxCell id="flow_4a" value="<font color="#3FB950">General Q</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#3FB950;strokeWidth=2;animation=1;endArrow=block;endFill=1;fontSize=10;fontColor=#3FB950;" edge="1" parent="1" source="router" target="base_model_box"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 4b. Router -> Spatial Model --> | |
| <mxCell id="flow_4b" value="<font color="#58A6FF">Spatial Q</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#1F6FEB;strokeWidth=2;animation=1;endArrow=block;endFill=1;fontSize=10;fontColor=#58A6FF;" edge="1" parent="1" source="router" target="spatial_model_box"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 5. Ensemble -> NS Pipeline (supplement) --> | |
| <mxCell id="flow_5" value="<font color="#BC8CFF">NS supplement</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;strokeColor=#8957E5;strokeWidth=3;fontSize=10;fontColor=#BC8CFF;animation=1;dashed=1;endArrow=block;endFill=1;" edge="1" parent="1" source="ensemble_vqa" target="ns_main"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 6. NS main -> CLIP Routing --> | |
| <mxCell id="flow_6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#8957E5;strokeWidth=2;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="ns_main" target="ns_step1"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 7. CLIP Routing -> Decision diamond --> | |
| <mxCell id="flow_7" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#8957E5;strokeWidth=2;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="ns_step1" target="route_decision"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 8. Decision -> Object Detection --> | |
| <mxCell id="flow_8" value="<font color="#BC8CFF">Knowledge Q</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#8957E5;strokeWidth=2;animation=1;dashed=1;endArrow=block;endFill=1;fontSize=10;fontColor=#BC8CFF;" edge="1" parent="1" source="route_decision" target="ns_step2"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 9. Object Detection -> Wikidata box --> | |
| <mxCell id="flow_9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#2EA8A8;strokeWidth=2;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="ns_step2" target="wikidata_box"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 10. Wikidata box -> Wikidata external API --> | |
| <mxCell id="flow_10" value="<font color="#2EA8A8">SPARQL queries</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#2EA8A8;strokeWidth=3;fontSize=10;fontColor=#2EA8A8;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="wikidata_box" target="wikidata_ext"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 11. Wikidata facts -> Groq verbalizer --> | |
| <mxCell id="flow_11" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#F85149;strokeWidth=2;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="wikidata_box" target="groq_box"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 12. Groq box -> Groq Cloud --> | |
| <mxCell id="flow_12" value="<font color="#F85149">API call | Llama-3.3-70B</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#F85149;strokeWidth=3;fontSize=10;fontColor=#F85149;animation=1;endArrow=block;endFill=1;" edge="1" parent="1" source="groq_box" target="groq_cloud"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 13. Groq accessibility -> Groq Cloud --> | |
| <mxCell id="flow_13" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#F85149;strokeWidth=2;animation=1;dashed=1;endArrow=block;endFill=1;" edge="1" parent="1" source="groq_access" target="groq_cloud"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 14. FastAPI -> Groq Accessibility (top arc) --> | |
| <mxCell id="flow_14" value="<font color="#F85149">accessibility narration</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#F85149;strokeWidth=2;fontSize=10;fontColor=#F85149;animation=1;dashed=1;endArrow=block;endFill=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="fastapi_main" target="groq_access"> | |
| <mxGeometry relative="1" as="geometry"> | |
| <Array as="points"> | |
| <mxPoint x="580" y="140" /> | |
| <mxPoint x="1385" y="140" /> | |
| </Array> | |
| </mxGeometry> | |
| </mxCell> | |
| <!-- 15. CLIP box -> HuggingFace (model weights) --> | |
| <mxCell id="flow_15" value="<font color="#E3B341">model weights (cached)</font>" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#E3B341;strokeWidth=2;fontSize=10;fontColor=#E3B341;dashed=1;endArrow=block;endFill=1;" edge="1" parent="1" source="clip_box" target="hf_clip"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 16a. Base model -> GPT2 Tokenizer --> | |
| <mxCell id="flow_16a" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#30363D;strokeWidth=1;endArrow=block;endFill=1;" edge="1" parent="1" source="base_model_box" target="gpt2"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 16b. Spatial model -> GPT2 Tokenizer --> | |
| <mxCell id="flow_16b" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#30363D;strokeWidth=1;endArrow=block;endFill=1;" edge="1" parent="1" source="spatial_model_box" target="gpt2"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- 17. Conv Manager <-> Ensemble VQA --> | |
| <mxCell id="flow_17" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;strokeColor=#7B2FBE;strokeWidth=2;animation=1;dashed=1;endArrow=block;endFill=1;startArrow=block;startFill=1;" edge="1" parent="1" source="conv_manager" target="ensemble_vqa"> | |
| <mxGeometry relative="1" as="geometry" /> | |
| </mxCell> | |
| <!-- ===================== PHASE ANNOTATIONS ===================== --> | |
| <mxCell id="ann1" value="(1) User uploads image + question" style="text;html=1;strokeColor=none;fillColor=#0D1117;fontColor=#58A6FF;fontSize=11;fontStyle=1;align=center;" vertex="1" parent="1"> | |
| <mxGeometry x="100" y="988" width="250" height="28" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ann2" value="(2) REST API routes to ensemble" style="text;html=1;strokeColor=none;fillColor=#0D1117;fontColor=#3FB950;fontSize=11;fontStyle=1;align=center;" vertex="1" parent="1"> | |
| <mxGeometry x="460" y="988" width="240" height="28" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ann3" value="(3) Neural model answers question" style="text;html=1;strokeColor=none;fillColor=#0D1117;fontColor=#FFA657;fontSize=11;fontStyle=1;align=center;" vertex="1" parent="1"> | |
| <mxGeometry x="860" y="988" width="250" height="28" as="geometry" /> | |
| </mxCell> | |
| <mxCell id="ann4" value="(4) Symbolic + Groq enriches answer" style="text;html=1;strokeColor=none;fillColor=#0D1117;fontColor=#BC8CFF;fontSize=11;fontStyle=1;align=center;" vertex="1" parent="1"> | |
| <mxGeometry x="1270" y="988" width="260" height="28" as="geometry" /> | |
| </mxCell> | |
| </root> | |
| </mxGraphModel> | |