# wadella/revelation architecture

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

- Interactive diagram: https://gitdiagram.com/wadella/revelation
- Repository: https://github.com/wadella/revelation

## Overview

Revelation turns an uploaded or selected PCAP into protocol, packet, flow, anomaly, and threat-intelligence artifacts, indexes them for evidence retrieval, then answers analyst questions through a local agent. The README also describes dense/hybrid evaluation as a separate capability. Workflow calls are visible for the sampled processing steps; links for unsampled pipeline details rely on README documentation, and optional external lookups are marked dashed.

Main entry points: [`WORKFLOW.py`](https://github.com/wadella/revelation/blob/main/WORKFLOW.py) (Workflow orchestration), [`get_embedding_function.py`](https://github.com/wadella/revelation/blob/main/get_embedding_function.py) (Local embeddings), [`Rag_ingest_updated_final.py`](https://github.com/wadella/revelation/blob/main/Rag_ingest_updated_final.py) (Artifact ingestion), [`query_iot_rag_custom_improve.py`](https://github.com/wadella/revelation/blob/main/query_iot_rag_custom_improve.py) (Hybrid retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_streamlit["Streamlit interface<br/>[app_final.py]"]
  node_orchestrator["Workflow orchestration<br/>[WORKFLOW.py]"]
end

subgraph group_processing["Traffic processing"]
  node_zeek["Protocol reconstruction<br/>[zeek_json_tool.py]"]
  node_packet["Packet-layer extraction"]
  node_flows["Flow summaries"]
  node_features["Feature extraction"]
  node_anomaly["BERT interpretation"]
  node_enrichment["Threat enrichment"]
end

subgraph group_knowledge["Index and retrieval"]
  node_ingestion["Artifact ingestion"]
  node_embeddings["Local embeddings"]
  node_vector_db[("Chroma sessions")]
  node_retrieval["Hybrid retrieval"]
  node_agent["Question-answer agent<br/>[WORKFLOW.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_dense_eval["Dense evaluation"]
  node_hybrid_eval["Hybrid evaluation"]
  node_legacy_eval["Baseline evaluation"]
end

node_analyst(("Analyst"))
node_pcap["PCAP capture"]
node_threat_services["Threat intelligence APIs"]
node_web_lookup["IoT web lookup"]

node_analyst -->|"uploads and asks"| node_streamlit
node_streamlit -->|"builds pipeline"| node_orchestrator
node_pcap -->|"processes capture"| node_orchestrator
node_orchestrator -->|"runs"| node_zeek
node_orchestrator -->|"runs"| node_packet
node_orchestrator -->|"runs"| node_flows
node_orchestrator -->|"extracts"| node_features
node_orchestrator -->|"runs"| node_anomaly
node_orchestrator -->|"runs"| node_enrichment
node_enrichment -->|"queries"| node_threat_services
node_orchestrator -->|"ingests artifacts"| node_ingestion
node_ingestion -->|"writes chunks"| node_vector_db
node_ingestion -->|"embeds chunks"| node_embeddings
node_analyst -->|"asks questions"| node_agent
node_agent -->|"calls retrieval"| node_retrieval
node_retrieval -->|"searches evidence"| node_vector_db
node_retrieval -->|"uses embeddings"| node_embeddings
node_agent -.->|"looks up context"| node_web_lookup
node_dense_eval -->|"uses embeddings"| node_embeddings
node_hybrid_eval -->|"uses embeddings"| node_embeddings
node_legacy_eval -->|"uses embeddings"| node_embeddings

click node_streamlit "https://github.com/wadella/revelation/blob/main/app_final.py"
click node_orchestrator "https://github.com/wadella/revelation/blob/main/WORKFLOW.py"
click node_pcap "https://github.com/wadella/revelation/tree/main/data"
click node_zeek "https://github.com/wadella/revelation/blob/main/zeek_json_tool.py"
click node_packet "https://github.com/wadella/revelation/blob/main/extract_packet_layer_json.py"
click node_flows "https://github.com/wadella/revelation/blob/main/flow_summaries_updated_final.py"
click node_features "https://github.com/wadella/revelation/blob/main/extract_pcap_features_tool.py"
click node_anomaly "https://github.com/wadella/revelation/blob/main/anomaly_detection.py"
click node_enrichment "https://github.com/wadella/revelation/blob/main/enrich_iot_report.py"
click node_ingestion "https://github.com/wadella/revelation/blob/main/Rag_ingest_updated_final.py"
click node_embeddings "https://github.com/wadella/revelation/blob/main/get_embedding_function.py"
click node_vector_db "https://github.com/wadella/revelation/tree/main/chroma_sessions"
click node_retrieval "https://github.com/wadella/revelation/blob/main/query_iot_rag_custom_improve.py"
click node_agent "https://github.com/wadella/revelation/blob/main/WORKFLOW.py"
click node_dense_eval "https://github.com/wadella/revelation/blob/main/Evaluation/Dense_only_evaluation.py"
click node_hybrid_eval "https://github.com/wadella/revelation/blob/main/Evaluation/Hybrid_evaluation.py"
click node_legacy_eval "https://github.com/wadella/revelation/blob/main/Frontier_PCAP_Baseline_Eval_Package/legacy/Hybrid_full_eval_original.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_orchestrator toneBlue
class node_zeek,node_packet,node_flows,node_features,node_anomaly,node_enrichment toneAmber
class node_ingestion,node_embeddings,node_vector_db,node_retrieval,node_agent,node_threat_services toneMint
class node_dense_eval,node_hybrid_eval,node_legacy_eval toneRose
class node_analyst,node_web_lookup toneIndigo
class node_pcap toneTeal
```

## Components

### User interfaces

- [Streamlit interface](https://github.com/wadella/revelation/blob/main/app_final.py): `app_final.py`
- [Workflow orchestration](https://github.com/wadella/revelation/blob/main/WORKFLOW.py): `WORKFLOW.py`

### Traffic processing

- [Protocol reconstruction](https://github.com/wadella/revelation/blob/main/zeek_json_tool.py): `zeek_json_tool.py`
- [Packet-layer extraction](https://github.com/wadella/revelation/blob/main/extract_packet_layer_json.py): `extract_packet_layer_json.py`
- [Flow summaries](https://github.com/wadella/revelation/blob/main/flow_summaries_updated_final.py): `flow_summaries_updated_final.py`
- [Feature extraction](https://github.com/wadella/revelation/blob/main/extract_pcap_features_tool.py): `extract_pcap_features_tool.py`
- [BERT interpretation](https://github.com/wadella/revelation/blob/main/anomaly_detection.py): `anomaly_detection.py`
- [Threat enrichment](https://github.com/wadella/revelation/blob/main/enrich_iot_report.py): `enrich_iot_report.py`

### Index and retrieval

- [Artifact ingestion](https://github.com/wadella/revelation/blob/main/Rag_ingest_updated_final.py): `Rag_ingest_updated_final.py`
- [Local embeddings](https://github.com/wadella/revelation/blob/main/get_embedding_function.py): `get_embedding_function.py`
- [Chroma sessions](https://github.com/wadella/revelation/tree/main/chroma_sessions): `chroma_sessions`
- [Hybrid retrieval](https://github.com/wadella/revelation/blob/main/query_iot_rag_custom_improve.py): `query_iot_rag_custom_improve.py`
- [Question-answer agent](https://github.com/wadella/revelation/blob/main/WORKFLOW.py): `WORKFLOW.py`

### Evaluation

- [Dense evaluation](https://github.com/wadella/revelation/blob/main/Evaluation/Dense_only_evaluation.py): `Evaluation/Dense_only_evaluation.py`
- [Hybrid evaluation](https://github.com/wadella/revelation/blob/main/Evaluation/Hybrid_evaluation.py): `Evaluation/Hybrid_evaluation.py`
- [Baseline evaluation](https://github.com/wadella/revelation/blob/main/Frontier_PCAP_Baseline_Eval_Package/legacy/Hybrid_full_eval_original.py): `Frontier_PCAP_Baseline_Eval_Package/legacy/Hybrid_full_eval_original.py`

### Other components

- **Analyst**
- [PCAP capture](https://github.com/wadella/revelation/tree/main/data): `data`
- **Threat intelligence APIs**
- **IoT web lookup**

## Connections

- Analyst → Streamlit interface: uploads and asks (evidence: `README.md`)
- Streamlit interface → Workflow orchestration: builds pipeline (evidence: `README.md`)
- PCAP capture → Workflow orchestration: processes capture (evidence: `README.md`)
- Workflow orchestration → Protocol reconstruction: runs (evidence: `WORKFLOW.py`)
- Workflow orchestration → Packet-layer extraction: runs (evidence: `WORKFLOW.py`)
- Workflow orchestration → Flow summaries: runs (evidence: `WORKFLOW.py`)
- Workflow orchestration → Feature extraction: extracts (evidence: `WORKFLOW.py`)
- Workflow orchestration → BERT interpretation: runs (evidence: `WORKFLOW.py`)
- Workflow orchestration → Threat enrichment: runs (evidence: `WORKFLOW.py`)
- Threat enrichment → Threat intelligence APIs: queries (evidence: `enrich_iot_report.py`)
- Workflow orchestration → Artifact ingestion: ingests artifacts (evidence: `README.md`)
- Artifact ingestion → Chroma sessions: writes chunks (evidence: `Rag_ingest_updated_final.py`)
- Artifact ingestion → Local embeddings: embeds chunks (evidence: `Rag_ingest_updated_final.py`)
- Analyst → Question-answer agent: asks questions (evidence: `README.md`)
- Question-answer agent → Hybrid retrieval: calls retrieval (evidence: `README.md`)
- Hybrid retrieval → Chroma sessions: searches evidence (evidence: `query_iot_rag_custom_improve.py`)
- Hybrid retrieval → Local embeddings: uses embeddings (evidence: `query_iot_rag_custom_improve.py`)
- Question-answer agent → IoT web lookup: looks up context (evidence: `README.md`)
- Dense evaluation → Local embeddings: uses embeddings (evidence: `Evaluation/Dense_only_evaluation.py`)
- Hybrid evaluation → Local embeddings: uses embeddings (evidence: `Evaluation/Hybrid_evaluation.py`)
- Baseline evaluation → Local embeddings: uses embeddings (evidence: `Frontier_PCAP_Baseline_Eval_Package/legacy/Hybrid_full_eval_original.py`)
