# marceloclaro/graphrag-pipeline---sandeco architecture

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

- Interactive diagram: https://gitdiagram.com/marceloclaro/graphrag-pipeline---sandeco
- Repository: https://github.com/marceloclaro/graphrag-pipeline---sandeco

## Overview

GraphRAG Pipeline Visualizer is a React audit interface for transforming uploaded documents into chunks, embeddings, clusters and a knowledge graph, then exercising a RAG query flow. The visible runtime also provides graph and cluster inspection, metrics, and report/export capabilities. The README describes richer retrieval, CRAG and graph-expansion stages, while the sampled App excerpt shows only part of that orchestration; those stages are represented as capabilities, not asserted implementation links. Edges reflect shown calls/import references or README claims; unsampled implementation details are not inferred.

Main entry points: [`App.tsx`](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/App.tsx) (Pipeline controller), [`services/geminiService.ts`](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/geminiService.ts) (AI enrichment and embeddings), [`services/pdfService.ts`](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/pdfService.ts) (PDF extraction), [`services/mockDataService.ts`](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/mockDataService.ts) (Chunk and graph generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Ingestion and enrichment"]
  node_app["Pipeline controller<br/>[App.tsx]"]
  node_pdf["PDF extraction<br/>[pdfService.ts]"]
  node_geminisvc["AI enrichment and embeddings<br/>[geminiService.ts]"]
end

subgraph group_knowledge["Knowledge construction"]
  node_mockdata["Chunk and graph generation<br/>[mockDataService.ts]"]
  node_cnn["CNN refinement"]
  node_clusteranalysis["Cluster profiles"]
end

subgraph group_rag["RAG inference"]
  node_ragflow["HyDE and RAG query flow<br/>[App.tsx]"]
  node_ragstages["Retrieval, CRAG, graph expansion<br/>[App.tsx]"]
end

subgraph group_visualization["Audit interface"]
  node_pipelineui["Pipeline progress"]
  node_forcegraph["Interactive graph<br/>[ForceGraph.tsx]"]
  node_clusterpanel["Cluster analysis panel"]
  node_metrics["Graph metrics dashboard"]
  node_contentmodal["Full content modal"]
end

subgraph group_outputs["Reports and export"]
  node_report["Technical report<br/>[reportService.ts]"]
  node_export["Data export<br/>[exportService.ts]"]
end

node_user(("User"))
node_documents["PDF or text"]
node_pdfjs{{"PDF.js worker"}}
node_gemini{{"Gemini API"}}

node_user -->|"uploads and queries"| node_app
node_documents -->|"provides files"| node_app
node_app -->|"extracts PDF text"| node_pdf
node_pdf -->|"parses pages"| node_pdfjs
node_app -->|"enriches and embeds"| node_geminisvc
node_geminisvc -->|"calls models"| node_gemini
node_app -->|"generates clusters"| node_mockdata
node_app -->|"refines embeddings"| node_cnn
node_app -->|"requests profiles"| node_clusteranalysis
node_app -->|"runs query flow"| node_ragflow
node_ragflow -->|"generates HyDE and answer"| node_geminisvc
node_ragflow -.->|"performs documented stages"| node_ragstages
node_app -->|"shows stage"| node_pipelineui
node_app -->|"renders graph"| node_forcegraph
node_app -->|"shows cluster analysis"| node_clusterpanel
node_app -->|"shows graph metrics"| node_metrics
node_app -->|"opens content"| node_contentmodal
node_app -->|"generates report"| node_report
node_app -->|"exports data"| node_export

click node_app "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/App.tsx"
click node_pdf "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/pdfService.ts"
click node_geminisvc "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/geminiService.ts"
click node_mockdata "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/mockDataService.ts"
click node_cnn "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/cnnRefinementService.ts"
click node_clusteranalysis "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/clusterAnalysisService.ts"
click node_ragflow "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/App.tsx"
click node_ragstages "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/App.tsx"
click node_pipelineui "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/PipelineProgress.tsx"
click node_forcegraph "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/charts/ForceGraph.tsx"
click node_clusterpanel "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/ClusterAnalysisPanel.tsx"
click node_metrics "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/GraphMetricsDashboard.tsx"
click node_contentmodal "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/FullContentModal.tsx"
click node_report "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/reportService.ts"
click node_export "https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/exportService.ts"

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_app,node_pdf,node_geminisvc,node_user toneBlue
class node_mockdata,node_cnn,node_clusteranalysis toneAmber
class node_ragflow,node_ragstages,node_gemini toneMint
class node_pipelineui,node_forcegraph,node_clusterpanel,node_metrics,node_contentmodal,node_pdfjs toneRose
class node_report,node_export,node_documents toneIndigo
```

## Components

### Ingestion and enrichment

- [Pipeline controller](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/App.tsx): `App.tsx`
- [PDF extraction](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/pdfService.ts): `services/pdfService.ts`
- [AI enrichment and embeddings](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/geminiService.ts): `services/geminiService.ts`

### Knowledge construction

- [Chunk and graph generation](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/mockDataService.ts): `services/mockDataService.ts`
- [CNN refinement](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/cnnRefinementService.ts): `services/cnnRefinementService.ts`
- [Cluster profiles](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/clusterAnalysisService.ts): `services/clusterAnalysisService.ts`

### RAG inference

- [HyDE and RAG query flow](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/App.tsx): `App.tsx`
- [Retrieval, CRAG, graph expansion](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/App.tsx): `App.tsx`

### Audit interface

- [Pipeline progress](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/PipelineProgress.tsx): `components/PipelineProgress.tsx`
- [Interactive graph](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/charts/ForceGraph.tsx): `components/charts/ForceGraph.tsx`
- [Cluster analysis panel](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/ClusterAnalysisPanel.tsx): `components/ClusterAnalysisPanel.tsx`
- [Graph metrics dashboard](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/GraphMetricsDashboard.tsx): `components/GraphMetricsDashboard.tsx`
- [Full content modal](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/components/FullContentModal.tsx): `components/FullContentModal.tsx`

### Reports and export

- [Technical report](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/reportService.ts): `services/reportService.ts`
- [Data export](https://github.com/marceloclaro/graphrag-pipeline---sandeco/blob/main/services/exportService.ts): `services/exportService.ts`

### Other components

- **User**
- **PDF or text**
- **PDF.js worker**
- **Gemini API**

## Connections

- User → Pipeline controller: uploads and queries (evidence: `README.md`)
- PDF or text → Pipeline controller: provides files (evidence: `README.md`)
- Pipeline controller → PDF extraction: extracts PDF text (evidence: `App.tsx`)
- PDF extraction → PDF.js worker: parses pages (evidence: `services/pdfService.ts`)
- Pipeline controller → AI enrichment and embeddings: enriches and embeds (evidence: `App.tsx`)
- AI enrichment and embeddings → Gemini API: calls models (evidence: `services/geminiService.ts`)
- Pipeline controller → Chunk and graph generation: generates clusters (evidence: `App.tsx`)
- Pipeline controller → CNN refinement: refines embeddings (evidence: `App.tsx`)
- Pipeline controller → Cluster profiles: requests profiles
- Pipeline controller → HyDE and RAG query flow: runs query flow (evidence: `App.tsx`)
- HyDE and RAG query flow → AI enrichment and embeddings: generates HyDE and answer (evidence: `App.tsx`)
- HyDE and RAG query flow → Retrieval, CRAG, graph expansion: performs documented stages (evidence: `README.md`)
- Pipeline controller → Pipeline progress: shows stage (evidence: `App.tsx`)
- Pipeline controller → Interactive graph: renders graph (evidence: `App.tsx`)
- Pipeline controller → Cluster analysis panel: shows cluster analysis (evidence: `App.tsx`)
- Pipeline controller → Graph metrics dashboard: shows graph metrics (evidence: `App.tsx`)
- Pipeline controller → Full content modal: opens content (evidence: `App.tsx`)
- Pipeline controller → Technical report: generates report (evidence: `App.tsx`)
- Pipeline controller → Data export: exports data (evidence: `App.tsx`)
