# kumarshivesh465-hue/sentinel-amex-codestreet architecture

> Architecture diagram of the GitHub repository kumarshivesh465-hue/sentinel-amex-codestreet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kumarshivesh465-hue/sentinel-amex-codestreet
- Repository: https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet

## Overview

Sentinel is a browser-based cardmember servicing platform backed by a dependency-free Python HTTP server. A cardmember submits a request through the web app; the server coordinates intent and risk assessment, policy-compliant resolution, decision explanation, and persistence. Low-confidence cases can be escalated to a human. Supervisors use the same application for session monitoring, audit review, and timeline replay. The source excerpts show the server’s orchestration role and key agent calls; several dashboard and API relationships are documented in the README rather than shown in the sampled implementation.

Main entry points: [`backend/server.py`](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/server.py) (HTTP Server), [`frontend/index.html`](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/frontend/index.html) (Web App), [`backend/agents.py`](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/agents.py) (Agent Layer), [`backend/intent.py`](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/intent.py) (Intent Refinement)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer Experience"]
  node_web_app["Web App<br/>[index.html]"]
end

subgraph group_service["Servicing Workflow"]
  node_http_server["HTTP Server<br/>[server.py]"]
  node_request_handling["Request Handling<br/>[server.py]"]
end

subgraph group_intelligence["Decision Intelligence"]
  node_agent_layer["Agent Layer<br/>[agents.py]"]
  node_intent_refinement["Intent Refinement<br/>[intent.py]"]
  node_money_helpers["Money Helpers<br/>[money.py]"]
end

subgraph group_trust["Identity and Trust"]
  node_authentication["Authentication<br/>[auth.py]"]
  node_security_controls["Security Controls<br/>[security.py]"]
  node_configuration["Configuration<br/>[config.py]"]
  node_structured_logging["Structured Logging<br/>[logging_setup.py]"]
end

subgraph group_data["Servicing Data"]
  node_servicing_store[("Servicing Store<br/>[db.py]")]
end

node_cardmember(("Cardmember"))
node_supervisor(("Supervisor"))
node_human_agent(("Human Agent"))
node_gemini["Gemini API"]

node_cardmember -->|"submits request"| node_web_app
node_supervisor -->|"monitors cases"| node_web_app
node_web_app -->|"uses APIs"| node_http_server
node_http_server -->|"routes requests"| node_request_handling
node_http_server -->|"coordinates agents"| node_agent_layer
node_http_server -->|"requests refinement"| node_intent_refinement
node_intent_refinement -->|"classifies optionally"| node_gemini
node_http_server -->|"handles auth"| node_authentication
node_http_server -->|"applies controls"| node_security_controls
node_http_server -->|"reads settings"| node_configuration
node_http_server -->|"records events"| node_structured_logging
node_http_server -->|"persists cases"| node_servicing_store
node_agent_layer -->|"converts amounts"| node_money_helpers
node_http_server -->|"escalates cases"| node_human_agent
node_web_app -->|"requests timeline"| node_http_server

click node_web_app "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/frontend/index.html"
click node_http_server "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/server.py"
click node_request_handling "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/server.py"
click node_agent_layer "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/agents.py"
click node_intent_refinement "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/intent.py"
click node_money_helpers "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/money.py"
click node_authentication "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/auth.py"
click node_security_controls "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/security.py"
click node_configuration "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/config.py"
click node_structured_logging "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/logging_setup.py"
click node_servicing_store "https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/db.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_app toneBlue
class node_http_server,node_request_handling toneAmber
class node_agent_layer,node_intent_refinement,node_money_helpers,node_gemini toneMint
class node_authentication,node_security_controls,node_configuration,node_structured_logging toneRose
class node_servicing_store,node_cardmember,node_supervisor,node_human_agent toneIndigo
```

## Components

### Customer Experience

- [Web App](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/frontend/index.html): `frontend/index.html`

### Servicing Workflow

- [HTTP Server](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/server.py): `backend/server.py`
- [Request Handling](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/server.py): `backend/server.py`

### Decision Intelligence

- [Agent Layer](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/agents.py): `backend/agents.py`
- [Intent Refinement](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/intent.py): `backend/intent.py`
- [Money Helpers](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/money.py): `backend/money.py`

### Identity and Trust

- [Authentication](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/auth.py): `backend/auth.py`
- [Security Controls](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/security.py): `backend/security.py`
- [Configuration](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/config.py): `backend/config.py`
- [Structured Logging](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/logging_setup.py): `backend/logging_setup.py`

### Servicing Data

- [Servicing Store](https://github.com/kumarshivesh465-hue/sentinel-amex-codestreet/blob/main/backend/db.py): `backend/db.py`

### Other components

- **Cardmember**
- **Supervisor**
- **Human Agent**
- **Gemini API**

## Connections

- Cardmember → Web App: submits request (evidence: `README.md`)
- Supervisor → Web App: monitors cases (evidence: `README.md`)
- Web App → HTTP Server: uses APIs (evidence: `README.md`)
- HTTP Server → Request Handling: routes requests (evidence: `backend/server.py`)
- HTTP Server → Agent Layer: coordinates agents (evidence: `README.md`)
- HTTP Server → Intent Refinement: requests refinement (evidence: `backend/server.py`)
- Intent Refinement → Gemini API: classifies optionally (evidence: `backend/intent.py`)
- HTTP Server → Authentication: handles auth (evidence: `backend/server.py`)
- HTTP Server → Security Controls: applies controls (evidence: `backend/server.py`)
- HTTP Server → Configuration: reads settings (evidence: `backend/server.py`)
- HTTP Server → Structured Logging: records events (evidence: `backend/server.py`)
- HTTP Server → Servicing Store: persists cases (evidence: `backend/server.py`)
- Agent Layer → Money Helpers: converts amounts (evidence: `backend/agents.py`)
- HTTP Server → Human Agent: escalates cases (evidence: `README.md`)
- Web App → HTTP Server: requests timeline (evidence: `README.md`)
