# krishna-dhawangale/graphintel architecture

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

- Interactive diagram: https://gitdiagram.com/krishna-dhawangale/graphintel
- Repository: https://github.com/krishna-dhawangale/graphintel

## Overview

GraphIntel is a market-intelligence document platform: users upload research files, the backend parses and indexes them, and users query the resulting corpus for grounded answers with citations. The map also includes the documented dashboard, document inspection, graph, reporting, and administration surfaces. Provider and persistence details are shown at the abstraction level; some implementation paths are unsampled, so undocumented internal links are omitted.

Main entry points: [`backend/app/services/ingestion_service.py`](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/ingestion_service.py) (Ingestion service), [`frontend/src/lib/api.ts`](https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/lib/api.ts) (API client), [`backend/app/services/rag_service.py`](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/rag_service.py) (RAG orchestration), [`backend/app/api/v1/router.py`](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/router.py) (Versioned API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webui["Research workspace<br/>[page.tsx]"]
  node_docui["Document manager<br/>[page.tsx]"]
  node_inspectui["Chunk inspector<br/>[page.tsx]"]
  node_dashui["Dashboard and reports<br/>[page.tsx]"]
  node_graphui["Graph explorer<br/>[page.tsx]"]
  node_clientapi["API client<br/>[api.ts]"]
end

subgraph group_api["API and security"]
  node_server["FastAPI application<br/>[main.py]"]
  node_routes["Versioned API routes<br/>[router.py]"]
  node_auth["Authentication and access<br/>[auth.py]"]
  node_documents["Document endpoints<br/>[documents.py]"]
  node_queryapi["Query endpoints<br/>[query.py]"]
  node_core["Core configuration and telemetry"]
end

subgraph group_ingest["Document ingestion"]
  node_ingestsvc["Ingestion service"]
  node_parsers["Format parsers"]
  node_textchunk["Text processing and chunking<br/>[chunker.py]"]
  node_worker["Ingestion worker<br/>[async_worker.py]"]
end

subgraph group_research["Research and retrieval"]
  node_rag["RAG orchestration<br/>[rag_service.py]"]
  node_retrieval["Vector retrieval"]
  node_hybrid["Hybrid graph retrieval"]
  node_agent["Agent workflow<br/>[agent_service.py]"]
  node_graphsvc["Knowledge graph services<br/>[graph_service.py]"]
end

subgraph group_data["Providers and persistence"]
  node_llm["Language model provider<br/>[factory.py]"]
  node_embedding["Embedding provider<br/>[factory.py]"]
  node_vector[("Vector store<br/>[factory.py]")]
  node_objectstore[("Document storage<br/>[factory.py]")]
  node_db[("SQL database and models<br/>[session.py]")]
end

node_user(("Research user"))

node_user -->|"asks questions"| node_webui
node_user -->|"uploads documents"| node_docui
node_user -->|"views status"| node_dashui
node_user -->|"explores graph"| node_graphui
node_webui -->|"submits queries"| node_clientapi
node_docui -->|"manages files"| node_clientapi
node_inspectui -.->|"loads chunks"| node_clientapi
node_dashui -->|"loads metrics"| node_clientapi
node_graphui -->|"requests graph"| node_clientapi
node_clientapi -->|"calls HTTP API"| node_server
node_server -->|"mounts routes"| node_routes
node_routes -.->|"routes auth"| node_auth
node_routes -.->|"routes documents"| node_documents
node_routes -.->|"routes queries"| node_queryapi
node_documents -->|"delegates ingestion"| node_ingestsvc
node_ingestsvc -->|"selects parser"| node_parsers
node_ingestsvc -->|"chunks text"| node_textchunk
node_ingestsvc -->|"stores uploads"| node_objectstore
node_ingestsvc -->|"embeds chunks"| node_embedding
node_ingestsvc -->|"indexes chunks"| node_vector
node_ingestsvc -->|"records documents"| node_db
node_worker -->|"updates job state"| node_db
node_queryapi -->|"runs RAG query"| node_rag
node_queryapi -->|"runs agent query"| node_agent
node_rag -->|"retrieves vectors"| node_retrieval
node_rag -->|"retrieves hybrid evidence"| node_hybrid
node_retrieval -->|"embeds question"| node_embedding
node_retrieval -->|"searches chunks"| node_vector
node_rag -->|"generates answer"| node_llm
node_hybrid -.->|"uses graph evidence"| node_graphsvc
node_rag -->|"persists query and citations"| node_db
node_agent -->|"records query"| node_db
node_server -->|"configures middleware"| node_core

click node_webui "https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/chat/page.tsx"
click node_docui "https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/documents/page.tsx"
click node_inspectui "https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/documents/%5Bid%5D/page.tsx"
click node_dashui "https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/dashboard/page.tsx"
click node_graphui "https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/graph/page.tsx"
click node_clientapi "https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/lib/api.ts"
click node_server "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/main.py"
click node_routes "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/router.py"
click node_auth "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/auth.py"
click node_documents "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/documents.py"
click node_queryapi "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/query.py"
click node_ingestsvc "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/ingestion_service.py"
click node_parsers "https://github.com/krishna-dhawangale/graphintel/tree/main/backend/app/providers/parsers"
click node_textchunk "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/chunker.py"
click node_worker "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/workers/async_worker.py"
click node_rag "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/rag_service.py"
click node_retrieval "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/retrieval_service.py"
click node_hybrid "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/hybrid_retriever.py"
click node_agent "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/agent/agent_service.py"
click node_graphsvc "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/graph_service.py"
click node_llm "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/providers/llm/factory.py"
click node_embedding "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/providers/embeddings/factory.py"
click node_vector "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/providers/vector_store/factory.py"
click node_objectstore "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/providers/storage/factory.py"
click node_db "https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/db/session.py"
click node_core "https://github.com/krishna-dhawangale/graphintel/tree/main/backend/app/core"

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_webui,node_docui,node_inspectui,node_dashui,node_graphui,node_clientapi,node_user toneBlue
class node_server,node_routes,node_auth,node_documents,node_queryapi,node_core toneAmber
class node_ingestsvc,node_parsers,node_textchunk,node_worker toneMint
class node_rag,node_retrieval,node_hybrid,node_agent,node_graphsvc toneRose
class node_llm,node_embedding,node_vector,node_objectstore,node_db toneIndigo
```

## Components

### Web application

- [Research workspace](https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/chat/page.tsx): `frontend/src/app/chat/page.tsx`
- [Document manager](https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/documents/page.tsx): `frontend/src/app/documents/page.tsx`
- [Chunk inspector](https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/documents/%5Bid%5D/page.tsx): `frontend/src/app/documents/[id]/page.tsx`
- [Dashboard and reports](https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/dashboard/page.tsx): `frontend/src/app/dashboard/page.tsx`
- [Graph explorer](https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/app/graph/page.tsx): `frontend/src/app/graph/page.tsx`
- [API client](https://github.com/krishna-dhawangale/graphintel/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API and security

- [FastAPI application](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/main.py): `backend/app/main.py`
- [Versioned API routes](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Authentication and access](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/auth.py): `backend/app/api/v1/auth.py`
- [Document endpoints](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/documents.py): `backend/app/api/v1/documents.py`
- [Query endpoints](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/api/v1/query.py): `backend/app/api/v1/query.py`
- [Core configuration and telemetry](https://github.com/krishna-dhawangale/graphintel/tree/main/backend/app/core): `backend/app/core`

### Document ingestion

- [Ingestion service](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/ingestion_service.py): `backend/app/services/ingestion_service.py`
- [Format parsers](https://github.com/krishna-dhawangale/graphintel/tree/main/backend/app/providers/parsers): `backend/app/providers/parsers`
- [Text processing and chunking](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/chunker.py): `backend/app/services/chunker.py`
- [Ingestion worker](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/workers/async_worker.py): `backend/app/workers/async_worker.py`

### Research and retrieval

- [RAG orchestration](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/rag_service.py): `backend/app/services/rag_service.py`
- [Vector retrieval](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/retrieval_service.py): `backend/app/services/retrieval_service.py`
- [Hybrid graph retrieval](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/hybrid_retriever.py): `backend/app/services/hybrid_retriever.py`
- [Agent workflow](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/agent/agent_service.py): `backend/app/agent/agent_service.py`
- [Knowledge graph services](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/services/graph_service.py): `backend/app/services/graph_service.py`

### Providers and persistence

- [Language model provider](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/providers/llm/factory.py): `backend/app/providers/llm/factory.py`
- [Embedding provider](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/providers/embeddings/factory.py): `backend/app/providers/embeddings/factory.py`
- [Vector store](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/providers/vector_store/factory.py): `backend/app/providers/vector_store/factory.py`
- [Document storage](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/providers/storage/factory.py): `backend/app/providers/storage/factory.py`
- [SQL database and models](https://github.com/krishna-dhawangale/graphintel/blob/main/backend/app/db/session.py): `backend/app/db/session.py`

### Other components

- **Research user**

## Connections

- Research user → Research workspace: asks questions
- Research user → Document manager: uploads documents
- Research user → Dashboard and reports: views status
- Research user → Graph explorer: explores graph
- Research workspace → API client: submits queries (evidence: `frontend/src/app/chat/page.tsx`)
- Document manager → API client: manages files (evidence: `frontend/src/app/documents/page.tsx`)
- Chunk inspector → API client: loads chunks
- Dashboard and reports → API client: loads metrics (evidence: `frontend/src/app/dashboard/page.tsx`)
- Graph explorer → API client: requests graph (evidence: `frontend/src/app/graph/page.tsx`)
- API client → FastAPI application: calls HTTP API (evidence: `frontend/src/lib/api.ts`)
- FastAPI application → Versioned API routes: mounts routes (evidence: `backend/app/main.py`)
- Versioned API routes → Authentication and access: routes auth
- Versioned API routes → Document endpoints: routes documents
- Versioned API routes → Query endpoints: routes queries
- Document endpoints → Ingestion service: delegates ingestion (evidence: `backend/app/services/ingestion_service.py`)
- Ingestion service → Format parsers: selects parser (evidence: `backend/app/services/ingestion_service.py`)
- Ingestion service → Text processing and chunking: chunks text (evidence: `backend/app/services/ingestion_service.py`)
- Ingestion service → Document storage: stores uploads (evidence: `backend/app/services/ingestion_service.py`)
- Ingestion service → Embedding provider: embeds chunks (evidence: `backend/app/services/ingestion_service.py`)
- Ingestion service → Vector store: indexes chunks (evidence: `backend/app/services/ingestion_service.py`)
- Ingestion service → SQL database and models: records documents (evidence: `backend/app/services/ingestion_service.py`)
- Ingestion worker → SQL database and models: updates job state (evidence: `backend/app/workers/async_worker.py`)
- Query endpoints → RAG orchestration: runs RAG query (evidence: `backend/app/api/v1/query.py`)
- Query endpoints → Agent workflow: runs agent query (evidence: `backend/app/api/v1/query.py`)
- RAG orchestration → Vector retrieval: retrieves vectors (evidence: `backend/app/services/rag_service.py`)
- RAG orchestration → Hybrid graph retrieval: retrieves hybrid evidence (evidence: `backend/app/services/rag_service.py`)
- Vector retrieval → Embedding provider: embeds question (evidence: `backend/app/services/retrieval_service.py`)
- Vector retrieval → Vector store: searches chunks (evidence: `backend/app/services/retrieval_service.py`)
- RAG orchestration → Language model provider: generates answer (evidence: `backend/app/services/rag_service.py`)
- Hybrid graph retrieval → Knowledge graph services: uses graph evidence
- RAG orchestration → SQL database and models: persists query and citations (evidence: `backend/app/services/rag_service.py`)
- Agent workflow → SQL database and models: records query (evidence: `backend/app/agent/agent_service.py`)
- FastAPI application → Core configuration and telemetry: configures middleware (evidence: `backend/app/main.py`)
