# p-sakthi-sabareesh/security_agent architecture

> Architecture diagram of the GitHub repository p-sakthi-sabareesh/security_agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/p-sakthi-sabareesh/security_agent
- Repository: https://github.com/p-sakthi-sabareesh/security_agent

## Overview

HINDY is a SOC memory agent and analyst workspace. Analysts authenticate, triage alerts, request a memory-grounded investigation, review recalled precedents and signal differences, then confirm a disposition that becomes retained experience. The UI also exposes searchable memory, replay timelines, and with/without-memory evaluation. The README documents the agent’s Hindsight recall and Groq reasoning; the sampled agent excerpt shows signal comparison. Some backend routes and storage details are unsampled, so only documented or excerpt-supported links are drawn.

Main entry points: [`api/main.py`](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/api/main.py) (REST API), [`frontend/src/App.tsx`](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/App.tsx) (Workspace Shell), [`agent/soc_agent.py`](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.py) (SOC Agent), [`frontend/src/components/InvestigationView.tsx`](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/InvestigationView.tsx) (Investigation Detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["SOC Workspace"]
  node_login["Login Portal<br/>[LoginModal.tsx]"]
  node_app["Workspace Shell<br/>[App.tsx]"]
  node_dashboard["Alert Dashboard<br/>[DashboardView.tsx]"]
end

subgraph group_investigation["Alert Investigation"]
  node_investigation_page["Investigation Workspace"]
  node_investigation_view["Investigation Detail"]
  node_decision["Analyst Decision"]
  node_before_after["Signal Comparison"]
end

subgraph group_memory["Memory Learning"]
  node_memory_view["Memory Browser<br/>[MemoryView.tsx]"]
  node_memory_store[("Retained Experiences")]
end

subgraph group_insight["Replay &amp; Evaluation"]
  node_replay["Experience Replay<br/>[ReplayView.tsx]"]
  node_evaluation["Benchmark Evaluation<br/>[EvaluationView.tsx]"]
end

subgraph group_runtime["Agent Runtime"]
  node_api["REST API<br/>[main.py]"]
  node_agent["SOC Agent<br/>[soc_agent.py]"]
  node_recall["Experience Recall<br/>[soc_agent.py]"]
  node_diff["Signal Differencing<br/>[soc_agent.py]"]
  node_reasoning["Safety Assessment<br/>[soc_agent.py]"]
  node_hindsight[("Hindsight Memory")]
  node_groq["Groq Reasoning"]
end

node_analyst(("SOC Analyst"))

node_analyst -->|"signs in"| node_login
node_login -->|"enters workspace"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"opens investigation"| node_investigation_page
node_investigation_page -->|"renders detail"| node_investigation_view
node_investigation_view -->|"presents decision"| node_decision
node_investigation_view -->|"renders comparison"| node_before_after
node_app -->|"opens memory"| node_memory_view
node_app -->|"opens replay"| node_replay
node_app -->|"opens evaluation"| node_evaluation
node_analyst -->|"triages alerts"| node_dashboard
node_analyst -->|"confirms disposition"| node_decision
node_app -->|"requests analysis"| node_api
node_api -->|"invokes analysis"| node_agent
node_agent -->|"recalls precedents"| node_recall
node_recall -->|"queries bank"| node_hindsight
node_agent -->|"compares signals"| node_diff
node_agent -->|"assesses alert"| node_reasoning
node_reasoning -->|"reasons with"| node_groq
node_api -->|"reads overrides"| node_memory_store
node_memory_view -.->|"loads memories"| node_api
node_decision -.->|"submits disposition"| node_api
node_api -.->|"retains lesson"| node_hindsight
node_replay -.->|"loads replay data"| node_api
node_evaluation -.->|"loads benchmarks"| node_api

click node_login "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/LoginModal.tsx"
click node_app "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/App.tsx"
click node_dashboard "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/DashboardView.tsx"
click node_investigation_page "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/InvestigationPage.tsx"
click node_investigation_view "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/InvestigationView.tsx"
click node_decision "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/AnalystDecisionForm.tsx"
click node_before_after "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/BeforeAfterPanel.tsx"
click node_memory_view "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/MemoryView.tsx"
click node_replay "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/ReplayView.tsx"
click node_evaluation "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/EvaluationView.tsx"
click node_api "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/api/main.py"
click node_agent "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.py"
click node_recall "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.py"
click node_diff "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.py"
click node_reasoning "https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.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_login,node_app,node_dashboard toneBlue
class node_investigation_page,node_investigation_view,node_decision,node_before_after toneAmber
class node_memory_view,node_memory_store toneMint
class node_replay,node_evaluation toneRose
class node_api,node_agent,node_recall,node_diff,node_reasoning,node_hindsight,node_groq,node_analyst toneIndigo
```

## Components

### SOC Workspace

- [Login Portal](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/LoginModal.tsx): `frontend/src/components/LoginModal.tsx`
- [Workspace Shell](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Alert Dashboard](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/DashboardView.tsx): `frontend/src/components/DashboardView.tsx`

### Alert Investigation

- [Investigation Workspace](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/InvestigationPage.tsx): `frontend/src/components/InvestigationPage.tsx`
- [Investigation Detail](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/InvestigationView.tsx): `frontend/src/components/InvestigationView.tsx`
- [Analyst Decision](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/AnalystDecisionForm.tsx): `frontend/src/components/AnalystDecisionForm.tsx`
- [Signal Comparison](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/BeforeAfterPanel.tsx): `frontend/src/components/BeforeAfterPanel.tsx`

### Memory Learning

- [Memory Browser](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/MemoryView.tsx): `frontend/src/components/MemoryView.tsx`
- **Retained Experiences**

### Replay & Evaluation

- [Experience Replay](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/ReplayView.tsx): `frontend/src/components/ReplayView.tsx`
- [Benchmark Evaluation](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/frontend/src/components/EvaluationView.tsx): `frontend/src/components/EvaluationView.tsx`

### Agent Runtime

- [REST API](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/api/main.py): `api/main.py`
- [SOC Agent](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.py): `agent/soc_agent.py`
- [Experience Recall](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.py): `agent/soc_agent.py`
- [Signal Differencing](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.py): `agent/soc_agent.py`
- [Safety Assessment](https://github.com/p-sakthi-sabareesh/security_agent/blob/main/agent/soc_agent.py): `agent/soc_agent.py`
- **Hindsight Memory**
- **Groq Reasoning**

### Other components

- **SOC Analyst**

## Connections

- SOC Analyst → Login Portal: signs in (evidence: `README.md`)
- Login Portal → Workspace Shell: enters workspace (evidence: `frontend/src/App.tsx`)
- Workspace Shell → Alert Dashboard: renders (evidence: `frontend/src/App.tsx`)
- Workspace Shell → Investigation Workspace: opens investigation (evidence: `frontend/src/App.tsx`)
- Investigation Workspace → Investigation Detail: renders detail (evidence: `frontend/src/components/InvestigationPage.tsx`)
- Investigation Detail → Analyst Decision: presents decision (evidence: `frontend/src/components/InvestigationView.tsx`)
- Investigation Detail → Signal Comparison: renders comparison (evidence: `frontend/src/components/InvestigationView.tsx`)
- Workspace Shell → Memory Browser: opens memory (evidence: `frontend/src/App.tsx`)
- Workspace Shell → Experience Replay: opens replay (evidence: `frontend/src/App.tsx`)
- Workspace Shell → Benchmark Evaluation: opens evaluation (evidence: `frontend/src/App.tsx`)
- SOC Analyst → Alert Dashboard: triages alerts (evidence: `README.md`)
- SOC Analyst → Analyst Decision: confirms disposition (evidence: `README.md`)
- Workspace Shell → REST API: requests analysis (evidence: `frontend/src/App.tsx`)
- REST API → SOC Agent: invokes analysis (evidence: `api/main.py`)
- SOC Agent → Experience Recall: recalls precedents (evidence: `README.md`)
- Experience Recall → Hindsight Memory: queries bank (evidence: `README.md`)
- SOC Agent → Signal Differencing: compares signals (evidence: `agent/soc_agent.py`)
- SOC Agent → Safety Assessment: assesses alert (evidence: `README.md`)
- Safety Assessment → Groq Reasoning: reasons with (evidence: `README.md`)
- REST API → Retained Experiences: reads overrides (evidence: `api/main.py`)
- Memory Browser → REST API: loads memories
- Analyst Decision → REST API: submits disposition
- REST API → Hindsight Memory: retains lesson
- Experience Replay → REST API: loads replay data
- Benchmark Evaluation → REST API: loads benchmarks
