# graphify-labs/graphify architecture

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

- Interactive diagram: https://gitdiagram.com/graphify-labs/graphify
- Repository: https://github.com/graphify-labs/graphify
- Video tour (about a minute): https://gitdiagram.com/graphify-labs/graphify/video

## Overview

Graphify is a local code-and-document knowledge-graph generator with a CLI for building and querying project maps. The primary workflow discovers project files, extracts and resolves graph facts, builds and analyzes the graph, then persists and presents the results. README-documented branches include semantic processing for non-code materials and graph queries. Edges are limited to README statements and source-index references; unsampled implementation details are represented without speculative call chains.

Main entry points: [`graphify/build.py`](https://github.com/graphify-labs/graphify/blob/v8/graphify/build.py) (Graph builder), [`graphify/cli.py`](https://github.com/graphify-labs/graphify/blob/v8/graphify/cli.py) (CLI workflow), [`graphify/extract.py`](https://github.com/graphify-labs/graphify/blob/v8/graphify/extract.py) (Code extraction), [`graphify/analyze.py`](https://github.com/graphify-labs/graphify/blob/v8/graphify/analyze.py) (Graph analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and discovery"]
  node_cli["CLI workflow<br/>[cli.py]"]
  node_discovery["File discovery<br/>[detect.py]"]
end

subgraph group_graph["Graph construction"]
  node_resolve["Symbol resolution<br/>[resolution.py]"]
  node_ids["Node identity<br/>[ids.py]"]
  node_dedup["Graph deduplication<br/>[dedup.py]"]
  node_build["Graph builder<br/>[build.py]"]
  node_cache[("Incremental cache<br/>[cache.py]")]
end

subgraph group_inputs["Input processing"]
  node_ingest["URL capture<br/>[ingest.py]"]
  node_semantic["Semantic extraction<br/>[llm.py]"]
  node_extract["Code extraction<br/>[extract.py]"]
  node_language["Language parsers<br/>[engine.py]"]
  node_models["Extractor models<br/>[models.py]"]
  node_manifest["Manifest ingestion<br/>[manifest_ingest.py]"]
  node_scip["SCIP ingestion<br/>[scip_ingest.py]"]
  node_mcp["MCP ingestion<br/>[mcp_ingest.py]"]
end

subgraph group_results["Analysis and results"]
  node_analyze["Graph analysis<br/>[analyze.py]"]
  node_cluster["Community detection<br/>[cluster.py]"]
  node_export["Graph export<br/>[export.py]"]
  node_html["Interactive graph<br/>[html.py]"]
  node_report["Graph report<br/>[report.py]"]
  node_query["Graph queries<br/>[cli.py]"]
end

node_user(("Developer"))

node_user -->|"runs"| node_cli
node_cli -.->|"discovers files"| node_discovery
node_discovery -.->|"selects inputs"| node_extract
node_extract -.->|"dispatches parsing"| node_language
node_extract -->|"uses resolution"| node_resolve
node_extract -.->|"uses models"| node_models
node_semantic -.->|"supplies graph facts"| node_build
node_manifest -->|"creates package IDs"| node_ids
node_scip -->|"uses IDs"| node_ids
node_mcp -->|"uses IDs"| node_ids
node_build -->|"normalizes IDs"| node_ids
node_build -->|"uses resolution"| node_resolve
node_build -->|"uses extractors"| node_language
node_build -->|"deduplicates"| node_dedup
node_build -.->|"uses cache"| node_cache
node_cli -->|"captures URLs"| node_ingest
node_analyze -->|"uses built graph"| node_build
node_analyze -->|"detects communities"| node_cluster
node_cli -->|"analyzes graph"| node_analyze
node_cli -->|"writes graph"| node_export
node_export -->|"renders graph"| node_html
node_cli -->|"produces highlights"| node_report
node_user -->|"asks questions"| node_query
node_query -.->|"queries graph"| node_analyze

click node_cli "https://github.com/graphify-labs/graphify/blob/v8/graphify/cli.py"
click node_discovery "https://github.com/graphify-labs/graphify/blob/v8/graphify/detect.py"
click node_ingest "https://github.com/graphify-labs/graphify/blob/v8/graphify/ingest.py"
click node_semantic "https://github.com/graphify-labs/graphify/blob/v8/graphify/llm.py"
click node_extract "https://github.com/graphify-labs/graphify/blob/v8/graphify/extract.py"
click node_language "https://github.com/graphify-labs/graphify/blob/v8/graphify/extractors/engine.py"
click node_models "https://github.com/graphify-labs/graphify/blob/v8/graphify/extractors/models.py"
click node_resolve "https://github.com/graphify-labs/graphify/blob/v8/graphify/extractors/resolution.py"
click node_manifest "https://github.com/graphify-labs/graphify/blob/v8/graphify/manifest_ingest.py"
click node_scip "https://github.com/graphify-labs/graphify/blob/v8/graphify/scip_ingest.py"
click node_mcp "https://github.com/graphify-labs/graphify/blob/v8/graphify/mcp_ingest.py"
click node_ids "https://github.com/graphify-labs/graphify/blob/v8/graphify/ids.py"
click node_dedup "https://github.com/graphify-labs/graphify/blob/v8/graphify/dedup.py"
click node_build "https://github.com/graphify-labs/graphify/blob/v8/graphify/build.py"
click node_cache "https://github.com/graphify-labs/graphify/blob/v8/graphify/cache.py"
click node_analyze "https://github.com/graphify-labs/graphify/blob/v8/graphify/analyze.py"
click node_cluster "https://github.com/graphify-labs/graphify/blob/v8/graphify/cluster.py"
click node_export "https://github.com/graphify-labs/graphify/blob/v8/graphify/export.py"
click node_html "https://github.com/graphify-labs/graphify/blob/v8/graphify/exporters/html.py"
click node_report "https://github.com/graphify-labs/graphify/blob/v8/graphify/report.py"
click node_query "https://github.com/graphify-labs/graphify/blob/v8/graphify/cli.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_cli,node_discovery toneBlue
class node_resolve,node_ids,node_dedup,node_build,node_cache toneAmber
class node_ingest,node_semantic,node_extract,node_language,node_models,node_manifest,node_scip,node_mcp toneMint
class node_analyze,node_cluster,node_export,node_html,node_report,node_query toneRose
class node_user toneIndigo
```

## Components

### Entry and discovery

- [CLI workflow](https://github.com/graphify-labs/graphify/blob/v8/graphify/cli.py): `graphify/cli.py`
- [File discovery](https://github.com/graphify-labs/graphify/blob/v8/graphify/detect.py): `graphify/detect.py`

### Graph construction

- [Symbol resolution](https://github.com/graphify-labs/graphify/blob/v8/graphify/extractors/resolution.py): `graphify/extractors/resolution.py`
- [Node identity](https://github.com/graphify-labs/graphify/blob/v8/graphify/ids.py): `graphify/ids.py`
- [Graph deduplication](https://github.com/graphify-labs/graphify/blob/v8/graphify/dedup.py): `graphify/dedup.py`
- [Graph builder](https://github.com/graphify-labs/graphify/blob/v8/graphify/build.py): `graphify/build.py`
- [Incremental cache](https://github.com/graphify-labs/graphify/blob/v8/graphify/cache.py): `graphify/cache.py`

### Input processing

- [URL capture](https://github.com/graphify-labs/graphify/blob/v8/graphify/ingest.py): `graphify/ingest.py`
- [Semantic extraction](https://github.com/graphify-labs/graphify/blob/v8/graphify/llm.py): `graphify/llm.py`
- [Code extraction](https://github.com/graphify-labs/graphify/blob/v8/graphify/extract.py): `graphify/extract.py`
- [Language parsers](https://github.com/graphify-labs/graphify/blob/v8/graphify/extractors/engine.py): `graphify/extractors/engine.py`
- [Extractor models](https://github.com/graphify-labs/graphify/blob/v8/graphify/extractors/models.py): `graphify/extractors/models.py`
- [Manifest ingestion](https://github.com/graphify-labs/graphify/blob/v8/graphify/manifest_ingest.py): `graphify/manifest_ingest.py`
- [SCIP ingestion](https://github.com/graphify-labs/graphify/blob/v8/graphify/scip_ingest.py): `graphify/scip_ingest.py`
- [MCP ingestion](https://github.com/graphify-labs/graphify/blob/v8/graphify/mcp_ingest.py): `graphify/mcp_ingest.py`

### Analysis and results

- [Graph analysis](https://github.com/graphify-labs/graphify/blob/v8/graphify/analyze.py): `graphify/analyze.py`
- [Community detection](https://github.com/graphify-labs/graphify/blob/v8/graphify/cluster.py): `graphify/cluster.py`
- [Graph export](https://github.com/graphify-labs/graphify/blob/v8/graphify/export.py): `graphify/export.py`
- [Interactive graph](https://github.com/graphify-labs/graphify/blob/v8/graphify/exporters/html.py): `graphify/exporters/html.py`
- [Graph report](https://github.com/graphify-labs/graphify/blob/v8/graphify/report.py): `graphify/report.py`
- [Graph queries](https://github.com/graphify-labs/graphify/blob/v8/graphify/cli.py): `graphify/cli.py`

### Other components

- **Developer**

## Connections

- Developer → CLI workflow: runs (evidence: `README.md`)
- CLI workflow → File discovery: discovers files
- File discovery → Code extraction: selects inputs
- Code extraction → Language parsers: dispatches parsing
- Code extraction → Symbol resolution: uses resolution
- Code extraction → Extractor models: uses models
- Semantic extraction → Graph builder: supplies graph facts (evidence: `graphify/llm.py`)
- Manifest ingestion → Node identity: creates package IDs (evidence: `graphify/manifest_ingest.py`)
- SCIP ingestion → Node identity: uses IDs (evidence: `graphify/scip_ingest.py`)
- MCP ingestion → Node identity: uses IDs (evidence: `graphify/mcp_ingest.py`)
- Graph builder → Node identity: normalizes IDs (evidence: `graphify/build.py`)
- Graph builder → Symbol resolution: uses resolution (evidence: `graphify/build.py`)
- Graph builder → Language parsers: uses extractors (evidence: `graphify/build.py`)
- Graph builder → Graph deduplication: deduplicates (evidence: `graphify/build.py`)
- Graph builder → Incremental cache: uses cache
- CLI workflow → URL capture: captures URLs (evidence: `README.md`)
- Graph analysis → Graph builder: uses built graph (evidence: `graphify/analyze.py`)
- Graph analysis → Community detection: detects communities (evidence: `graphify/analyze.py`)
- CLI workflow → Graph analysis: analyzes graph (evidence: `graphify/analyze.py`)
- CLI workflow → Graph export: writes graph (evidence: `README.md`)
- Graph export → Interactive graph: renders graph (evidence: `graphify/exporters/html.py`)
- CLI workflow → Graph report: produces highlights (evidence: `README.md`)
- Developer → Graph queries: asks questions (evidence: `README.md`)
- Graph queries → Graph analysis: queries graph
