> For the complete documentation index, see [llms.txt](https://docs.neurox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neurox.com/architecture/diagram.md).

# Architecture Diagram

{% @mermaid/diagram content="graph TD
%% Define Distinct Subgraph Backgrounds for Better Contrast
style WorkloadCluster fill:#C7D5E0,stroke:#6D8299,stroke-width:2px,color:#333333
style Private fill:#D2DFE8,stroke:#6D8299,stroke-width:1px,color:#333333
style ControlCluster fill:#B3C2CF,stroke:#6D8299,stroke-width:2px,color:#333333
style BehindIngress fill:#C0CDD8,stroke:#6D8299,stroke-width:1px,color:#333333

```
%% Define Node Styles with More Contrast
classDef uniformNode fill:#A4B6C5,stroke:#495866,stroke-width:1px,color:#333333;
classDef specialNode fill:#7C9CBF,stroke:#495866,stroke-width:1px,color:#333333;

%% Define Arrow Color and Increased Stroke Width
linkStyle default stroke:#333333,stroke-width:2.5px;

%% Define Subgraphs
subgraph WorkloadCluster ["Workload Cluster"]
    subgraph Private ["No Ingress"]
        A["Workload Agent<br>&#91DaemonSet&#93<br>Generates metrics<br>and runs diagnostics"]:::uniformNode
        C["Metrics Forwarder<br>&#91Prometheus Instance&#93<br>Collects & forwards metrics to Thanos"]:::uniformNode
        B["Workload Manager<br>&#91Deployment&#93<br>Relay between the<br>Control Cluster and K8s API"]:::uniformNode
        D["Relay Client<br>&#91Deployment&#93<br>Relays requests from Control Cluster"]:::uniformNode
    end
end

subgraph ControlCluster ["Control Cluster"]
    E["Ingress<br>&#91Ingress&#93<br>Routes external requests and terminates TLS"]:::specialNode
    subgraph BehindIngress ["Behind Ingress"]
        F["Redis<br>&#91StatefulSet&#93<br>Persistent Data Store"]:::uniformNode
        G["Control API<br>&#91Deployment&#93<br>Entrypoint for web and CLI"]:::uniformNode
        H["Relay Server<br>&#91Deployment&#93<br>Workload cluster relay"]:::uniformNode
        I["Metrics Aggregator<br>&#91Thanos Instance&#93<br>Stores and queries metrics"]:::uniformNode
        K["Control SSO<br>&#91Deployment&#93<br>Session Management"]:::uniformNode
        L["Control IdP<br>&#91Deployment&#93<br>User Authentication"]:::uniformNode
        J["Control Portal<br>&#91Deployment&#93<br>Cluster Dashboard"]:::uniformNode
    end
end

Z["Web Browser"]:::specialNode

%% Connections with Enhanced Contrast for Arrows
E -->|Session Validation| K
K -->|Token Validation| L
E -->|User Authentication| L
A -->|Gathered Metrics| C
F -->|Relay configuration| H
G -->|Metric Queries| I
G -->|Workload cluster requests| H
E -->|Forwarded Metrics| I
C -->|Forwarded Metrics<br>#91;HTTPS&#93| E
B -->|Join Request<br>#91;HTTPS&#93| E
E -->|Join Request| G
E -->|API Requests| G
D -->|Relayed Requests| B
D -->|Relay Client<br>#91;TLS&#93| E
E -->|Relay Client| H
G -->|User & Cluster Data| F
E -->|Web Portal| J
Z -->|API Requests<br>#91;HTTPS&#93| E
Z -->|Web Portal<br>#91;HTTPS&#93| E" %}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.neurox.com/architecture/diagram.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
