# janani-chandrakanth/graphrag architecture

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

- Interactive diagram: https://gitdiagram.com/janani-chandrakanth/graphrag
- Repository: https://github.com/janani-chandrakanth/graphrag

## Overview

This is a requirements-to-knowledge-graph application: users ingest requirement documents, normalize and extract structured items, persist them as a graph, then query, inspect, compare, and analyze that graph. Additional capabilities include community summaries, semantic retrieval, flow analysis, evaluation, and test-case generation. The README is empty; relationships below rely on source excerpts and SOURCE INDEX references. Some integration paths are therefore shown as unverified rather than asserted as confirmed calls.

Main entry points: [`ui/update_graph_tab.py`](https://github.com/janani-chandrakanth/graphrag/blob/main/ui/update_graph_tab.py) (Document Update), [`graph/neo4j_manager.py`](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/neo4j_manager.py) (Graph Store), [`graph/langchain_qa.py`](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/langchain_qa.py) (Natural Language QA), [`graph/incremental_merge.py`](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/incremental_merge.py) (Incremental Merge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Document Ingestion"]
  node_parser["Document Parser<br/>[parser.py]"]
  node_detector["Document Type Detection"]
  node_normalizer["Normalization<br/>[normalization.py]"]
  node_extractors["Text Extractors<br/>[extractors.py]"]
  node_chunker["Requirement Chunking<br/>[chunker.py]"]
end

subgraph group_graph["Knowledge Graph"]
  node_entities["Entity Extraction"]
  node_linker["Requirement Linking"]
  node_dedupe["Deduplication<br/>[deduplicator.py]"]
  node_validator["Graph Validation<br/>[validator.py]"]
  node_incremental["Incremental Merge"]
  node_versions["Graph Versions<br/>[version_manager.py]"]
end

subgraph group_insight["Graph Insights"]
  node_communities["Community Summaries"]
  node_query["GraphRAG Query<br/>[query_engine.py]"]
  node_qa["Natural Language QA<br/>[langchain_qa.py]"]
  node_analysis["Graph Analysis<br/>[graph_analysis.py]"]
  node_flow["Flow Analysis"]
  node_features["Feature Extraction"]
  node_testgen["Test Generation"]
  node_hybridtest["Hybrid Test Generation"]
  node_evaluation["Graph Evaluation"]
end

subgraph group_interface["User Interface"]
  node_app["Application<br/>[app.py]"]
  node_update["Document Update"]
  node_visualizer["Graph Visualization"]
  node_queryui["Query View<br/>[query_graph_tab.py]"]
  node_dashboard["Dashboard<br/>[dashboard_tab.py]"]
  node_featureui["Feature Flow View"]
  node_evalui["Evaluation View<br/>[evaluation_tab.py]"]
  node_compareui["Version Comparison<br/>[compare_tab.py]"]
end

subgraph group_storage["Persistence"]
  node_neo4j[("Graph Store<br/>[neo4j_manager.py]")]
  node_chroma[("Vector Store<br/>[chroma_manager.py]")]
end

node_user(("User"))
node_llm{{"Ollama Service"}}

node_user -.->|"uses"| node_app
node_user -.->|"submits documents"| node_update
node_app -.->|"shows"| node_update
node_update -->|"parses"| node_parser
node_parser -->|"extracts text"| node_extractors
node_parser -->|"normalizes"| node_normalizer
node_update -->|"detects type"| node_detector
node_update -->|"chunks items"| node_chunker
node_update -->|"extracts entities"| node_entities
node_update -->|"deduplicates"| node_dedupe
node_update -->|"validates"| node_validator
node_update -->|"stores graph"| node_neo4j
node_update -->|"merges updates"| node_incremental
node_update -->|"versions graph"| node_versions
node_update -->|"refreshes summaries"| node_communities
node_update -->|"refreshes QA"| node_qa
node_update -.->|"requests extraction"| node_llm
node_entities -->|"requests extraction"| node_llm
node_normalizer -->|"fills gaps"| node_llm
node_incremental -->|"deduplicates"| node_dedupe
node_incremental -->|"merges graph"| node_neo4j
node_incremental -->|"updates vectors"| node_chroma
node_communities -->|"reads graph"| node_neo4j
node_communities -->|"stores summaries"| node_chroma
node_communities -->|"summarizes"| node_llm
node_queryui -->|"asks"| node_qa
node_qa -->|"retrieves context"| node_query
node_qa -->|"queries graph"| node_neo4j
node_qa -->|"searches vectors"| node_chroma
node_query -->|"retrieves summaries"| node_chroma
node_query -->|"generates answer"| node_llm
node_queryui -->|"runs Cypher"| node_neo4j
node_queryui -->|"renders results"| node_visualizer
node_dashboard -->|"reads graph"| node_neo4j
node_dashboard -->|"lists versions"| node_versions
node_featureui -->|"extracts features"| node_features
node_featureui -->|"reads graph"| node_neo4j
node_featureui -->|"renders flow"| node_visualizer
node_features -->|"analyzes flow"| node_flow
node_analysis -->|"analyzes sequences"| node_flow
node_analysis -->|"reads graph"| node_neo4j
node_visualizer -->|"analyzes layout"| node_flow
node_evalui -->|"evaluates graph"| node_evaluation
node_evalui -->|"reads graph"| node_neo4j
node_evaluation -.->|"evaluates semantics"| node_llm
node_testgen -->|"uses features"| node_features
node_testgen -->|"analyzes flow"| node_flow
node_hybridtest -->|"extends generation"| node_testgen

click node_app "https://github.com/janani-chandrakanth/graphrag/blob/main/app.py"
click node_update "https://github.com/janani-chandrakanth/graphrag/blob/main/ui/update_graph_tab.py"
click node_parser "https://github.com/janani-chandrakanth/graphrag/blob/main/parser/parser.py"
click node_detector "https://github.com/janani-chandrakanth/graphrag/blob/main/parser/document_type_detector.py"
click node_normalizer "https://github.com/janani-chandrakanth/graphrag/blob/main/parser/normalization.py"
click node_extractors "https://github.com/janani-chandrakanth/graphrag/blob/main/parser/extractors.py"
click node_chunker "https://github.com/janani-chandrakanth/graphrag/blob/main/chunking/chunker.py"
click node_entities "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/entity_extractor.py"
click node_linker "https://github.com/janani-chandrakanth/graphrag/blob/main/parser/requirement_linker.py"
click node_dedupe "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/deduplicator.py"
click node_validator "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/validator.py"
click node_neo4j "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/neo4j_manager.py"
click node_chroma "https://github.com/janani-chandrakanth/graphrag/blob/main/vectorstore/chroma_manager.py"
click node_incremental "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/incremental_merge.py"
click node_versions "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/version_manager.py"
click node_communities "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/community_engine.py"
click node_query "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/query_engine.py"
click node_qa "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/langchain_qa.py"
click node_analysis "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/graph_analysis.py"
click node_flow "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/flow_graph_analysis.py"
click node_features "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/feature_extractor.py"
click node_testgen "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/graph_test_case_generator.py"
click node_hybridtest "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/hybrid_test_case_generator.py"
click node_evaluation "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/evaluation/graph_evaluators.py"
click node_visualizer "https://github.com/janani-chandrakanth/graphrag/blob/main/graph/graph_visualizer.py"
click node_queryui "https://github.com/janani-chandrakanth/graphrag/blob/main/ui/query_graph_tab.py"
click node_dashboard "https://github.com/janani-chandrakanth/graphrag/blob/main/ui/dashboard_tab.py"
click node_featureui "https://github.com/janani-chandrakanth/graphrag/blob/main/ui/feature_flow_tab.py"
click node_evalui "https://github.com/janani-chandrakanth/graphrag/blob/main/ui/evaluation_tab.py"
click node_compareui "https://github.com/janani-chandrakanth/graphrag/blob/main/ui/compare_tab.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_parser,node_detector,node_normalizer,node_extractors,node_chunker,node_user toneBlue
class node_entities,node_linker,node_dedupe,node_validator,node_incremental,node_versions toneAmber
class node_communities,node_query,node_qa,node_analysis,node_flow,node_features,node_testgen,node_hybridtest,node_evaluation toneMint
class node_app,node_update,node_visualizer,node_queryui,node_dashboard,node_featureui,node_evalui,node_compareui toneRose
class node_neo4j,node_chroma,node_llm toneIndigo
```

## Components

### Document Ingestion

- [Document Parser](https://github.com/janani-chandrakanth/graphrag/blob/main/parser/parser.py): `parser/parser.py`
- [Document Type Detection](https://github.com/janani-chandrakanth/graphrag/blob/main/parser/document_type_detector.py): `parser/document_type_detector.py`
- [Normalization](https://github.com/janani-chandrakanth/graphrag/blob/main/parser/normalization.py): `parser/normalization.py`
- [Text Extractors](https://github.com/janani-chandrakanth/graphrag/blob/main/parser/extractors.py): `parser/extractors.py`
- [Requirement Chunking](https://github.com/janani-chandrakanth/graphrag/blob/main/chunking/chunker.py): `chunking/chunker.py`

### Knowledge Graph

- [Entity Extraction](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/entity_extractor.py): `graph/entity_extractor.py`
- [Requirement Linking](https://github.com/janani-chandrakanth/graphrag/blob/main/parser/requirement_linker.py): `parser/requirement_linker.py`
- [Deduplication](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/deduplicator.py): `graph/deduplicator.py`
- [Graph Validation](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/validator.py): `graph/validator.py`
- [Incremental Merge](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/incremental_merge.py): `graph/incremental_merge.py`
- [Graph Versions](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/version_manager.py): `graph/version_manager.py`

### Graph Insights

- [Community Summaries](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/community_engine.py): `graph/community_engine.py`
- [GraphRAG Query](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/query_engine.py): `graph/query_engine.py`
- [Natural Language QA](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/langchain_qa.py): `graph/langchain_qa.py`
- [Graph Analysis](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/graph_analysis.py): `graph/graph_analysis.py`
- [Flow Analysis](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/flow_graph_analysis.py): `graph/flow_graph_analysis.py`
- [Feature Extraction](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/feature_extractor.py): `graph/feature_extractor.py`
- [Test Generation](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/graph_test_case_generator.py): `graph/graph_test_case_generator.py`
- [Hybrid Test Generation](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/hybrid_test_case_generator.py): `graph/hybrid_test_case_generator.py`
- [Graph Evaluation](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/evaluation/graph_evaluators.py): `graph/evaluation/graph_evaluators.py`

### User Interface

- [Application](https://github.com/janani-chandrakanth/graphrag/blob/main/app.py): `app.py`
- [Document Update](https://github.com/janani-chandrakanth/graphrag/blob/main/ui/update_graph_tab.py): `ui/update_graph_tab.py`
- [Graph Visualization](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/graph_visualizer.py): `graph/graph_visualizer.py`
- [Query View](https://github.com/janani-chandrakanth/graphrag/blob/main/ui/query_graph_tab.py): `ui/query_graph_tab.py`
- [Dashboard](https://github.com/janani-chandrakanth/graphrag/blob/main/ui/dashboard_tab.py): `ui/dashboard_tab.py`
- [Feature Flow View](https://github.com/janani-chandrakanth/graphrag/blob/main/ui/feature_flow_tab.py): `ui/feature_flow_tab.py`
- [Evaluation View](https://github.com/janani-chandrakanth/graphrag/blob/main/ui/evaluation_tab.py): `ui/evaluation_tab.py`
- [Version Comparison](https://github.com/janani-chandrakanth/graphrag/blob/main/ui/compare_tab.py): `ui/compare_tab.py`

### Persistence

- [Graph Store](https://github.com/janani-chandrakanth/graphrag/blob/main/graph/neo4j_manager.py): `graph/neo4j_manager.py`
- [Vector Store](https://github.com/janani-chandrakanth/graphrag/blob/main/vectorstore/chroma_manager.py): `vectorstore/chroma_manager.py`

### Other components

- **User**
- **Ollama Service**

## Connections

- User → Application: uses
- User → Document Update: submits documents
- Application → Document Update: shows (evidence: `app.py`)
- Document Update → Document Parser: parses (evidence: `ui/update_graph_tab.py`)
- Document Parser → Text Extractors: extracts text (evidence: `parser/parser.py`)
- Document Parser → Normalization: normalizes (evidence: `parser/parser.py`)
- Document Update → Document Type Detection: detects type (evidence: `ui/update_graph_tab.py`)
- Document Update → Requirement Chunking: chunks items (evidence: `ui/update_graph_tab.py`)
- Document Update → Entity Extraction: extracts entities (evidence: `ui/update_graph_tab.py`)
- Document Update → Deduplication: deduplicates (evidence: `ui/update_graph_tab.py`)
- Document Update → Graph Validation: validates (evidence: `ui/update_graph_tab.py`)
- Document Update → Graph Store: stores graph (evidence: `ui/update_graph_tab.py`)
- Document Update → Incremental Merge: merges updates (evidence: `ui/update_graph_tab.py`)
- Document Update → Graph Versions: versions graph (evidence: `ui/update_graph_tab.py`)
- Document Update → Community Summaries: refreshes summaries (evidence: `ui/update_graph_tab.py`)
- Document Update → Natural Language QA: refreshes QA (evidence: `ui/update_graph_tab.py`)
- Document Update → Ollama Service: requests extraction
- Entity Extraction → Ollama Service: requests extraction (evidence: `graph/entity_extractor.py`)
- Normalization → Ollama Service: fills gaps (evidence: `parser/normalization.py`)
- Incremental Merge → Deduplication: deduplicates (evidence: `graph/incremental_merge.py`)
- Incremental Merge → Graph Store: merges graph (evidence: `graph/incremental_merge.py`)
- Incremental Merge → Vector Store: updates vectors (evidence: `graph/incremental_merge.py`)
- Community Summaries → Graph Store: reads graph (evidence: `graph/community_engine.py`)
- Community Summaries → Vector Store: stores summaries (evidence: `graph/community_engine.py`)
- Community Summaries → Ollama Service: summarizes (evidence: `graph/community_engine.py`)
- Query View → Natural Language QA: asks (evidence: `ui/query_graph_tab.py`)
- Natural Language QA → GraphRAG Query: retrieves context (evidence: `graph/langchain_qa.py`)
- Natural Language QA → Graph Store: queries graph (evidence: `graph/langchain_qa.py`)
- Natural Language QA → Vector Store: searches vectors (evidence: `graph/langchain_qa.py`)
- GraphRAG Query → Vector Store: retrieves summaries (evidence: `graph/query_engine.py`)
- GraphRAG Query → Ollama Service: generates answer (evidence: `graph/query_engine.py`)
- Query View → Graph Store: runs Cypher (evidence: `ui/query_graph_tab.py`)
- Query View → Graph Visualization: renders results (evidence: `ui/query_graph_tab.py`)
- Dashboard → Graph Store: reads graph (evidence: `ui/dashboard_tab.py`)
- Dashboard → Graph Versions: lists versions (evidence: `ui/dashboard_tab.py`)
- Feature Flow View → Feature Extraction: extracts features (evidence: `ui/feature_flow_tab.py`)
- Feature Flow View → Graph Store: reads graph (evidence: `ui/feature_flow_tab.py`)
- Feature Flow View → Graph Visualization: renders flow (evidence: `ui/feature_flow_tab.py`)
- Feature Extraction → Flow Analysis: analyzes flow (evidence: `graph/feature_extractor.py`)
- Graph Analysis → Flow Analysis: analyzes sequences (evidence: `graph/graph_analysis.py`)
- Graph Analysis → Graph Store: reads graph (evidence: `graph/graph_analysis.py`)
- Graph Visualization → Flow Analysis: analyzes layout (evidence: `graph/graph_visualizer.py`)
- Evaluation View → Graph Evaluation: evaluates graph (evidence: `ui/evaluation_tab.py`)
- Evaluation View → Graph Store: reads graph (evidence: `ui/evaluation_tab.py`)
- Graph Evaluation → Ollama Service: evaluates semantics
- Test Generation → Feature Extraction: uses features (evidence: `graph/graph_test_case_generator.py`)
- Test Generation → Flow Analysis: analyzes flow (evidence: `graph/graph_test_case_generator.py`)
- Hybrid Test Generation → Test Generation: extends generation (evidence: `graph/hybrid_test_case_generator.py`)
