# dusisarathchandra/llm-rag-cloud-asset-service-categorization architecture

> Architecture diagram of the GitHub repository dusisarathchandra/llm-rag-cloud-asset-service-categorization, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization
- Repository: https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization

## Overview

This is a Streamlit RAG application that predicts cloud-service categories from asset descriptions. The main workflow is user query → hybrid LanceDB retrieval → prompt construction → LLM-generated category and service → displayed result; locally, users can submit feedback that is stored for monitoring. A separate ingestion path embeds the service catalog into LanceDB. The README also documents Elasticsearch search, Groq inference, and Grafana monitoring. Source excerpts show the LanceDB/Ollama path and feedback writes; other integration details are represented only where documented.

Main entry points: [`app.py`](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/app.py) (Streamlit app), [`src/lance_db.py`](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/src/lance_db.py) (LanceDB access), [`ingestion.py`](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/ingestion.py) (Catalog ingestion), [`retrieval.py`](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/retrieval.py) (Context retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["User application"]
  node_streamlit["Streamlit app<br/>[app.py]"]
end

subgraph group_rag["RAG processing"]
  node_retrieval["Context retrieval<br/>[retrieval.py]"]
  node_prompt["Prompt builder<br/>[building_prompt.py]"]
  node_model["LLM inference<br/>[app.py]"]
end

subgraph group_catalog["Catalog data"]
  node_ingestion["Catalog ingestion<br/>[ingestion.py]"]
  node_catalog_csv["Service catalog CSV"]
  node_embeddings["Embedding model<br/>[embeddings.py]"]
  node_lancedb_layer["LanceDB access<br/>[lance_db.py]"]
  node_vector_store[("Vector store<br/>[vector_db.lance]")]
end

subgraph group_ops["Feedback monitoring"]
  node_feedback["Feedback capture<br/>[app.py]"]
  node_postgres[("Feedback database")]
  node_grafana["Monitoring dashboard<br/>[my-dashboard.json]"]
end

node_user(("User"))
node_ollama["Ollama"]
node_groq["Groq API"]
node_elastic["Elasticsearch"]

node_user -->|"submits query"| node_streamlit
node_streamlit -->|"retrieves context"| node_retrieval
node_retrieval -->|"opens table"| node_lancedb_layer
node_lancedb_layer -->|"reads vectors"| node_vector_store
node_retrieval -.->|"searches index"| node_elastic
node_streamlit -->|"builds prompt"| node_prompt
node_streamlit -->|"requests inference"| node_model
node_model -->|"generates answer"| node_ollama
node_model -.->|"generates answer"| node_groq
node_streamlit -->|"displays result"| node_user
node_ingestion -->|"loads records"| node_catalog_csv
node_ingestion -->|"gets model"| node_embeddings
node_ingestion -->|"creates table"| node_lancedb_layer
node_lancedb_layer -->|"writes vectors"| node_vector_store
node_user -->|"rates result"| node_feedback
node_feedback -->|"writes feedback"| node_postgres
node_postgres -.->|"monitors feedback"| node_grafana

click node_streamlit "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/app.py"
click node_retrieval "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/retrieval.py"
click node_prompt "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/src/building_prompt.py"
click node_model "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/app.py"
click node_ingestion "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/ingestion.py"
click node_catalog_csv "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/data/Cloud_Provider_Services_Hashed.csv"
click node_embeddings "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/src/embeddings.py"
click node_lancedb_layer "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/src/lance_db.py"
click node_vector_store "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/tree/main/cloud_service_knowledge_base/vector_db/vector_db.lance"
click node_feedback "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/app.py"
click node_grafana "https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/grafana/dashboards/my-dashboard.json"

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_streamlit,node_user toneBlue
class node_retrieval,node_prompt,node_model toneAmber
class node_ingestion,node_catalog_csv,node_embeddings,node_lancedb_layer,node_vector_store,node_groq toneMint
class node_feedback,node_postgres,node_grafana toneRose
class node_ollama,node_elastic toneIndigo
```

## Components

### User application

- [Streamlit app](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/app.py): `app.py`

### RAG processing

- [Context retrieval](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/retrieval.py): `retrieval.py`
- [Prompt builder](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/src/building_prompt.py): `src/building_prompt.py`
- [LLM inference](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/app.py): `app.py`

### Catalog data

- [Catalog ingestion](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/ingestion.py): `ingestion.py`
- [Service catalog CSV](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/data/Cloud_Provider_Services_Hashed.csv): `data/Cloud_Provider_Services_Hashed.csv`
- [Embedding model](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/src/embeddings.py): `src/embeddings.py`
- [LanceDB access](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/src/lance_db.py): `src/lance_db.py`
- [Vector store](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/tree/main/cloud_service_knowledge_base/vector_db/vector_db.lance): `cloud_service_knowledge_base/vector_db/vector_db.lance`

### Feedback monitoring

- [Feedback capture](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/app.py): `app.py`
- **Feedback database**
- [Monitoring dashboard](https://github.com/dusisarathchandra/llm-rag-cloud-asset-service-categorization/blob/main/grafana/dashboards/my-dashboard.json): `grafana/dashboards/my-dashboard.json`

### Other components

- **User**
- **Ollama**
- **Groq API**
- **Elasticsearch**

## Connections

- User → Streamlit app: submits query
- Streamlit app → Context retrieval: retrieves context
- Context retrieval → LanceDB access: opens table
- LanceDB access → Vector store: reads vectors
- Context retrieval → Elasticsearch: searches index
- Streamlit app → Prompt builder: builds prompt
- Streamlit app → LLM inference: requests inference
- LLM inference → Ollama: generates answer
- LLM inference → Groq API: generates answer
- Streamlit app → User: displays result
- Catalog ingestion → Service catalog CSV: loads records
- Catalog ingestion → Embedding model: gets model
- Catalog ingestion → LanceDB access: creates table
- LanceDB access → Vector store: writes vectors
- User → Feedback capture: rates result
- Feedback capture → Feedback database: writes feedback
- Feedback database → Monitoring dashboard: monitors feedback
