# 0x6rss/instagram-private-graph architecture

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

- Interactive diagram: https://gitdiagram.com/0x6rss/instagram-private-graph
- Repository: https://github.com/0x6rss/instagram-private-graph

## Overview

This is a local Instagram OSINT research application for authorized collection and relationship-signal analysis. The user supplies a target and authenticated session through the local interface; the backend collects or reads target-scoped artifacts, the relationship engine consolidates evidence and ranks candidate accounts, then produces network and case-summary outputs. The README documents the main results and cautions that scores and graph links are hypotheses, not verified relationships. Several subsystem links rely on the CLI excerpt or README; unsampled implementation details are not inferred.

Main entry points: [`backend/relationship_engine/cli.py`](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/cli.py) (Analysis orchestrator), [`frontend/app.js`](https://github.com/0x6rss/instagram-private-graph/blob/main/frontend/app.js) (Local interface), [`backend/server.py`](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/server.py) (Local API server), [`backend/poc.py`](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/poc.py) (Collection probes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Local interface"]
  node_local_ui["Local interface<br/>[app.js]"]
  node_http_server["Local API server<br/>[server.py]"]
end

subgraph group_collection["Collection and artifacts"]
  node_collector["Collection probes<br/>[poc.py]"]
  node_artifact_store[("Case artifacts")]
  node_artifact_loader["Artifact loader<br/>[loader.py]"]
end

subgraph group_analysis["Relationship analysis"]
  node_engine_cli["Analysis orchestrator<br/>[cli.py]"]
  node_person_model["Candidate evidence records<br/>[person.py]"]
  node_recommendations["Recommendation ingestion<br/>[discover.py]"]
  node_bootstrap["Bootstrap signals<br/>[bootstrap.py]"]
  node_chaining["Chaining signals<br/>[chaining.py]"]
  node_friendship["Friendship signals<br/>[friendship.py]"]
  node_story_signals["Story mentions<br/>[stories.py]"]
  node_geo_inference["Geographic inference<br/>[geo_inference.py]"]
  node_target_intel["Target intelligence<br/>[target_intel.py]"]
  node_verification["Hop verification<br/>[verification.py]"]
  node_temporal["Temporal analysis<br/>[temporal.py]"]
  node_locations["Location analysis<br/>[locations.py]"]
end

subgraph group_results["Case results"]
  node_candidate_results["Ranked candidates<br/>[cli.py]"]
  node_network_results["Network exports<br/>[exporter.py]"]
  node_case_report["Summary and report<br/>[reporter.py]"]
end

node_researcher(("Researcher"))
node_instagram["Instagram"]

node_researcher -->|"uses"| node_local_ui
node_local_ui -.->|"requests"| node_http_server
node_http_server -->|"serves interface"| node_local_ui
node_http_server -->|"runs analysis"| node_engine_cli
node_instagram -->|"provides visible data"| node_collector
node_collector -.->|"stores evidence"| node_artifact_store
node_artifact_store -->|"reads artifacts"| node_artifact_loader
node_engine_cli -->|"loads artifacts"| node_artifact_loader
node_engine_cli -->|"ingests"| node_recommendations
node_engine_cli -->|"ingests"| node_bootstrap
node_engine_cli -->|"ingests"| node_chaining
node_engine_cli -->|"aggregates"| node_friendship
node_engine_cli -->|"ingests"| node_story_signals
node_engine_cli -->|"populates"| node_person_model
node_engine_cli -->|"builds"| node_target_intel
node_engine_cli -->|"classifies hops"| node_verification
node_engine_cli -->|"analyzes"| node_temporal
node_engine_cli -->|"analyzes"| node_locations
node_target_intel -->|"uses signals"| node_geo_inference
node_engine_cli -->|"ranks and writes"| node_candidate_results
node_engine_cli -->|"exports"| node_network_results
node_engine_cli -.->|"generates"| node_case_report
node_candidate_results -.->|"displays"| node_local_ui
node_network_results -->|"visualizes"| node_local_ui
node_case_report -->|"informs triage"| node_researcher

click node_local_ui "https://github.com/0x6rss/instagram-private-graph/blob/main/frontend/app.js"
click node_http_server "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/server.py"
click node_collector "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/poc.py"
click node_artifact_loader "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/loader.py"
click node_engine_cli "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/cli.py"
click node_person_model "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/person.py"
click node_recommendations "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/discover.py"
click node_bootstrap "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/bootstrap.py"
click node_chaining "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/chaining.py"
click node_friendship "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/friendship.py"
click node_story_signals "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/stories.py"
click node_geo_inference "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/geo_inference.py"
click node_target_intel "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/target_intel.py"
click node_verification "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/verification.py"
click node_temporal "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/temporal.py"
click node_locations "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/locations.py"
click node_candidate_results "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/cli.py"
click node_network_results "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/exporter.py"
click node_case_report "https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/reporter.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_local_ui,node_http_server toneBlue
class node_collector,node_artifact_store,node_artifact_loader toneAmber
class node_engine_cli,node_person_model,node_recommendations,node_bootstrap,node_chaining,node_friendship,node_story_signals,node_geo_inference,node_target_intel,node_verification,node_temporal,node_locations toneMint
class node_candidate_results,node_network_results,node_case_report toneRose
class node_researcher,node_instagram toneIndigo
```

## Components

### Local interface

- [Local interface](https://github.com/0x6rss/instagram-private-graph/blob/main/frontend/app.js): `frontend/app.js`
- [Local API server](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/server.py): `backend/server.py`

### Collection and artifacts

- [Collection probes](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/poc.py): `backend/poc.py`
- **Case artifacts**
- [Artifact loader](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/loader.py): `backend/relationship_engine/loader.py`

### Relationship analysis

- [Analysis orchestrator](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/cli.py): `backend/relationship_engine/cli.py`
- [Candidate evidence records](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/person.py): `backend/relationship_engine/person.py`
- [Recommendation ingestion](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/discover.py): `backend/relationship_engine/discover.py`
- [Bootstrap signals](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/bootstrap.py): `backend/relationship_engine/bootstrap.py`
- [Chaining signals](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/chaining.py): `backend/relationship_engine/chaining.py`
- [Friendship signals](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/friendship.py): `backend/relationship_engine/friendship.py`
- [Story mentions](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/stories.py): `backend/relationship_engine/stories.py`
- [Geographic inference](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/geo_inference.py): `backend/relationship_engine/geo_inference.py`
- [Target intelligence](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/target_intel.py): `backend/relationship_engine/target_intel.py`
- [Hop verification](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/verification.py): `backend/relationship_engine/verification.py`
- [Temporal analysis](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/temporal.py): `backend/relationship_engine/temporal.py`
- [Location analysis](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/locations.py): `backend/relationship_engine/locations.py`

### Case results

- [Ranked candidates](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/cli.py): `backend/relationship_engine/cli.py`
- [Network exports](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/exporter.py): `backend/relationship_engine/exporter.py`
- [Summary and report](https://github.com/0x6rss/instagram-private-graph/blob/main/backend/relationship_engine/reporter.py): `backend/relationship_engine/reporter.py`

### Other components

- **Researcher**
- **Instagram**

## Connections

- Researcher → Local interface: uses (evidence: `README.md`)
- Local interface → Local API server: requests
- Local API server → Local interface: serves interface (evidence: `backend/server.py`)
- Local API server → Analysis orchestrator: runs analysis (evidence: `backend/server.py`)
- Instagram → Collection probes: provides visible data (evidence: `README.md`)
- Collection probes → Case artifacts: stores evidence
- Case artifacts → Artifact loader: reads artifacts (evidence: `backend/relationship_engine/loader.py`)
- Analysis orchestrator → Artifact loader: loads artifacts (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Recommendation ingestion: ingests (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Bootstrap signals: ingests (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Chaining signals: ingests (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Friendship signals: aggregates (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Story mentions: ingests (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Candidate evidence records: populates (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Target intelligence: builds (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Hop verification: classifies hops (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Temporal analysis: analyzes (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Location analysis: analyzes (evidence: `backend/relationship_engine/cli.py`)
- Target intelligence → Geographic inference: uses signals (evidence: `backend/relationship_engine/target_intel.py`)
- Analysis orchestrator → Ranked candidates: ranks and writes (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Network exports: exports (evidence: `backend/relationship_engine/cli.py`)
- Analysis orchestrator → Summary and report: generates (evidence: `backend/relationship_engine/cli.py`)
- Ranked candidates → Local interface: displays
- Network exports → Local interface: visualizes (evidence: `README.md`)
- Summary and report → Researcher: informs triage (evidence: `README.md`)
