# or1un/mosaic architecture

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

- Interactive diagram: https://gitdiagram.com/or1un/mosaic
- Repository: https://github.com/or1un/mosaic

## Overview

MOSAIC structures public signals from multiple platforms, saves local JSON results, and optionally analyzes a selected result with a contextual prompt and local LLM. Analysts interpret the resulting signals rather than receiving diagnoses. Platform collection is implemented in one large module; the README documents its source coverage, while the excerpts do not expose every platform-specific call or collection-to-file write. The map preserves those documented capabilities and marks those relationships accordingly.

Main entry points: [`modules/Collecte.py`](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py) (Collection Interface), [`modules/Analysis.py`](https://github.com/or1un/mosaic/blob/main/modules/Analysis.py) (Analysis Workflow), [`modules/prompts`](https://github.com/or1un/mosaic/tree/main/modules/prompts) (Context Prompts), [`results`](https://github.com/or1un/mosaic/tree/main/results) (Local JSON Results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Workflow"]
  node_orchestrator["Workflow Orchestrator<br/>[MOSAIC.py]"]
  node_collector["Collection Interface<br/>[Collecte.py]"]
  node_results[("Local JSON Results")]
end

subgraph group_technical["Technical Signals"]
  node_github["GitHub<br/>[Collecte.py]"]
  node_stackoverflow["Stack Overflow<br/>[Collecte.py]"]
end

subgraph group_social["Social Signals"]
  node_telegram["Telegram<br/>[Collecte.py]"]
  node_reddit["Reddit<br/>[Collecte.py]"]
  node_mastodon["Mastodon<br/>[Collecte.py]"]
  node_bluesky["Bluesky<br/>[Collecte.py]"]
end

subgraph group_influence["Influence Signals"]
  node_youtube["YouTube<br/>[Collecte.py]"]
  node_medium["Medium<br/>[Collecte.py]"]
end

subgraph group_analysis["Analysis"]
  node_analyzer["Analysis Workflow<br/>[Analysis.py]"]
  node_prompt_templates["Context Prompts"]
  node_recruitment["Recruitment Prompt<br/>[Recruitment.md]"]
  node_opsec["OPSEC Audit Prompt<br/>[OPSEC_audit.md]"]
  node_threat["Threat Intelligence Prompt"]
  node_poc["PoC Prompt<br/>[PoC.md]"]
  node_backend["LLM Backend<br/>[llm_backend.py]"]
  node_ollama["Ollama"]
  node_insights["Human Interpretation"]
end

node_analyst(("Researcher / Analyst"))

node_analyst -->|"starts workflow"| node_orchestrator
node_orchestrator -->|"launches extraction"| node_collector
node_collector -->|"collects signals"| node_github
node_collector -->|"collects signals"| node_stackoverflow
node_collector -->|"collects signals"| node_telegram
node_collector -->|"collects signals"| node_reddit
node_collector -->|"collects signals"| node_mastodon
node_collector -->|"collects signals"| node_bluesky
node_collector -->|"collects signals"| node_youtube
node_collector -->|"collects signals"| node_medium
node_collector -->|"stores locally"| node_results
node_orchestrator -->|"optionally launches"| node_analyzer
node_analyst -->|"selects context"| node_analyzer
node_analyzer -->|"reads JSON"| node_results
node_analyzer -->|"lists and reads"| node_prompt_templates
node_prompt_templates -->|"includes"| node_recruitment
node_prompt_templates -->|"includes"| node_opsec
node_prompt_templates -->|"includes"| node_threat
node_prompt_templates -->|"includes"| node_poc
node_analyzer -->|"invokes analysis"| node_backend
node_backend -->|"sends prompt"| node_ollama
node_analyzer -->|"saves report"| node_results
node_results -->|"informs interpretation"| node_insights

click node_orchestrator "https://github.com/or1un/mosaic/blob/main/MOSAIC.py"
click node_collector "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_github "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_stackoverflow "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_telegram "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_reddit "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_mastodon "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_bluesky "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_youtube "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_medium "https://github.com/or1un/mosaic/blob/main/modules/Collecte.py"
click node_results "https://github.com/or1un/mosaic/tree/main/results"
click node_analyzer "https://github.com/or1un/mosaic/blob/main/modules/Analysis.py"
click node_prompt_templates "https://github.com/or1un/mosaic/tree/main/modules/prompts"
click node_recruitment "https://github.com/or1un/mosaic/blob/main/modules/prompts/Recruitment.md"
click node_opsec "https://github.com/or1un/mosaic/blob/main/modules/prompts/OPSEC_audit.md"
click node_threat "https://github.com/or1un/mosaic/blob/main/modules/prompts/Threat_Intelligence.md"
click node_poc "https://github.com/or1un/mosaic/blob/main/modules/prompts/PoC.md"
click node_backend "https://github.com/or1un/mosaic/blob/main/modules/llm_backend.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_orchestrator,node_collector,node_results toneBlue
class node_github,node_stackoverflow toneAmber
class node_telegram,node_reddit,node_mastodon,node_bluesky toneMint
class node_youtube,node_medium toneRose
class node_analyzer,node_prompt_templates,node_recruitment,node_opsec,node_threat,node_poc,node_backend,node_ollama,node_insights,node_analyst toneIndigo
```

## Components

### Workflow

- [Workflow Orchestrator](https://github.com/or1un/mosaic/blob/main/MOSAIC.py): `MOSAIC.py`
- [Collection Interface](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`
- [Local JSON Results](https://github.com/or1un/mosaic/tree/main/results): `results`

### Technical Signals

- [GitHub](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`
- [Stack Overflow](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`

### Social Signals

- [Telegram](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`
- [Reddit](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`
- [Mastodon](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`
- [Bluesky](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`

### Influence Signals

- [YouTube](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`
- [Medium](https://github.com/or1un/mosaic/blob/main/modules/Collecte.py): `modules/Collecte.py`

### Analysis

- [Analysis Workflow](https://github.com/or1un/mosaic/blob/main/modules/Analysis.py): `modules/Analysis.py`
- [Context Prompts](https://github.com/or1un/mosaic/tree/main/modules/prompts): `modules/prompts`
- [Recruitment Prompt](https://github.com/or1un/mosaic/blob/main/modules/prompts/Recruitment.md): `modules/prompts/Recruitment.md`
- [OPSEC Audit Prompt](https://github.com/or1un/mosaic/blob/main/modules/prompts/OPSEC_audit.md): `modules/prompts/OPSEC_audit.md`
- [Threat Intelligence Prompt](https://github.com/or1un/mosaic/blob/main/modules/prompts/Threat_Intelligence.md): `modules/prompts/Threat_Intelligence.md`
- [PoC Prompt](https://github.com/or1un/mosaic/blob/main/modules/prompts/PoC.md): `modules/prompts/PoC.md`
- [LLM Backend](https://github.com/or1un/mosaic/blob/main/modules/llm_backend.py): `modules/llm_backend.py`
- **Ollama**
- **Human Interpretation**

### Other components

- **Researcher / Analyst**

## Connections

- Researcher / Analyst → Workflow Orchestrator: starts workflow (evidence: `README.md`)
- Workflow Orchestrator → Collection Interface: launches extraction (evidence: `MOSAIC.py`)
- Collection Interface → GitHub: collects signals (evidence: `README.md`)
- Collection Interface → Stack Overflow: collects signals (evidence: `README.md`)
- Collection Interface → Telegram: collects signals (evidence: `README.md`)
- Collection Interface → Reddit: collects signals (evidence: `README.md`)
- Collection Interface → Mastodon: collects signals (evidence: `README.md`)
- Collection Interface → Bluesky: collects signals (evidence: `README.md`)
- Collection Interface → YouTube: collects signals (evidence: `README.md`)
- Collection Interface → Medium: collects signals (evidence: `README.md`)
- Collection Interface → Local JSON Results: stores locally (evidence: `README.md`)
- Workflow Orchestrator → Analysis Workflow: optionally launches (evidence: `MOSAIC.py`)
- Researcher / Analyst → Analysis Workflow: selects context (evidence: `modules/Analysis.py`)
- Analysis Workflow → Local JSON Results: reads JSON (evidence: `modules/Analysis.py`)
- Analysis Workflow → Context Prompts: lists and reads (evidence: `modules/Analysis.py`)
- Context Prompts → Recruitment Prompt: includes (evidence: `README.md`)
- Context Prompts → OPSEC Audit Prompt: includes (evidence: `README.md`)
- Context Prompts → Threat Intelligence Prompt: includes (evidence: `README.md`)
- Context Prompts → PoC Prompt: includes (evidence: `README.md`)
- Analysis Workflow → LLM Backend: invokes analysis (evidence: `modules/Analysis.py`)
- LLM Backend → Ollama: sends prompt (evidence: `modules/llm_backend.py`)
- Analysis Workflow → Local JSON Results: saves report (evidence: `modules/Analysis.py`)
- Local JSON Results → Human Interpretation: informs interpretation (evidence: `README.md`)
