# chicken-nuggets-unoffical/the-investigator architecture

> Architecture diagram of the GitHub repository chicken-nuggets-unoffical/the-investigator, 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/chicken-nuggets-unoffical/the-investigator
- Repository: https://github.com/chicken-nuggets-unoffical/the-investigator

## Overview

The Investigator is a security-operations copilot with a browser-based workflow and a separate local, automated reporting pipeline. In the app, an analyst can submit logs for correlation, ask questions, browse saved cases, or start an autonomous investigation; the autonomous loop selects evidence and MITRE lookup tools before producing a verdict. Separately, the local triage script combines evidence with the response runbook and saves a report. Standalone scripts provide focused log analysis. The excerpts show these paths, but not the internals of every UI section or deployment configuration.

Main entry points: [`evidence`](https://github.com/chicken-nuggets-unoffical/the-investigator/tree/main/evidence) (Evidence logs), [`app.py`](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py) (Streamlit interface), [`triage.py`](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py) (Triage runner), [`agent.py`](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/agent.py) (CLI agent loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Copilot"]
  node_streamlit["Streamlit interface<br/>[app.py]"]
  node_correlation["Log correlation<br/>[app.py]"]
  node_chat["Analyst chat<br/>[app.py]"]
  node_case_browser["Case browser<br/>[app.py]"]
end

subgraph group_autonomous["Autonomous Investigation"]
  node_web_agent["Browser agent loop<br/>[app.py]"]
  node_agent["CLI agent loop<br/>[agent.py]"]
  node_evidence_tools["Evidence tools<br/>[agent.py]"]
  node_mitre_lookup["MITRE lookup<br/>[agent.py]"]
end

subgraph group_pipeline["Local Triage Pipeline"]
  node_triage_runner["Triage runner<br/>[triage.py]"]
  node_evidence_loader["Evidence loader<br/>[triage.py]"]
  node_runbook_loader["Runbook loader<br/>[triage.py]"]
  node_report_writer["Report writer<br/>[triage.py]"]
end

subgraph group_analysis["Focused Log Analysis"]
  node_timeline["Event timeline<br/>[timeline.py]"]
  node_network_hunt["Beaconing analysis<br/>[hunt.py]"]
  node_login_audit["Failed-login audit<br/>[audit.py]"]
end

subgraph group_state["Case Data"]
  node_evidence[("Evidence logs")]
  node_reports[("Saved reports")]
  node_runbook["IR runbook<br/>[ir_runbook.md]"]
end

node_analyst(("Security analyst"))
node_groq(("Groq model"))
node_ollama(("Ollama model"))

node_analyst -->|"uses"| node_streamlit
node_streamlit -->|"offers"| node_correlation
node_streamlit -->|"offers"| node_chat
node_streamlit -->|"offers"| node_case_browser
node_streamlit -->|"offers"| node_web_agent
node_correlation -->|"sends logs"| node_groq
node_chat -->|"sends prompts"| node_groq
node_web_agent -->|"requests actions"| node_groq
node_web_agent -->|"dispatches tools"| node_evidence_tools
node_evidence_tools -->|"reads logs"| node_evidence
node_web_agent -->|"dispatches lookup"| node_mitre_lookup
node_case_browser -->|"reads cases"| node_reports
node_correlation -->|"downloads report"| node_reports
node_analyst -->|"runs investigation"| node_agent
node_agent -->|"requests actions"| node_groq
node_agent -->|"dispatches tools"| node_evidence_tools
node_evidence_tools -->|"reads logs"| node_evidence
node_agent -->|"dispatches lookup"| node_mitre_lookup
node_triage_runner -->|"loads evidence"| node_evidence_loader
node_evidence_loader -->|"reads logs"| node_evidence
node_triage_runner -->|"loads runbook"| node_runbook_loader
node_runbook_loader -->|"reads"| node_runbook
node_triage_runner -->|"requests report"| node_ollama
node_triage_runner -->|"saves report"| node_report_writer
node_report_writer -->|"writes report"| node_reports
node_timeline -.->|"reads event logs"| node_evidence
node_network_hunt -.->|"reads traffic log"| node_evidence
node_login_audit -.->|"reads access log"| node_evidence

click node_streamlit "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py"
click node_correlation "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py"
click node_chat "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py"
click node_case_browser "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py"
click node_web_agent "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py"
click node_agent "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/agent.py"
click node_evidence_tools "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/agent.py"
click node_mitre_lookup "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/agent.py"
click node_evidence "https://github.com/chicken-nuggets-unoffical/the-investigator/tree/main/evidence"
click node_reports "https://github.com/chicken-nuggets-unoffical/the-investigator/tree/main/reports"
click node_triage_runner "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py"
click node_evidence_loader "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py"
click node_runbook_loader "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py"
click node_report_writer "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py"
click node_runbook "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/ir_runbook.md"
click node_timeline "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/timeline.py"
click node_network_hunt "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/hunt.py"
click node_login_audit "https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/audit.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_streamlit,node_correlation,node_chat,node_case_browser toneBlue
class node_web_agent,node_agent,node_evidence_tools,node_mitre_lookup toneAmber
class node_triage_runner,node_evidence_loader,node_runbook_loader,node_report_writer toneMint
class node_timeline,node_network_hunt,node_login_audit toneRose
class node_evidence,node_reports,node_runbook,node_analyst,node_groq,node_ollama toneIndigo
```

## Components

### Web Copilot

- [Streamlit interface](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py): `app.py`
- [Log correlation](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py): `app.py`
- [Analyst chat](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py): `app.py`
- [Case browser](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py): `app.py`

### Autonomous Investigation

- [Browser agent loop](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/app.py): `app.py`
- [CLI agent loop](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/agent.py): `agent.py`
- [Evidence tools](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/agent.py): `agent.py`
- [MITRE lookup](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/agent.py): `agent.py`

### Local Triage Pipeline

- [Triage runner](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py): `triage.py`
- [Evidence loader](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py): `triage.py`
- [Runbook loader](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py): `triage.py`
- [Report writer](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/triage.py): `triage.py`

### Focused Log Analysis

- [Event timeline](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/timeline.py): `timeline.py`
- [Beaconing analysis](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/hunt.py): `hunt.py`
- [Failed-login audit](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/audit.py): `audit.py`

### Case Data

- [Evidence logs](https://github.com/chicken-nuggets-unoffical/the-investigator/tree/main/evidence): `evidence`
- [Saved reports](https://github.com/chicken-nuggets-unoffical/the-investigator/tree/main/reports): `reports`
- [IR runbook](https://github.com/chicken-nuggets-unoffical/the-investigator/blob/main/ir_runbook.md): `ir_runbook.md`

### Other components

- **Security analyst**
- **Groq model**
- **Ollama model**

## Connections

- Security analyst → Streamlit interface: uses (evidence: `README.md`)
- Streamlit interface → Log correlation: offers (evidence: `app.py`)
- Streamlit interface → Analyst chat: offers (evidence: `app.py`)
- Streamlit interface → Case browser: offers (evidence: `app.py`)
- Streamlit interface → Browser agent loop: offers (evidence: `app.py`)
- Log correlation → Groq model: sends logs (evidence: `app.py`)
- Analyst chat → Groq model: sends prompts (evidence: `app.py`)
- Browser agent loop → Groq model: requests actions (evidence: `app.py`)
- Browser agent loop → Evidence tools: dispatches tools (evidence: `app.py`)
- Evidence tools → Evidence logs: reads logs
- Browser agent loop → MITRE lookup: dispatches lookup (evidence: `app.py`)
- Case browser → Saved reports: reads cases (evidence: `app.py`)
- Log correlation → Saved reports: downloads report (evidence: `app.py`)
- Security analyst → CLI agent loop: runs investigation (evidence: `README.md`)
- CLI agent loop → Groq model: requests actions (evidence: `agent.py`)
- CLI agent loop → Evidence tools: dispatches tools (evidence: `agent.py`)
- Evidence tools → Evidence logs: reads logs (evidence: `agent.py`)
- CLI agent loop → MITRE lookup: dispatches lookup (evidence: `agent.py`)
- Triage runner → Evidence loader: loads evidence (evidence: `triage.py`)
- Evidence loader → Evidence logs: reads logs (evidence: `triage.py`)
- Triage runner → Runbook loader: loads runbook (evidence: `triage.py`)
- Runbook loader → IR runbook: reads (evidence: `triage.py`)
- Triage runner → Ollama model: requests report (evidence: `triage.py`)
- Triage runner → Report writer: saves report (evidence: `triage.py`)
- Report writer → Saved reports: writes report (evidence: `triage.py`)
- Event timeline → Evidence logs: reads event logs
- Beaconing analysis → Evidence logs: reads traffic log
- Failed-login audit → Evidence logs: reads access log
