# ruchita17697/graphrag architecture

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

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

## Overview

TigerGraph GraphRAG combines a knowledge-graph builder with graph-powered Q&A. The user-facing flow is document upload or cloud ingestion, chunking and LLM-based entity/relationship extraction, then graph and embedding storage; questions enter through the UI or API and use schema-aware query generation and retrieval to produce answers. Separate capabilities include classic and agentic chat, MCP tools, administration, trace logs, and eventual-consistency rebuilds. Several subsystem links are documented in the README; where sampled source does not establish call ownership, links are omitted or marked unverified.

Main entry points: [`common/embeddings/tigergraph_embedding_store.py`](https://github.com/ruchita17697/graphrag/blob/main/common/embeddings/tigergraph_embedding_store.py) (TigerGraph graph and vector store), [`graphrag/app/main.py`](https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/main.py) (API application), [`graphrag/app/supportai/supportai_ingest.py`](https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/supportai/supportai_ingest.py) (Document ingestion), [`graphrag-ui/src/main.tsx`](https://github.com/ruchita17697/graphrag/blob/main/graphrag-ui/src/main.tsx) (Chat and Admin UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_ui["Chat and Admin UI<br/>[main.tsx]"]
end

subgraph group_services["API services"]
  node_api["API application<br/>[main.py]"]
  node_routers["API routes"]
end

subgraph group_knowledge["Knowledge construction"]
  node_ingestion["Document ingestion"]
  node_chunking["Chunking strategies"]
  node_extractor["KG extraction"]
  node_ecc["Consistency and rebuild<br/>[main.py]"]
  node_ecc_workers["Graph processing workers<br/>[workers.py]"]
end

subgraph group_query["Question answering"]
  node_query["Query orchestration<br/>[queryai.py]"]
  node_support["Support chat<br/>[supportai.py]"]
  node_retrievers["Graph retrievers"]
  node_tools["Query tools"]
  node_agents["Agentic chat"]
  node_mcp["MCP integrations"]
end

subgraph group_platform["Shared platform"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_llm["LLM providers"]
  node_embeddings["Embedding services"]
  node_store[("TigerGraph graph and vector store")]
  node_db[("TigerGraph connections and schema<br/>[connections.py]")]
  node_logs["Logging and metrics<br/>[logwriter.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_ui
node_user -->|"calls API"| node_api
node_ui -.->|"calls API"| node_api
node_api -->|"registers routes"| node_routers
node_routers -->|"routes questions"| node_query
node_routers -->|"routes support"| node_support
node_ui -->|"submits documents"| node_ingestion
node_ingestion -->|"chunks documents"| node_chunking
node_ingestion -->|"extracts graph"| node_extractor
node_extractor -->|"calls model"| node_llm
node_ingestion -->|"writes graph data"| node_store
node_ecc -->|"starts processing"| node_ecc_workers
node_ecc_workers -->|"uses extractor"| node_extractor
node_ecc_workers -->|"updates embeddings"| node_store
node_query -->|"uses query tools"| node_tools
node_support -->|"retrieves context"| node_retrievers
node_retrievers -->|"searches graph"| node_store
node_retrievers -.->|"embeds queries"| node_embeddings
node_query -.->|"selects chat engine"| node_agents
node_agents -->|"invokes tools"| node_mcp
node_config -->|"configures providers"| node_llm
node_config -->|"configures store"| node_store
node_store -->|"generates vectors"| node_embeddings
node_store -.->|"uses connection"| node_db
node_api -->|"initializes clients"| node_mcp
node_api -->|"records requests"| node_logs

click node_ui "https://github.com/ruchita17697/graphrag/blob/main/graphrag-ui/src/main.tsx"
click node_api "https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/main.py"
click node_routers "https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/routers"
click node_ingestion "https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/supportai/supportai_ingest.py"
click node_chunking "https://github.com/ruchita17697/graphrag/tree/main/common/chunkers"
click node_extractor "https://github.com/ruchita17697/graphrag/blob/main/common/extractors/LLMEntityRelationshipExtractor.py"
click node_ecc "https://github.com/ruchita17697/graphrag/blob/main/ecc/app/main.py"
click node_ecc_workers "https://github.com/ruchita17697/graphrag/blob/main/ecc/app/graphrag/workers.py"
click node_query "https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/routers/queryai.py"
click node_support "https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/supportai/supportai.py"
click node_retrievers "https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/supportai/retrievers"
click node_tools "https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/tools"
click node_agents "https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/agent"
click node_mcp "https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/mcp_addons"
click node_config "https://github.com/ruchita17697/graphrag/blob/main/common/config.py"
click node_llm "https://github.com/ruchita17697/graphrag/tree/main/common/llm_services"
click node_embeddings "https://github.com/ruchita17697/graphrag/blob/main/common/embeddings/embedding_services.py"
click node_store "https://github.com/ruchita17697/graphrag/blob/main/common/embeddings/tigergraph_embedding_store.py"
click node_db "https://github.com/ruchita17697/graphrag/blob/main/common/db/connections.py"
click node_logs "https://github.com/ruchita17697/graphrag/blob/main/common/logs/logwriter.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_ui,node_user toneBlue
class node_api,node_routers toneAmber
class node_ingestion,node_chunking,node_extractor,node_ecc,node_ecc_workers toneMint
class node_query,node_support,node_retrievers,node_tools,node_agents,node_mcp toneRose
class node_config,node_llm,node_embeddings,node_store,node_db,node_logs toneIndigo
```

## Components

### User interface

- [Chat and Admin UI](https://github.com/ruchita17697/graphrag/blob/main/graphrag-ui/src/main.tsx): `graphrag-ui/src/main.tsx`

### API services

- [API application](https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/main.py): `graphrag/app/main.py`
- [API routes](https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/routers): `graphrag/app/routers`

### Knowledge construction

- [Document ingestion](https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/supportai/supportai_ingest.py): `graphrag/app/supportai/supportai_ingest.py`
- [Chunking strategies](https://github.com/ruchita17697/graphrag/tree/main/common/chunkers): `common/chunkers`
- [KG extraction](https://github.com/ruchita17697/graphrag/blob/main/common/extractors/LLMEntityRelationshipExtractor.py): `common/extractors/LLMEntityRelationshipExtractor.py`
- [Consistency and rebuild](https://github.com/ruchita17697/graphrag/blob/main/ecc/app/main.py): `ecc/app/main.py`
- [Graph processing workers](https://github.com/ruchita17697/graphrag/blob/main/ecc/app/graphrag/workers.py): `ecc/app/graphrag/workers.py`

### Question answering

- [Query orchestration](https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/routers/queryai.py): `graphrag/app/routers/queryai.py`
- [Support chat](https://github.com/ruchita17697/graphrag/blob/main/graphrag/app/supportai/supportai.py): `graphrag/app/supportai/supportai.py`
- [Graph retrievers](https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/supportai/retrievers): `graphrag/app/supportai/retrievers`
- [Query tools](https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/tools): `graphrag/app/tools`
- [Agentic chat](https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/agent): `graphrag/app/agent`
- [MCP integrations](https://github.com/ruchita17697/graphrag/tree/main/graphrag/app/mcp_addons): `graphrag/app/mcp_addons`

### Shared platform

- [Runtime configuration](https://github.com/ruchita17697/graphrag/blob/main/common/config.py): `common/config.py`
- [LLM providers](https://github.com/ruchita17697/graphrag/tree/main/common/llm_services): `common/llm_services`
- [Embedding services](https://github.com/ruchita17697/graphrag/blob/main/common/embeddings/embedding_services.py): `common/embeddings/embedding_services.py`
- [TigerGraph graph and vector store](https://github.com/ruchita17697/graphrag/blob/main/common/embeddings/tigergraph_embedding_store.py): `common/embeddings/tigergraph_embedding_store.py`
- [TigerGraph connections and schema](https://github.com/ruchita17697/graphrag/blob/main/common/db/connections.py): `common/db/connections.py`
- [Logging and metrics](https://github.com/ruchita17697/graphrag/blob/main/common/logs/logwriter.py): `common/logs/logwriter.py`

### Other components

- **User**

## Connections

- User → Chat and Admin UI: uses (evidence: `README.md`)
- User → API application: calls API (evidence: `README.md`)
- Chat and Admin UI → API application: calls API
- API application → API routes: registers routes (evidence: `graphrag/app/main.py`)
- API routes → Query orchestration: routes questions (evidence: `graphrag/app/routers/__init__.py`)
- API routes → Support chat: routes support (evidence: `graphrag/app/routers/__init__.py`)
- Chat and Admin UI → Document ingestion: submits documents (evidence: `README.md`)
- Document ingestion → Chunking strategies: chunks documents (evidence: `graphrag/app/supportai/supportai_ingest.py`)
- Document ingestion → KG extraction: extracts graph (evidence: `graphrag/app/supportai/supportai_ingest.py`)
- KG extraction → LLM providers: calls model (evidence: `common/extractors/LLMEntityRelationshipExtractor.py`)
- Document ingestion → TigerGraph graph and vector store: writes graph data (evidence: `README.md`)
- Consistency and rebuild → Graph processing workers: starts processing (evidence: `ecc/app/main.py`)
- Graph processing workers → KG extraction: uses extractor (evidence: `ecc/app/graphrag/workers.py`)
- Graph processing workers → TigerGraph graph and vector store: updates embeddings (evidence: `ecc/app/graphrag/workers.py`)
- Query orchestration → Query tools: uses query tools (evidence: `graphrag/app/routers/queryai.py`)
- Support chat → Graph retrievers: retrieves context (evidence: `README.md`)
- Graph retrievers → TigerGraph graph and vector store: searches graph (evidence: `README.md`)
- Graph retrievers → Embedding services: embeds queries
- Query orchestration → Agentic chat: selects chat engine
- Agentic chat → MCP integrations: invokes tools (evidence: `README.md`)
- Runtime configuration → LLM providers: configures providers (evidence: `common/config.py`)
- Runtime configuration → TigerGraph graph and vector store: configures store (evidence: `common/config.py`)
- TigerGraph graph and vector store → Embedding services: generates vectors (evidence: `common/embeddings/tigergraph_embedding_store.py`)
- TigerGraph graph and vector store → TigerGraph connections and schema: uses connection
- API application → MCP integrations: initializes clients (evidence: `graphrag/app/main.py`)
- API application → Logging and metrics: records requests (evidence: `graphrag/app/main.py`)
