-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflow.d2
More file actions
224 lines (198 loc) · 5.09 KB
/
Copy pathflow.d2
File metadata and controls
224 lines (198 loc) · 5.09 KB
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
# PaladinAI System Design & Query Flow
direction: down
title: {
label: PaladinAI System Architecture & Query Flow
near: top-center
shape: text
style.font-size: 28
}
# User Interfaces Layer
ui: User Interfaces {
web: Web UI {
icon: https://icons.terrastruct.com/dev%2Freact.svg
shape: rectangle
}
cli: CLI Client {
icon: https://icons.terrastruct.com/aws%2F_general%2Fclient.svg
shape: rectangle
}
discord: Discord Bot {
icon: https://icons.terrastruct.com/social%2F025-discord.svg
shape: rectangle
}
api_client: API Client {
shape: rectangle
}
}
# API Gateway
gateway: API Gateway {
fastapi: FastAPI Server {
shape: hexagon
style.fill: "#2E7D32"
}
}
# Core Workflow Engine
workflow: Workflow Engine {
start: Start Node {
shape: circle
style.fill: "#4CAF50"
}
guardrail: Guardrail Node {
shape: diamond
style.fill: "#FFC107"
}
categorize: Categorization {
shape: diamond
style.fill: "#2196F3"
}
flows: {
query: Query Workflow {
shape: rectangle
style.fill: "#81C784"
}
action: Action Workflow {
shape: rectangle
style.fill: "#64B5F6"
}
incident: Incident Workflow {
shape: rectangle
style.fill: "#FFB74D"
}
}
result: Result Node {
shape: circle
style.fill: "#9C27B0"
}
}
# Data Collection Layer
collectors: Data Collection {
prometheus: Prometheus Node {
icon: https://icons.terrastruct.com/dev%2Fprometheus.svg
shape: rectangle
}
loki: Loki Node {
icon: https://icons.terrastruct.com/dev%2Fgrafana.svg
shape: rectangle
}
alertmanager: Alertmanager Node {
shape: rectangle
}
}
# Intelligence Layer
intelligence: AI & Memory {
llm: OpenAI GPT-4 {
shape: hexagon
style.fill: "#1976D2"
}
memory: Memory Service {
shape: cylinder
style.fill: "#4CAF50"
}
rag: RAG Engine {
shape: cylinder
style.fill: "#FF6F00"
}
}
# Data Stores
storage: Data Layer {
mongodb: MongoDB\n(Checkpoints) {
shape: cylinder
style.fill: "#4DB33D"
}
neo4j: Neo4j\n(Memory Graph) {
shape: cylinder
style.fill: "#018BFF"
}
qdrant: Qdrant\n(Vectors) {
shape: cylinder
style.fill: "#7B1FA2"
}
}
# External Monitoring Stack
monitoring: Monitoring Stack {
prom_server: Prometheus {
shape: rectangle
style.fill: "#E6522C"
}
loki_server: Loki {
shape: rectangle
style.fill: "#F46800"
}
grafana: Grafana {
shape: rectangle
style.fill: "#F46800"
}
alert_server: Alertmanager {
shape: rectangle
style.fill: "#E6522C"
}
}
# Connections - User Flow
ui.web -> gateway.fastapi: "User Query"
ui.cli -> gateway.fastapi: "CLI Command"
ui.discord -> gateway.fastapi: "Discord Message"
ui.api_client -> gateway.fastapi: "API Request"
# Workflow Flow
gateway.fastapi -> workflow.start: "1. Initialize"
workflow.start -> workflow.guardrail: "2. Validate"
workflow.guardrail -> workflow.categorize: "3. Categorize"
workflow.categorize -> workflow.flows.query: "Simple Query"
workflow.categorize -> workflow.flows.action: "Analysis Task"
workflow.categorize -> workflow.flows.incident: "Investigation"
# Data Collection Flow
workflow.flows.query -> collectors.prometheus: "Fetch Metrics"
workflow.flows.action -> collectors.prometheus: "Collect Data"
workflow.flows.action -> collectors.loki: "Fetch Logs"
workflow.flows.incident -> collectors.prometheus: "Full Investigation"
workflow.flows.incident -> collectors.loki
workflow.flows.incident -> collectors.alertmanager: "Check Alerts"
# Intelligence Integration
workflow.guardrail <-> intelligence.memory: "Enhance Context"
workflow.flows.incident <-> intelligence.rag: "Search Docs"
collectors.prometheus -> intelligence.llm: "Analyze"
collectors.loki -> intelligence.llm: "Process"
collectors.alertmanager -> intelligence.llm: "Interpret"
# Result Generation
intelligence.llm -> workflow.result: "Generate Response"
workflow.result -> gateway.fastapi: "Final Result"
# Data Persistence
gateway.fastapi <-> storage.mongodb: "Checkpoints"
intelligence.memory <-> storage.neo4j: "Knowledge Graph"
intelligence.rag <-> storage.qdrant: "Embeddings"
# External Connections
collectors.prometheus <-> monitoring.prom_server: "PromQL"
collectors.loki <-> monitoring.loki_server: "LogQL"
collectors.alertmanager <-> monitoring.alert_server: "Alerts API"
# Legend
legend: Legend {
style.fill: "#F5F5F5"
style.stroke: "#9E9E9E"
user_flow: "User Query Flow" {
style.stroke-width: 3
style.stroke: "#4CAF50"
}
data_flow: "Data Collection" {
style.stroke-width: 3
style.stroke: "#2196F3"
}
ai_flow: "AI Processing" {
style.stroke-width: 3
style.stroke: "#9C27B0"
}
}
# Query Flow Example
example: {
near: bottom-center
label: |md
## Example Query Flow: "Why is the payment service slow?"
1. User asks in natural language
2. Guardrail validates & enhances with memory
3. Categorized as "Incident" workflow
4. Collects metrics, logs, alerts in parallel
5. AI analyzes all data sources
6. Generates root cause analysis
7. Returns actionable response
|
shape: text
style.font-size: 16
}