# nandinisingh005/aichatbot architecture

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

- Interactive diagram: https://gitdiagram.com/nandinisingh005/aichatbot
- Repository: https://github.com/nandinisingh005/aichatbot

## Overview

This Quarkus chatbot ingests documents from MinIO into Elasticsearch vector storage, then answers browser questions using retrieval-augmented chat. The main flows are browser → WebSocket → chat service → retrieval and model, and startup ingestion → document loading/parsing → embeddings → vector storage. The README documents Granite or OpenAI as model options and OpenShift deployment; sampled source confirms the application flow but not all provider wiring.

Main entry points: [`gpt-java-chatbot-main/src/main/java/org/acme/chat/DocumentsIngestor.java`](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/DocumentsIngestor.java) (Startup ingestor), [`gpt-java-chatbot-main/src/main/java/org/acme/chat/SessionScopedChatBot.java`](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/SessionScopedChatBot.java) (Chat service), [`gpt-java-chatbot-main/src/main/java/org/acme/chat/ElasticAugmentor.java`](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/ElasticAugmentor.java) (Retrieval augmentor), [`gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioDocumentLoader.java`](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioDocumentLoader.java) (MinIO document loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Chat interface"]
  node_browser["Chat interface<br/>[websocket-chat.js]"]
  node_socket["WebSocket endpoint<br/>[ChatSocket.java]"]
end

subgraph group_rag["Chat and retrieval"]
  node_bot["Chat service"]
  node_augmentor["Retrieval augmentor"]
  node_embedding_model["Embedding model"]
end

subgraph group_ingestion["Document ingestion"]
  node_startup_ingestor["Startup ingestor"]
  node_loader["MinIO document loader"]
  node_source["Object source<br/>[MinioS3Source.java]"]
  node_minio_producer["MinIO client producer"]
end

subgraph group_integrations["External services"]
  node_embedding_store["Embedding store"]
  node_llm{{"LLM provider"}}
  node_minio[("MinIO storage")]
  node_elasticsearch[("Elasticsearch")]
end

node_user(("Chat user"))

node_user -->|"asks question"| node_browser
node_browser -->|"sends message"| node_socket
node_socket -->|"calls chat"| node_bot
node_bot -->|"retrieves context"| node_augmentor
node_bot -.->|"generates answer"| node_llm
node_augmentor -->|"embeds query"| node_embedding_model
node_augmentor -->|"searches vectors"| node_embedding_store
node_embedding_store -->|"reads vectors"| node_elasticsearch
node_startup_ingestor -->|"checks bucket"| node_minio
node_startup_ingestor -->|"loads documents"| node_loader
node_loader -->|"loads objects"| node_source
node_source -->|"fetches object"| node_minio
node_loader -->|"returns documents"| node_startup_ingestor
node_startup_ingestor -->|"creates embeddings"| node_embedding_model
node_startup_ingestor -->|"ingests vectors"| node_embedding_store
node_minio_producer -->|"creates client for"| node_minio

click node_browser "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/resources/META-INF/resources/websocket-chat.js"
click node_socket "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/ChatSocket.java"
click node_bot "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/SessionScopedChatBot.java"
click node_augmentor "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/ElasticAugmentor.java"
click node_embedding_model "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/EmbeddingModelProducer.java"
click node_embedding_store "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/ElasticEmbeddingStoreProducer.java"
click node_startup_ingestor "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/DocumentsIngestor.java"
click node_loader "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioDocumentLoader.java"
click node_source "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioS3Source.java"
click node_minio_producer "https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioClientProducer.java"

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_browser,node_socket,node_user toneBlue
class node_bot,node_augmentor,node_embedding_model toneAmber
class node_startup_ingestor,node_loader,node_source,node_minio_producer toneMint
class node_embedding_store,node_llm,node_minio,node_elasticsearch toneRose
```

## Components

### Chat interface

- [Chat interface](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/resources/META-INF/resources/websocket-chat.js): `gpt-java-chatbot-main/src/main/resources/META-INF/resources/websocket-chat.js`
- [WebSocket endpoint](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/ChatSocket.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/ChatSocket.java`

### Chat and retrieval

- [Chat service](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/SessionScopedChatBot.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/SessionScopedChatBot.java`
- [Retrieval augmentor](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/ElasticAugmentor.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/ElasticAugmentor.java`
- [Embedding model](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/EmbeddingModelProducer.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/EmbeddingModelProducer.java`

### Document ingestion

- [Startup ingestor](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/DocumentsIngestor.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/DocumentsIngestor.java`
- [MinIO document loader](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioDocumentLoader.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioDocumentLoader.java`
- [Object source](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioS3Source.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioS3Source.java`
- [MinIO client producer](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioClientProducer.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/minio/MinioClientProducer.java`

### External services

- [Embedding store](https://github.com/nandinisingh005/aichatbot/blob/main/gpt-java-chatbot-main/src/main/java/org/acme/chat/ElasticEmbeddingStoreProducer.java): `gpt-java-chatbot-main/src/main/java/org/acme/chat/ElasticEmbeddingStoreProducer.java`
- **LLM provider**
- **MinIO storage**
- **Elasticsearch**

### Other components

- **Chat user**

## Connections

- Chat user → Chat interface: asks question
- Chat interface → WebSocket endpoint: sends message
- WebSocket endpoint → Chat service: calls chat
- Chat service → Retrieval augmentor: retrieves context
- Chat service → LLM provider: generates answer
- Retrieval augmentor → Embedding model: embeds query
- Retrieval augmentor → Embedding store: searches vectors
- Embedding store → Elasticsearch: reads vectors
- Startup ingestor → MinIO storage: checks bucket
- Startup ingestor → MinIO document loader: loads documents
- MinIO document loader → Object source: loads objects
- Object source → MinIO storage: fetches object
- MinIO document loader → Startup ingestor: returns documents
- Startup ingestor → Embedding model: creates embeddings
- Startup ingestor → Embedding store: ingests vectors
- MinIO client producer → MinIO storage: creates client for
