# bharathmrr/agentic-graph-rag-as-a-service architecture

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

- Interactive diagram: https://gitdiagram.com/bharathmrr/agentic-graph-rag-as-a-service
- Repository: https://github.com/bharathmrr/agentic-graph-rag-as-a-service

## Overview

This is an Agentic Graph RAG platform: users upload documents, which are OCR-processed and transformed into ontology entities, deduplicated, embedded, and stored in graph and vector databases for visualization and retrieval-backed chat. The graph preserves the README’s major product branches, including multi-LLM support, query/ reasoning, and monitoring. Relationships are limited to calls shown in excerpts or workflow links documented in the README; several implementations are unsampled, so their internal connections are not inferred.

Main entry points: [`src/ingestion/pipeline_runner.py`](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/pipeline_runner.py) (Ingestion Orchestrator), [`backend/services/file_processing_pipeline.py`](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/services/file_processing_pipeline.py) (File Processing), [`src/retrieval/enhanced_agentic_retrieval.py`](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/retrieval/enhanced_agentic_retrieval.py) (Agentic Retrieval), [`frontend/src/components/ApplicationChatBot.jsx`](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/components/ApplicationChatBot.jsx) (AI Chat Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_app["Application UI<br/>[App.jsx]"]
  node_upload_ui["Document Upload"]
  node_visualization["Graph Visualization"]
  node_chat_ui["AI Chat Interface"]
end

subgraph group_ingestion["Document Ingestion"]
  node_api["API Application<br/>[main.py]"]
  node_upload_routes["Processing Routes"]
  node_file_pipeline["File Processing"]
  node_ocr["OCR Extraction<br/>[ocr_extractor.py]"]
  node_llm_service["LLM Service"]
end

subgraph group_knowledge["Knowledge Construction"]
  node_ontology["Ontology Generation"]
  node_resolution["Entity Resolution"]
  node_embeddings["Embedding Generation"]
  node_graph_builder["Graph Construction"]
  node_pipeline_runner["Ingestion Orchestrator<br/>[pipeline_runner.py]"]
  node_neo4j[("Neo4j Graph Store")]
  node_chroma[("ChromaDB Vector Store")]
end

subgraph group_query["Retrieval and Chat"]
  node_retrieval_routes["Retrieval Routes"]
  node_agentic_retrieval["Agentic Retrieval"]
  node_reasoning["Reasoning Stream"]
end

node_user(("User"))
node_external_llms{{"LLM Providers"}}

node_user -->|"uses"| node_app
node_app -->|"opens upload"| node_upload_ui
node_upload_ui -->|"submits documents"| node_upload_routes
node_upload_routes -->|"starts processing"| node_file_pipeline
node_file_pipeline -->|"extracts text"| node_ocr
node_file_pipeline -->|"requests AI processing"| node_llm_service
node_llm_service -->|"uses configured model"| node_external_llms
node_file_pipeline -->|"generates ontology"| node_ontology
node_pipeline_runner -->|"generates ontology"| node_ontology
node_pipeline_runner -->|"resolves entities"| node_resolution
node_pipeline_runner -->|"generates embeddings"| node_embeddings
node_pipeline_runner -->|"constructs graph"| node_graph_builder
node_ontology -->|"deduplicates entities"| node_resolution
node_resolution -->|"stores entities"| node_neo4j
node_embeddings -->|"stores vectors"| node_chroma
node_graph_builder -->|"writes graph"| node_neo4j
node_neo4j -->|"supplies graph data"| node_visualization
node_user -->|"asks questions"| node_chat_ui
node_chat_ui -->|"submits query"| node_retrieval_routes
node_retrieval_routes -.->|"routes retrieval"| node_agentic_retrieval
node_agentic_retrieval -->|"searches vectors"| node_chroma
node_agentic_retrieval -->|"traverses graph"| node_neo4j
node_agentic_retrieval -.->|"forms response"| node_reasoning
node_reasoning -->|"returns answer"| node_chat_ui

click node_app "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/App.jsx"
click node_upload_ui "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/components/EnhancedDocumentUpload.jsx"
click node_visualization "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/components/EnhancedKnowledgeGraph.jsx"
click node_chat_ui "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/components/ApplicationChatBot.jsx"
click node_api "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/api/main.py"
click node_upload_routes "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/routes/enhanced_processing_routes.py"
click node_file_pipeline "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/services/file_processing_pipeline.py"
click node_ocr "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/utils/ocr_extractor.py"
click node_llm_service "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/services/enhanced_llm_service.py"
click node_ontology "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/ontology_generator.py"
click node_resolution "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/entity_resolution.py"
click node_embeddings "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/embedding_generator.py"
click node_graph_builder "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/graph_constructor.py"
click node_pipeline_runner "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/pipeline_runner.py"
click node_retrieval_routes "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/api/routes/retrieval_routes.py"
click node_agentic_retrieval "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/retrieval/enhanced_agentic_retrieval.py"
click node_reasoning "https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/retrieval/enhanced_reasoning_stream.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_app,node_upload_ui,node_visualization,node_chat_ui,node_user toneBlue
class node_api,node_upload_routes,node_file_pipeline,node_ocr,node_llm_service toneAmber
class node_ontology,node_resolution,node_embeddings,node_graph_builder,node_pipeline_runner,node_neo4j,node_chroma toneMint
class node_retrieval_routes,node_agentic_retrieval,node_reasoning toneRose
class node_external_llms toneIndigo
```

## Components

### User Experience

- [Application UI](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Document Upload](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/components/EnhancedDocumentUpload.jsx): `frontend/src/components/EnhancedDocumentUpload.jsx`
- [Graph Visualization](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/components/EnhancedKnowledgeGraph.jsx): `frontend/src/components/EnhancedKnowledgeGraph.jsx`
- [AI Chat Interface](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/frontend/src/components/ApplicationChatBot.jsx): `frontend/src/components/ApplicationChatBot.jsx`

### Document Ingestion

- [API Application](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/api/main.py): `src/api/main.py`
- [Processing Routes](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/routes/enhanced_processing_routes.py): `backend/routes/enhanced_processing_routes.py`
- [File Processing](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/services/file_processing_pipeline.py): `backend/services/file_processing_pipeline.py`
- [OCR Extraction](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/utils/ocr_extractor.py): `backend/utils/ocr_extractor.py`
- [LLM Service](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/backend/services/enhanced_llm_service.py): `backend/services/enhanced_llm_service.py`

### Knowledge Construction

- [Ontology Generation](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/ontology_generator.py): `src/ingestion/ontology_generator.py`
- [Entity Resolution](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/entity_resolution.py): `src/ingestion/entity_resolution.py`
- [Embedding Generation](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/embedding_generator.py): `src/ingestion/embedding_generator.py`
- [Graph Construction](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/graph_constructor.py): `src/ingestion/graph_constructor.py`
- [Ingestion Orchestrator](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/ingestion/pipeline_runner.py): `src/ingestion/pipeline_runner.py`
- **Neo4j Graph Store**
- **ChromaDB Vector Store**

### Retrieval and Chat

- [Retrieval Routes](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/api/routes/retrieval_routes.py): `src/api/routes/retrieval_routes.py`
- [Agentic Retrieval](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/retrieval/enhanced_agentic_retrieval.py): `src/retrieval/enhanced_agentic_retrieval.py`
- [Reasoning Stream](https://github.com/bharathmrr/agentic-graph-rag-as-a-service/blob/main/src/retrieval/enhanced_reasoning_stream.py): `src/retrieval/enhanced_reasoning_stream.py`

### Other components

- **User**
- **LLM Providers**

## Connections

- User → Application UI: uses (evidence: `README.md`)
- Application UI → Document Upload: opens upload (evidence: `frontend/src/App.jsx`)
- Document Upload → Processing Routes: submits documents (evidence: `README.md`)
- Processing Routes → File Processing: starts processing (evidence: `backend/routes/enhanced_processing_routes.py`)
- File Processing → OCR Extraction: extracts text (evidence: `README.md`)
- File Processing → LLM Service: requests AI processing (evidence: `backend/services/file_processing_pipeline.py`)
- LLM Service → LLM Providers: uses configured model (evidence: `README.md`)
- File Processing → Ontology Generation: generates ontology (evidence: `README.md`)
- Ingestion Orchestrator → Ontology Generation: generates ontology (evidence: `src/ingestion/pipeline_runner.py`)
- Ingestion Orchestrator → Entity Resolution: resolves entities (evidence: `src/ingestion/pipeline_runner.py`)
- Ingestion Orchestrator → Embedding Generation: generates embeddings (evidence: `src/ingestion/pipeline_runner.py`)
- Ingestion Orchestrator → Graph Construction: constructs graph (evidence: `src/ingestion/pipeline_runner.py`)
- Ontology Generation → Entity Resolution: deduplicates entities (evidence: `README.md`)
- Entity Resolution → Neo4j Graph Store: stores entities (evidence: `README.md`)
- Embedding Generation → ChromaDB Vector Store: stores vectors (evidence: `README.md`)
- Graph Construction → Neo4j Graph Store: writes graph (evidence: `README.md`)
- Neo4j Graph Store → Graph Visualization: supplies graph data (evidence: `README.md`)
- User → AI Chat Interface: asks questions (evidence: `README.md`)
- AI Chat Interface → Retrieval Routes: submits query (evidence: `README.md`)
- Retrieval Routes → Agentic Retrieval: routes retrieval
- Agentic Retrieval → ChromaDB Vector Store: searches vectors (evidence: `README.md`)
- Agentic Retrieval → Neo4j Graph Store: traverses graph (evidence: `README.md`)
- Agentic Retrieval → Reasoning Stream: forms response
- Reasoning Stream → AI Chat Interface: returns answer (evidence: `README.md`)
