# priyanshtech/konvert-ai- architecture

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

- Interactive diagram: https://gitdiagram.com/priyanshtech/konvert-ai-
- Repository: https://github.com/priyanshtech/konvert-ai-

## Overview

ai-chat is a multi-tenant AI support product: teams manage bots and knowledge, while visitors chat through an embeddable widget. The backend routes authentication, bot management, knowledge ingestion, chat, and reporting; ingestion parses content and creates embeddings, while chat retrieves relevant chunks and streams generated answers. The frontend includes bot, knowledge, conversation, lead, analytics, and simulator screens. README provides no further product detail. Some UI-to-API wiring and unsampled subsystem internals are not evidenced, so those links are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/main.py) (API application), [`backend/app/workers/ingestion_worker.py`](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/workers/ingestion_worker.py) (Ingestion worker), [`backend/app/models/models.py`](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/models/models.py) (Domain models), [`backend/app/api/auth.py`](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/auth.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web and Widget"]
  node_web["Team workspace"]
  node_widget["Embeddable widget<br/>[widget.js]"]
end

subgraph group_api["Backend API"]
  node_main["API application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_bots["Bot management<br/>[bots.py]"]
  node_chat["Chat endpoint<br/>[chat.py]"]
  node_dashboard["Reporting API<br/>[dashboard.py]"]
  node_knowledge_api["Knowledge API<br/>[knowledge.py]"]
  node_widget_api["Widget API<br/>[widget.py]"]
end

subgraph group_knowledge["Knowledge and Retrieval"]
  node_parser["Document parsing<br/>[document_parser.py]"]
  node_ingestion["Ingestion worker"]
  node_embedding["Embedding service<br/>[embedding.py]"]
  node_rag["RAG engine<br/>[rag_engine.py]"]
end

subgraph group_platform["Identity and Data"]
  node_security["Access security<br/>[security.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_database[("Application database<br/>[database.py]")]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_team(("Support team"))
node_visitor(("Chat visitor"))
node_redis["Redis queue"]
node_ai["AI provider"]

node_main -->|"registers"| node_auth
node_main -->|"registers"| node_bots
node_main -->|"registers"| node_chat
node_main -->|"registers"| node_dashboard
node_main -->|"registers"| node_knowledge_api
node_main -->|"registers"| node_widget_api
node_auth -->|"uses"| node_security
node_auth -->|"queries"| node_models
node_auth -->|"uses"| node_database
node_bots -->|"uses"| node_security
node_bots -->|"queries"| node_models
node_bots -->|"uses"| node_database
node_chat -->|"invokes"| node_rag
node_chat -->|"uses"| node_security
node_chat -->|"queries"| node_models
node_dashboard -->|"uses"| node_security
node_dashboard -->|"queries"| node_models
node_knowledge_api -->|"queues jobs"| node_ingestion
node_ingestion -->|"parses content"| node_parser
node_ingestion -->|"embeds chunks"| node_embedding
node_ingestion -->|"writes records"| node_models
node_ingestion -->|"enqueues jobs"| node_redis
node_rag -->|"embeds queries"| node_embedding
node_rag -->|"requests completions"| node_ai
node_embedding -->|"requests vectors"| node_ai
node_team -.->|"uses"| node_web
node_visitor -.->|"chats through"| node_widget

click node_main "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/main.py"
click node_auth "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/auth.py"
click node_bots "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/bots.py"
click node_chat "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/chat.py"
click node_dashboard "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/dashboard.py"
click node_knowledge_api "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/knowledge.py"
click node_widget_api "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/widget.py"
click node_parser "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/services/document_parser.py"
click node_ingestion "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/workers/ingestion_worker.py"
click node_embedding "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/services/embedding.py"
click node_rag "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/services/rag_engine.py"
click node_security "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/core/security.py"
click node_models "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/models/models.py"
click node_database "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/core/database.py"
click node_config "https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/core/config.py"
click node_web "https://github.com/priyanshtech/konvert-ai-/tree/main/frontend/src/app"
click node_widget "https://github.com/priyanshtech/konvert-ai-/blob/main/frontend/public/widget.js"

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_web,node_widget toneBlue
class node_main,node_auth,node_bots,node_chat,node_dashboard,node_knowledge_api,node_widget_api,node_redis toneAmber
class node_parser,node_ingestion,node_embedding,node_rag toneMint
class node_security,node_models,node_database,node_config toneRose
class node_team,node_visitor,node_ai toneIndigo
```

## Components

### Web and Widget

- [Team workspace](https://github.com/priyanshtech/konvert-ai-/tree/main/frontend/src/app): `frontend/src/app`
- [Embeddable widget](https://github.com/priyanshtech/konvert-ai-/blob/main/frontend/public/widget.js): `frontend/public/widget.js`

### Backend API

- [API application](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Bot management](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/bots.py): `backend/app/api/bots.py`
- [Chat endpoint](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [Reporting API](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/dashboard.py): `backend/app/api/dashboard.py`
- [Knowledge API](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/knowledge.py): `backend/app/api/knowledge.py`
- [Widget API](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/api/widget.py): `backend/app/api/widget.py`

### Knowledge and Retrieval

- [Document parsing](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/services/document_parser.py): `backend/app/services/document_parser.py`
- [Ingestion worker](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/workers/ingestion_worker.py): `backend/app/workers/ingestion_worker.py`
- [Embedding service](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/services/embedding.py): `backend/app/services/embedding.py`
- [RAG engine](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/services/rag_engine.py): `backend/app/services/rag_engine.py`

### Identity and Data

- [Access security](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [Domain models](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/models/models.py): `backend/app/models/models.py`
- [Application database](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [Runtime configuration](https://github.com/priyanshtech/konvert-ai-/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Other components

- **Support team**
- **Chat visitor**
- **Redis queue**
- **AI provider**

## Connections

- API application → Authentication: registers (evidence: `backend/app/main.py`)
- API application → Bot management: registers (evidence: `backend/app/main.py`)
- API application → Chat endpoint: registers (evidence: `backend/app/main.py`)
- API application → Reporting API: registers (evidence: `backend/app/main.py`)
- API application → Knowledge API: registers (evidence: `backend/app/main.py`)
- API application → Widget API: registers (evidence: `backend/app/main.py`)
- Authentication → Access security: uses (evidence: `backend/app/api/auth.py`)
- Authentication → Domain models: queries (evidence: `backend/app/api/auth.py`)
- Authentication → Application database: uses (evidence: `backend/app/api/auth.py`)
- Bot management → Access security: uses (evidence: `backend/app/api/bots.py`)
- Bot management → Domain models: queries (evidence: `backend/app/api/bots.py`)
- Bot management → Application database: uses (evidence: `backend/app/api/bots.py`)
- Chat endpoint → RAG engine: invokes (evidence: `backend/app/api/chat.py`)
- Chat endpoint → Access security: uses (evidence: `backend/app/api/chat.py`)
- Chat endpoint → Domain models: queries (evidence: `backend/app/api/chat.py`)
- Reporting API → Access security: uses (evidence: `backend/app/api/dashboard.py`)
- Reporting API → Domain models: queries (evidence: `backend/app/api/dashboard.py`)
- Knowledge API → Ingestion worker: queues jobs (evidence: `backend/app/api/knowledge.py`)
- Ingestion worker → Document parsing: parses content (evidence: `backend/app/workers/ingestion_worker.py`)
- Ingestion worker → Embedding service: embeds chunks (evidence: `backend/app/workers/ingestion_worker.py`)
- Ingestion worker → Domain models: writes records (evidence: `backend/app/workers/ingestion_worker.py`)
- Ingestion worker → Redis queue: enqueues jobs (evidence: `backend/app/workers/ingestion_worker.py`)
- RAG engine → Embedding service: embeds queries (evidence: `backend/app/services/rag_engine.py`)
- RAG engine → AI provider: requests completions (evidence: `backend/app/services/rag_engine.py`)
- Embedding service → AI provider: requests vectors (evidence: `backend/app/services/embedding.py`)
- Support team → Team workspace: uses
- Chat visitor → Embeddable widget: chats through
