Production Pipeline Architecture
flowchart TD
Input["Input Layer:
User message + metadata"]:::io
Pre["Preprocessing:
Normalize and tokenize"]:::cache
Cache{"Cache hit?"}:::cache
Hit["Return cached result
Cache Hit: under 5ms"]:::cache
Confidence{"Route by confidence"}:::io
subgraph Fast["Fast Path - under 50ms - most queries"]
direction TB
F1["Pattern matching"]:::fast
F2["Keyword extraction"]:::fast
F1 --> F2
end
subgraph Standard["Standard Path - about 100ms"]
direction TB
S1["POS tagging"]:::standard
S2["Lemmatization"]:::standard
S3["Named entity recognition"]:::standard
S1 --> S2 --> S3
end
subgraph Complex["Complex Path - about 300ms"]
direction TB
C1["Dependency parsing"]:::complex
C2["Coreference resolution"]:::complex
C3["Semantic role labeling"]:::complex
C1 --> C2 --> C3
end
Error["Error Handling:
Try/Catch with Fallback + Logging"]:::error
Output["Output Layer:
Intents + entities to dialog manager"]:::io
Input --> Pre --> Cache
Cache -->|Yes| Hit --> Output
Cache -->|No| Confidence
Confidence -->|high| Fast
Confidence -->|moderate| Standard
Confidence -->|low / complex| Complex
Fast --> Error
Standard --> Error
Complex --> Error
Complex -.->|fallback| Standard
Standard -.->|fallback| Fast
Error --> Output
Output -.->|write back to cache| Cache
classDef io fill:#90a4ae,stroke:#37474f,stroke-width:2px,color:#fff,font-size:14px
classDef cache fill:#42a5f5,stroke:#0d47a1,stroke-width:2px,color:#fff,font-size:14px
classDef fast fill:#66bb6a,stroke:#1b5e20,stroke-width:2px,color:#fff,font-size:14px
classDef standard fill:#ffd54f,stroke:#f57f17,stroke-width:2px,color:#333,font-size:14px
classDef complex fill:#ff8a65,stroke:#bf360c,stroke-width:2px,color:#fff,font-size:14px
classDef error fill:#ef5350,stroke:#b71c1c,stroke-width:2px,color:#fff,font-size:14px
style Fast fill:#e8f5e9,stroke:#66bb6a
style Standard fill:#fff8e1,stroke:#ffca28
style Complex fill:#fbe9e7,stroke:#ff8a65
linkStyle default stroke:#777,stroke-width:2px,font-size:13px
Component Color Key
Input / output
Caching layer
Fast path
Standard path
Complex path
Error handling
Dotted lines = fallback / cache write-back
Component Details
Hover a component to see what it does.