# Architecture at a glance

Edge is a **single container** that runs four cooperating processes behind an Nginx front. It calls one external dependency: your LLM gateway.

```mermaid
flowchart TB
    subgraph Browser
        UI[Edge UI<br/>React + Vite]
    end

    subgraph "Edge container"
        NG[Nginx :8080] --> UI_STATIC[Static UI bundle]
        NG -->|/api/*| BE[FastAPI :8000]
        NG -->|/pb/*| PB[(PocketBase :8090<br/>SQLite)]
        BE -->|JSON-RPC| MCP[OpsKiln MCP :8180]
        BE -->|reads| PB
        MCP -->|reads| PB
    end

    subgraph "Your perimeter"
        LLM[LLM gateway<br/>AI Hub / OpenAI / etc.]
    end

    BE -->|chat/completions| LLM
    BE -.->|optional| LF[Langfuse]

    User[Bank user] -->|HTTPS| NG
```

## Three things to remember

1. **One container, one source of truth.** Nothing exposes user data outside the container except the LLM call you authorise.
2. **PocketBase is the local DB** — SQLite under the hood. No external Postgres required.
3. **The LLM gateway is the boundary** — bring your own; rotate keys without touching Edge.

## Where to go next

* [System overview](/architecture/overview.md) — full diagram with edge-infra, edge-workflows, GHCR.
* [Data flow](/architecture/data-flow.md) — how a flow execution travels through nodes.
* [Security boundaries](/architecture/security.md) — trust zones, secrets, RBAC.
* [Deployment / SaaS](/deployment/saas.md) — how the multi-tenant control plane wraps the same container.


---

# Agent Instructions: 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:

```
GET https://docs.edge.nyami.fr/getting-started/architecture-glance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
