# zeroq/amalthea architecture

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

- Interactive diagram: https://gitdiagram.com/zeroq/amalthea
- Repository: https://github.com/zeroq/amalthea

## Overview

Amalthea is a security case-management and orchestration platform. Its documented primary workflow accepts authenticated webhook alerts, maps and stores them, lets analysts triage and escalate them into cases, and correlates observables across incidents. Domain events can trigger Celery playbooks whose results return to the case timeline. The graph also preserves query/compatibility, identity, realtime, and MCP capabilities. Relationships use README statements or source-index evidence; several subsystems are represented at directory level because their implementation was not sampled.

Main entry points: [`ui/views`](https://github.com/zeroq/amalthea/tree/main/ui/views) (Web interface), [`cases/models.py`](https://github.com/zeroq/amalthea/blob/main/cases/models.py) (Cases and tasks), [`ingest/views.py`](https://github.com/zeroq/amalthea/blob/main/ingest/views.py) (Webhook receiver), [`automation/dispatcher.py`](https://github.com/zeroq/amalthea/blob/main/automation/dispatcher.py) (Event dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Alert ingestion"]
  node_webhook["Webhook receiver<br/>[views.py]"]
  node_feed_config["Feed mapping<br/>[mapping.py]"]
  node_ingest_store["Ingest persistence<br/>[pipeline.py]"]
end

subgraph group_response["Incident response"]
  node_alerts[("Alerts<br/>[models.py]")]
  node_triage["Alert triage<br/>[triage.py]"]
  node_escalation["Case escalation<br/>[escalation.py]"]
  node_cases[("Cases and tasks<br/>[models.py]")]
  node_case_ledger["Case timeline<br/>[ledger.py]"]
  node_observables[("Observables<br/>[models.py]")]
  node_correlation["Case correlation<br/>[correlation.py]"]
end

subgraph group_automation["Automation"]
  node_automation_dispatch["Event dispatcher<br/>[dispatcher.py]"]
  node_playbooks["Playbook execution<br/>[executor.py]"]
  node_celery_tasks["Background tasks<br/>[tasks.py]"]
end

subgraph group_platform["Access and interfaces"]
  node_web_ui["Web interface"]
  node_identity[("Identity and tenancy<br/>[models.py]")]
  node_scoping["Tenant scoping<br/>[scoping.py]"]
  node_query["Search and query<br/>[engine.py]"]
  node_compat["Compatibility API<br/>[views.py]"]
  node_realtime["Realtime updates<br/>[consumers.py]"]
end

subgraph group_assistant["MCP integration"]
  node_mcp_tools["MCP tools"]
  node_mcp_services["MCP services"]
  node_mcp_auth["MCP authentication<br/>[auth.py]"]
end

node_feed(("Alert provider"))
node_analyst(("Analyst"))
node_mcp_client(("MCP client"))

node_feed -->|"sends alert"| node_webhook
node_webhook -->|"maps payload"| node_feed_config
node_webhook -->|"persists alert"| node_ingest_store
node_ingest_store -->|"creates or deduplicates"| node_alerts
node_analyst -->|"triages alerts"| node_web_ui
node_web_ui -->|"manages triage"| node_triage
node_triage -->|"escalates alert"| node_escalation
node_escalation -->|"creates case"| node_cases
node_web_ui -->|"tracks tasks"| node_cases
node_cases -->|"records timeline"| node_case_ledger
node_observables -->|"correlates across cases"| node_correlation
node_analyst -->|"manages feeds"| node_web_ui
node_web_ui -->|"manages access"| node_identity
node_web_ui -->|"checks tenant access"| node_scoping
node_web_ui -.->|"searches records"| node_query
node_web_ui -.->|"uses compatibility API"| node_compat
node_cases -->|"emits domain events"| node_automation_dispatch
node_alerts -->|"emits domain events"| node_automation_dispatch
node_automation_dispatch -->|"queues playbooks"| node_celery_tasks
node_celery_tasks -->|"runs playbook"| node_playbooks
node_playbooks -->|"writes results"| node_case_ledger
node_web_ui -.->|"receives live updates"| node_realtime
node_mcp_client -.->|"authenticates"| node_mcp_auth
node_mcp_client -.->|"invokes tools"| node_mcp_tools
node_mcp_tools -.->|"delegates proposals"| node_mcp_services

click node_webhook "https://github.com/zeroq/amalthea/blob/main/ingest/views.py"
click node_feed_config "https://github.com/zeroq/amalthea/blob/main/ingest/mapping.py"
click node_ingest_store "https://github.com/zeroq/amalthea/blob/main/ingest/pipeline.py"
click node_alerts "https://github.com/zeroq/amalthea/blob/main/alerts/models.py"
click node_triage "https://github.com/zeroq/amalthea/blob/main/alerts/triage.py"
click node_escalation "https://github.com/zeroq/amalthea/blob/main/alerts/escalation.py"
click node_cases "https://github.com/zeroq/amalthea/blob/main/cases/models.py"
click node_case_ledger "https://github.com/zeroq/amalthea/blob/main/cases/ledger.py"
click node_observables "https://github.com/zeroq/amalthea/blob/main/observables/models.py"
click node_correlation "https://github.com/zeroq/amalthea/blob/main/cases/correlation.py"
click node_web_ui "https://github.com/zeroq/amalthea/tree/main/ui/views"
click node_identity "https://github.com/zeroq/amalthea/blob/main/identity/models.py"
click node_scoping "https://github.com/zeroq/amalthea/blob/main/identity/scoping.py"
click node_query "https://github.com/zeroq/amalthea/blob/main/query/engine.py"
click node_compat "https://github.com/zeroq/amalthea/blob/main/compat/views.py"
click node_realtime "https://github.com/zeroq/amalthea/blob/main/realtime/consumers.py"
click node_automation_dispatch "https://github.com/zeroq/amalthea/blob/main/automation/dispatcher.py"
click node_playbooks "https://github.com/zeroq/amalthea/blob/main/automation/executor.py"
click node_celery_tasks "https://github.com/zeroq/amalthea/blob/main/automation/tasks.py"
click node_mcp_tools "https://github.com/zeroq/amalthea/tree/main/mcp_server/tools"
click node_mcp_services "https://github.com/zeroq/amalthea/tree/main/mcp_server/services"
click node_mcp_auth "https://github.com/zeroq/amalthea/blob/main/mcp_server/auth.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_webhook,node_feed_config,node_ingest_store,node_mcp_client toneBlue
class node_alerts,node_triage,node_escalation,node_cases,node_case_ledger,node_observables,node_correlation toneAmber
class node_automation_dispatch,node_playbooks,node_celery_tasks toneMint
class node_web_ui,node_identity,node_scoping,node_query,node_compat,node_realtime toneRose
class node_mcp_tools,node_mcp_services,node_mcp_auth,node_feed,node_analyst toneIndigo
```

## Components

### Alert ingestion

- [Webhook receiver](https://github.com/zeroq/amalthea/blob/main/ingest/views.py): `ingest/views.py`
- [Feed mapping](https://github.com/zeroq/amalthea/blob/main/ingest/mapping.py): `ingest/mapping.py`
- [Ingest persistence](https://github.com/zeroq/amalthea/blob/main/ingest/pipeline.py): `ingest/pipeline.py`

### Incident response

- [Alerts](https://github.com/zeroq/amalthea/blob/main/alerts/models.py): `alerts/models.py`
- [Alert triage](https://github.com/zeroq/amalthea/blob/main/alerts/triage.py): `alerts/triage.py`
- [Case escalation](https://github.com/zeroq/amalthea/blob/main/alerts/escalation.py): `alerts/escalation.py`
- [Cases and tasks](https://github.com/zeroq/amalthea/blob/main/cases/models.py): `cases/models.py`
- [Case timeline](https://github.com/zeroq/amalthea/blob/main/cases/ledger.py): `cases/ledger.py`
- [Observables](https://github.com/zeroq/amalthea/blob/main/observables/models.py): `observables/models.py`
- [Case correlation](https://github.com/zeroq/amalthea/blob/main/cases/correlation.py): `cases/correlation.py`

### Automation

- [Event dispatcher](https://github.com/zeroq/amalthea/blob/main/automation/dispatcher.py): `automation/dispatcher.py`
- [Playbook execution](https://github.com/zeroq/amalthea/blob/main/automation/executor.py): `automation/executor.py`
- [Background tasks](https://github.com/zeroq/amalthea/blob/main/automation/tasks.py): `automation/tasks.py`

### Access and interfaces

- [Web interface](https://github.com/zeroq/amalthea/tree/main/ui/views): `ui/views`
- [Identity and tenancy](https://github.com/zeroq/amalthea/blob/main/identity/models.py): `identity/models.py`
- [Tenant scoping](https://github.com/zeroq/amalthea/blob/main/identity/scoping.py): `identity/scoping.py`
- [Search and query](https://github.com/zeroq/amalthea/blob/main/query/engine.py): `query/engine.py`
- [Compatibility API](https://github.com/zeroq/amalthea/blob/main/compat/views.py): `compat/views.py`
- [Realtime updates](https://github.com/zeroq/amalthea/blob/main/realtime/consumers.py): `realtime/consumers.py`

### MCP integration

- [MCP tools](https://github.com/zeroq/amalthea/tree/main/mcp_server/tools): `mcp_server/tools`
- [MCP services](https://github.com/zeroq/amalthea/tree/main/mcp_server/services): `mcp_server/services`
- [MCP authentication](https://github.com/zeroq/amalthea/blob/main/mcp_server/auth.py): `mcp_server/auth.py`

### Other components

- **Alert provider**
- **Analyst**
- **MCP client**

## Connections

- Alert provider → Webhook receiver: sends alert (evidence: `README.md`)
- Webhook receiver → Feed mapping: maps payload (evidence: `README.md`)
- Webhook receiver → Ingest persistence: persists alert (evidence: `README.md`)
- Ingest persistence → Alerts: creates or deduplicates (evidence: `ingest/pipeline.py`)
- Analyst → Web interface: triages alerts (evidence: `README.md`)
- Web interface → Alert triage: manages triage (evidence: `README.md`)
- Alert triage → Case escalation: escalates alert (evidence: `README.md`)
- Case escalation → Cases and tasks: creates case (evidence: `README.md`)
- Web interface → Cases and tasks: tracks tasks (evidence: `README.md`)
- Cases and tasks → Case timeline: records timeline (evidence: `README.md`)
- Observables → Case correlation: correlates across cases (evidence: `README.md`)
- Analyst → Web interface: manages feeds (evidence: `README.md`)
- Web interface → Identity and tenancy: manages access (evidence: `ui/views/ingestion_tokens.py`)
- Web interface → Tenant scoping: checks tenant access (evidence: `ui/views/ingestion_sources.py`)
- Web interface → Search and query: searches records
- Web interface → Compatibility API: uses compatibility API
- Cases and tasks → Event dispatcher: emits domain events (evidence: `automation/dispatcher.py`)
- Alerts → Event dispatcher: emits domain events (evidence: `automation/dispatcher.py`)
- Event dispatcher → Background tasks: queues playbooks (evidence: `automation/dispatcher.py`)
- Background tasks → Playbook execution: runs playbook (evidence: `automation/tasks.py`)
- Playbook execution → Case timeline: writes results (evidence: `README.md`)
- Web interface → Realtime updates: receives live updates
- MCP client → MCP authentication: authenticates
- MCP client → MCP tools: invokes tools
- MCP tools → MCP services: delegates proposals
