Spaces:
Paused
Paused
Commit Β·
5bb2554
1
Parent(s): 3354ccf
docs: redesign System Architecture to Horizontal Swimlane Architecture with custom styling and execution matrix
Browse files
README.md
CHANGED
|
@@ -44,39 +44,73 @@ The active runtime deployment loads **148,854 in-memory FAISS vectors** across 3
|
|
| 44 |
|
| 45 |
---
|
| 46 |
|
| 47 |
-
## ποΈ
|
| 48 |
|
| 49 |
```mermaid
|
| 50 |
-
graph
|
| 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 |
## π Language Extensibility Matrix
|
|
|
|
| 44 |
|
| 45 |
---
|
| 46 |
|
| 47 |
+
## ποΈ Horizontal Swimlane Architecture
|
| 48 |
|
| 49 |
```mermaid
|
| 50 |
+
graph LR
|
| 51 |
+
%% Custom Styling Classes
|
| 52 |
+
classDef inputStyle fill:#1E293B,stroke:#38BDF8,stroke-width:2px,color:#F8FAFC;
|
| 53 |
+
classDef sttStyle fill:#0F172A,stroke:#818CF8,stroke-width:2px,color:#F8FAFC;
|
| 54 |
+
classDef guardStyle fill:#311B92,stroke:#B388FF,stroke-width:2px,color:#FFFFFF;
|
| 55 |
+
classDef cacheStyle fill:#064E3B,stroke:#34D399,stroke-width:2px,color:#F8FAFC;
|
| 56 |
+
classDef faissStyle fill:#164E63,stroke:#22D3EE,stroke-width:2px,color:#F8FAFC;
|
| 57 |
+
classDef synthStyle fill:#4C1D95,stroke:#C084FC,stroke-width:2px,color:#F8FAFC;
|
| 58 |
+
classDef outStyle fill:#065F46,stroke:#10B981,stroke-width:2px,color:#FFFFFF;
|
| 59 |
+
classDef blockStyle fill:#881337,stroke:#F43F5E,stroke-width:2px,color:#FFFFFF;
|
| 60 |
+
|
| 61 |
+
subgraph PATH1 ["ποΈ Path 1: Audio & Text Ingestion"]
|
| 62 |
+
A[Audio Upload / Microphone Stream] ::: inputStyle --> STT[Sarvam Saaras STT + ffmpeg 16kHz] ::: sttStyle
|
| 63 |
+
T[Raw Text Input Bypass] ::: inputStyle --> ROUTER[Language Resolution Router] ::: sttStyle
|
| 64 |
+
STT --> ROUTER
|
| 65 |
+
end
|
| 66 |
+
|
| 67 |
+
subgraph PATH2 ["π‘οΈ Path 2: 4-Tier Security Shield"]
|
| 68 |
+
ROUTER --> G1[Tier-1 Stem Regex + Obfuscation Decoder] ::: guardStyle
|
| 69 |
+
G1 -- Safe --> G2[Tier-2 Meta Prompt-Guard 86M DPI] ::: guardStyle
|
| 70 |
+
G2 -- Safe --> G3[Tier-3 6-Class Query Intent Gate] ::: guardStyle
|
| 71 |
+
G3 -- Factual --> G4[Tier-4 Own-Lang Centroid Distance Gate] ::: guardStyle
|
| 72 |
+
end
|
| 73 |
+
|
| 74 |
+
subgraph PATH3 ["β‘ Path 3: Sub-0.5ms Hot Cache Fast-Path"]
|
| 75 |
+
G4 -- On-Topic --> CACHE{Hot Cache Lookup} ::: cacheStyle
|
| 76 |
+
CACHE -- "Hit (<0.5ms)" --> FAST_OUT[Zero-Latency Response] ::: outStyle
|
| 77 |
+
end
|
| 78 |
+
|
| 79 |
+
subgraph PATH4 ["π Path 4: Hybrid Vector Retrieval Engine"]
|
| 80 |
+
CACHE -- "Miss" --> EMB[multilingual-e5-small INT8 ONNX] ::: faissStyle
|
| 81 |
+
EMB --> FAISS[Parallel FAISS HNSW Native & LongDoc Search] ::: faissStyle
|
| 82 |
+
FAISS --> RRF[Reciprocal Rank Fusion k=60] ::: faissStyle
|
| 83 |
+
RRF --> BM25[Adaptive Script-Aware BM25 Fusion] ::: faissStyle
|
| 84 |
+
BM25 --> GATE{Disqualification Gate} ::: faissStyle
|
| 85 |
+
end
|
| 86 |
+
|
| 87 |
+
subgraph PATH5 ["π§ Path 5: Deterministic Synthesis & Grounding"]
|
| 88 |
+
GATE -- High Relevance --> IPI[Batched Prompt-Guard IPI Context Scan] ::: synthStyle
|
| 89 |
+
IPI -- Clean Chunks --> SYNTH[Continuous TextRank + SVD Energy Synthesis] ::: synthStyle
|
| 90 |
+
SYNTH --> GROUND[Post-Gen Grounding Overlap Verifier] ::: synthStyle
|
| 91 |
+
GROUND -- Grounded --> FINAL_OUT[JSON Response + 9-Stage Telemetry] ::: outStyle
|
| 92 |
+
end
|
| 93 |
+
|
| 94 |
+
%% Rejection Routing
|
| 95 |
+
G1 -- Blocked --> REJECT[Declined Response: Safety Violation] ::: blockStyle
|
| 96 |
+
G2 -- Injected --> REJECT
|
| 97 |
+
G3 -- Non-Factual --> REJECT
|
| 98 |
+
G4 -- Off-Topic --> REJECT
|
| 99 |
+
GATE -- Score < 0.35 --> DECLINE[Declined Response: Insufficient Info] ::: blockStyle
|
| 100 |
+
IPI -- Poisoned --> REJECT
|
| 101 |
+
GROUND -- Ungrounded --> DECLINE
|
| 102 |
```
|
| 103 |
|
| 104 |
+
### π£οΈ Swimlane Pipeline Execution Breakdown
|
| 105 |
+
|
| 106 |
+
| Swimlane / Path | Key Components & Models | Latency Budget | Action on Failure / Edge Case |
|
| 107 |
+
| :--- | :--- | :---: | :--- |
|
| 108 |
+
| **ποΈ Path 1: Ingestion & STT** | Sarvam Saaras `saaras:v3` + `ffmpeg` 16kHz mono normalizer | `< 150 ms` (Audio) / `< 0.1 ms` (Text) | Fallback to default `language_hint` or auto-detect |
|
| 109 |
+
| **π‘οΈ Path 2: 4-Tier Security Shield** | Tier-1 Regex Stem Gap=4, Tier-2 Prompt-Guard 86M ONNX, Tier-3 6-Class Intent, Tier-4 Centroid Distance | `< 2.5 ms` | Fail-Safe-by-Category (`model_failed=True`), block immediately |
|
| 110 |
+
| **β‘ Path 3: Cache Fast-Path** | Gold QA Pairs + Dynamic In-Memory Vector LRU Cache ($N=2048$) | **`< 0.5 ms`** | Fallback to full retrieval pipeline on cache miss |
|
| 111 |
+
| **π Path 4: Hybrid Search Engine** | `multilingual-e5-small` INT8 ONNX + FAISS HNSW ($M=32$) + RRF ($k=60$) + Script-Aware BM25 | **`< 8.0 ms`** | Candidate disqualification gate if composite score $< 0.35$ |
|
| 112 |
+
| **π§ Path 5: Synthesis & Grounding** | Batched IPI Prompt-Guard + Continuous TextRank + SVD Singular Energy + Token Overlap | **`< 10.0 ms`** | Return standard non-hallucinating template on grounding fail |
|
| 113 |
+
|
| 114 |
---
|
| 115 |
|
| 116 |
## π Language Extensibility Matrix
|