# suraj718549-cmyk/sentinelmind architecture

> Architecture diagram of the GitHub repository suraj718549-cmyk/sentinelmind, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suraj718549-cmyk/sentinelmind
- Repository: https://github.com/suraj718549-cmyk/sentinelmind

## Overview

SentinelMind is a web-based SOC alert triage agent. Analysts submit alerts to the dashboard API, which runs stateless and memory-informed triage; the agent recalls relevant incident history when requested, reasons over each mode, and returns verdicts, confidence, rationales, and recalled memories. Analysts can submit feedback, which passes through source-trust, injection, and consistency checks before approved memories are retained. The README documents cross-host correlation and an offline fallback. Source excerpts are partial, so uncertain implementation links are omitted.

Main entry points: [`src/agent.py`](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/agent.py) (Sentinel Agent), [`scripts/web_server.py`](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/scripts/web_server.py) (Dashboard API), [`src/llm_reasoner.py`](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/llm_reasoner.py) (Reasoner Selection), [`src/hindsight_wrapper.py`](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/hindsight_wrapper.py) (Memory Backend Adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Dashboard and API"]
  node_dashboard["Triage Dashboard"]
  node_api["Dashboard API<br/>[web_server.py]"]
  node_audit["Defense Audit Log<br/>[web_server.py]"]
end

subgraph group_triage["Triage and Reasoning"]
  node_agent["Sentinel Agent<br/>[agent.py]"]
  node_stateless["Stateless Track<br/>[agent.py]"]
  node_memorytrack["Memory Track<br/>[agent.py]"]
  node_reasoner["Reasoner Selection<br/>[llm_reasoner.py]"]
end

subgraph group_memory["Memory and Defense"]
  node_defense["Memory Defense<br/>[memory_defense.py]"]
  node_wrapper["Memory Backend Adapter"]
end

subgraph group_integrations["Inference and Storage"]
  node_hindsight[("Hindsight Memory")]
  node_fallback[("Local Fallback Store")]
  node_llm{{"LLM Provider"}}
end

node_analyst(("SOC Analyst"))

node_analyst -->|"submits alerts"| node_dashboard
node_dashboard -->|"sends requests"| node_api
node_api -->|"runs triage"| node_agent
node_agent -->|"evaluates alert"| node_stateless
node_agent -->|"runs memory mode"| node_memorytrack
node_stateless -->|"reasons without history"| node_reasoner
node_memorytrack -->|"recalls history"| node_wrapper
node_memorytrack -->|"reasons with context"| node_reasoner
node_reasoner -.->|"requests inference"| node_llm
node_reasoner -->|"returns verdict"| node_stateless
node_reasoner -->|"returns verdict"| node_memorytrack
node_agent -->|"returns triage results"| node_api
node_api -->|"returns comparisons"| node_dashboard
node_analyst -->|"provides feedback"| node_dashboard
node_api -->|"records feedback"| node_agent
node_agent -->|"checks candidate memory"| node_defense
node_agent -->|"retains approved memory"| node_wrapper
node_wrapper -.->|"recalls and retains"| node_hindsight
node_wrapper -->|"reads and writes"| node_fallback
node_api -->|"records defense outcome"| node_audit

click node_dashboard "https://github.com/suraj718549-cmyk/sentinelmind/tree/main/frontend"
click node_api "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/scripts/web_server.py"
click node_agent "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/agent.py"
click node_stateless "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/agent.py"
click node_memorytrack "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/agent.py"
click node_reasoner "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/llm_reasoner.py"
click node_defense "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/memory_defense.py"
click node_wrapper "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/hindsight_wrapper.py"
click node_audit "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/scripts/web_server.py"
click node_fallback "https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/hindsight_wrapper.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_dashboard,node_api,node_audit toneBlue
class node_agent,node_stateless,node_memorytrack,node_reasoner toneAmber
class node_defense,node_wrapper toneMint
class node_hindsight,node_fallback,node_llm toneRose
class node_analyst toneIndigo
```

## Components

### Dashboard and API

- [Triage Dashboard](https://github.com/suraj718549-cmyk/sentinelmind/tree/main/frontend): `frontend`
- [Dashboard API](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/scripts/web_server.py): `scripts/web_server.py`
- [Defense Audit Log](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/scripts/web_server.py): `scripts/web_server.py`

### Triage and Reasoning

- [Sentinel Agent](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/agent.py): `src/agent.py`
- [Stateless Track](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/agent.py): `src/agent.py`
- [Memory Track](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/agent.py): `src/agent.py`
- [Reasoner Selection](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/llm_reasoner.py): `src/llm_reasoner.py`

### Memory and Defense

- [Memory Defense](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/memory_defense.py): `src/memory_defense.py`
- [Memory Backend Adapter](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/hindsight_wrapper.py): `src/hindsight_wrapper.py`

### Inference and Storage

- **Hindsight Memory**
- [Local Fallback Store](https://github.com/suraj718549-cmyk/sentinelmind/blob/main/src/hindsight_wrapper.py): `src/hindsight_wrapper.py`
- **LLM Provider**

### Other components

- **SOC Analyst**

## Connections

- SOC Analyst → Triage Dashboard: submits alerts
- Triage Dashboard → Dashboard API: sends requests
- Dashboard API → Sentinel Agent: runs triage
- Sentinel Agent → Stateless Track: evaluates alert
- Sentinel Agent → Memory Track: runs memory mode
- Stateless Track → Reasoner Selection: reasons without history
- Memory Track → Memory Backend Adapter: recalls history
- Memory Track → Reasoner Selection: reasons with context
- Reasoner Selection → LLM Provider: requests inference
- Reasoner Selection → Stateless Track: returns verdict
- Reasoner Selection → Memory Track: returns verdict
- Sentinel Agent → Dashboard API: returns triage results
- Dashboard API → Triage Dashboard: returns comparisons
- SOC Analyst → Triage Dashboard: provides feedback
- Dashboard API → Sentinel Agent: records feedback
- Sentinel Agent → Memory Defense: checks candidate memory
- Sentinel Agent → Memory Backend Adapter: retains approved memory
- Memory Backend Adapter → Hindsight Memory: recalls and retains
- Memory Backend Adapter → Local Fallback Store: reads and writes
- Dashboard API → Defense Audit Log: records defense outcome
