# ghulam8586/genai-for-dotnet architecture

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

- Interactive diagram: https://gitdiagram.com/ghulam8586/genai-for-dotnet
- Repository: https://github.com/ghulam8586/genai-for-dotnet

## Overview

This repository is a .NET GenAI course collection rather than one integrated application. Its examples progress from chat and text analysis through tool calling, embeddings, vector search, document-grounded RAG, image analysis, and an Aspire-based semantic-search e-shop. The graph preserves these distinct learning/product branches. Some connections are documented capabilities rather than inspected calls; those are marked unverified, and the RAG and e-shop internals are only partially sampled.

Main entry points: [`final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs`](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs) (AI product search), [`final-project/end/eshop-microservices/WebApp/Program.cs`](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/WebApp/Program.cs) (Storefront), [`final-project/end/eshop-microservices/AppHost/Program.cs`](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/AppHost/Program.cs) (Aspire orchestration), [`genai-dotnet/ChatApp_RAG/Services/SemanticSearch.cs`](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ChatApp_RAG/Services/SemanticSearch.cs) (Semantic retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gen["GenAI examples"]
  node_text["Chat and text tasks<br/>[Program.cs]"]
  node_text_ollama["Local text tasks<br/>[Program.cs]"]
  node_functions["Function calling<br/>[Program.cs]"]
  node_embeddings["Embeddings<br/>[Program.cs]"]
  node_vectors["In-memory vector search<br/>[Program.cs]"]
  node_vectors_local["Local vector search<br/>[Program.cs]"]
  node_image["Image analysis<br/>[Program.cs]"]
  node_image_local["Local image analysis<br/>[Program.cs]"]
  node_traffic["Traffic extraction<br/>[Program.cs]"]
end

subgraph group_rag["RAG applications"]
  node_rag_ui["RAG chat interfaces<br/>[app.js]"]
  node_rag_ingest["Document ingestion<br/>[DataIngestor.cs]"]
  node_rag_search["Semantic retrieval<br/>[SemanticSearch.cs]"]
  node_rag_ollama["Ollama RAG app"]
  node_rag_qdrant["Qdrant RAG app"]
end

subgraph group_shop["Semantic e-shop"]
  node_webapp["Storefront<br/>[Program.cs]"]
  node_aspire["Aspire orchestration<br/>[Program.cs]"]
end

subgraph group_runtime["Shop services"]
  node_basket["Shopping basket<br/>[BasketService.cs]"]
  node_ordering["Order management<br/>[OrderService.cs]"]
  node_catalog["Product catalog API<br/>[ProductService.cs]"]
  node_ai_catalog["AI product search"]
  node_product_vectors["Product vector records<br/>[ProductVector.cs]"]
  node_catalog_db[("Catalog database")]
end

node_developer(("Developer or user"))
node_shop_user(("Shop customer"))
node_qdrant[("Qdrant vector store")]
node_models{{"AI model provider"}}

node_developer -->|"prompts"| node_text
node_developer -->|"prompts"| node_text_ollama
node_developer -->|"asks"| node_functions
node_functions -.->|"requests completion"| node_models
node_developer -->|"provides text"| node_embeddings
node_embeddings -.->|"generates vectors"| node_models
node_developer -->|"searches"| node_vectors
node_vectors -.->|"embeds query and records"| node_models
node_developer -.->|"searches"| node_vectors_local
node_developer -->|"provides image"| node_image
node_developer -->|"provides image"| node_image_local
node_developer -->|"submits camera images"| node_traffic
node_traffic -.->|"extracts fields"| node_models
node_developer -->|"asks questions"| node_rag_ui
node_rag_ingest -.->|"supplies documents"| node_rag_search
node_rag_ui -.->|"retrieves context"| node_rag_search
node_rag_search -.->|"grounds answers"| node_models
node_developer -->|"asks questions"| node_rag_ollama
node_developer -->|"asks questions"| node_rag_qdrant
node_shop_user -.->|"browses and checks out"| node_webapp
node_webapp -.->|"calls basket API"| node_basket
node_webapp -.->|"calls catalog API"| node_catalog
node_webapp -.->|"calls ordering API"| node_ordering
node_basket -.->|"submits checkout"| node_ordering
node_catalog -.->|"routes semantic search"| node_ai_catalog
node_ai_catalog -->|"reads products"| node_catalog_db
node_ai_catalog -->|"generates embeddings and replies"| node_models
node_ai_catalog -->|"builds vector records"| node_product_vectors
node_ai_catalog -->|"upserts and searches"| node_qdrant
node_aspire -.->|"runs services"| node_webapp
node_aspire -.->|"runs services"| node_catalog
node_aspire -.->|"runs services"| node_basket
node_aspire -.->|"runs services"| node_ordering

click node_text "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/TextCompletion/Program.cs"
click node_text_ollama "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/TextCompletion_Ollama/Program.cs"
click node_functions "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/FunctionCall/Program.cs"
click node_embeddings "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/Embeddings/Program.cs"
click node_vectors "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/VectorSearch/Program.cs"
click node_vectors_local "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/VectorSearch_Ollama/Program.cs"
click node_image "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ImageAnalysis/Program.cs"
click node_image_local "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ImageAnalysis_Ollama/Program.cs"
click node_traffic "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/TraficCamAnalysis/Program.cs"
click node_rag_ui "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ChatApp_RAG/wwwroot/app.js"
click node_rag_ingest "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ChatApp_RAG/Services/Ingestion/DataIngestor.cs"
click node_rag_search "https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ChatApp_RAG/Services/SemanticSearch.cs"
click node_rag_ollama "https://github.com/ghulam8586/genai-for-dotnet/tree/main/genai-dotnet/ChatApp_RAG_Ollama"
click node_rag_qdrant "https://github.com/ghulam8586/genai-for-dotnet/tree/main/genai-dotnet/ChatApp_RAG_Qdrant/ChatApp_RAG_Qdrant.Web"
click node_webapp "https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/WebApp/Program.cs"
click node_basket "https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Basket/Services/BasketService.cs"
click node_ordering "https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Ordering/Services/OrderService.cs"
click node_catalog "https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Services/ProductService.cs"
click node_ai_catalog "https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs"
click node_product_vectors "https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Models/ProductVector.cs"
click node_catalog_db "https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Data/CatalogDbContext.cs"
click node_aspire "https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/AppHost/Program.cs"

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_text,node_text_ollama,node_functions,node_embeddings,node_vectors,node_vectors_local,node_image,node_image_local,node_traffic,node_developer toneBlue
class node_rag_ui,node_rag_ingest,node_rag_search,node_rag_ollama,node_rag_qdrant,node_qdrant toneAmber
class node_webapp,node_aspire toneMint
class node_basket,node_ordering,node_catalog,node_ai_catalog,node_product_vectors,node_catalog_db toneRose
class node_shop_user,node_models toneIndigo
```

## Components

### GenAI examples

- [Chat and text tasks](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/TextCompletion/Program.cs): `genai-dotnet/TextCompletion/Program.cs`
- [Local text tasks](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/TextCompletion_Ollama/Program.cs): `genai-dotnet/TextCompletion_Ollama/Program.cs`
- [Function calling](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/FunctionCall/Program.cs): `genai-dotnet/FunctionCall/Program.cs`
- [Embeddings](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/Embeddings/Program.cs): `genai-dotnet/Embeddings/Program.cs`
- [In-memory vector search](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/VectorSearch/Program.cs): `genai-dotnet/VectorSearch/Program.cs`
- [Local vector search](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/VectorSearch_Ollama/Program.cs): `genai-dotnet/VectorSearch_Ollama/Program.cs`
- [Image analysis](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ImageAnalysis/Program.cs): `genai-dotnet/ImageAnalysis/Program.cs`
- [Local image analysis](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ImageAnalysis_Ollama/Program.cs): `genai-dotnet/ImageAnalysis_Ollama/Program.cs`
- [Traffic extraction](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/TraficCamAnalysis/Program.cs): `genai-dotnet/TraficCamAnalysis/Program.cs`

### RAG applications

- [RAG chat interfaces](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ChatApp_RAG/wwwroot/app.js): `genai-dotnet/ChatApp_RAG/wwwroot/app.js`
- [Document ingestion](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ChatApp_RAG/Services/Ingestion/DataIngestor.cs): `genai-dotnet/ChatApp_RAG/Services/Ingestion/DataIngestor.cs`
- [Semantic retrieval](https://github.com/ghulam8586/genai-for-dotnet/blob/main/genai-dotnet/ChatApp_RAG/Services/SemanticSearch.cs): `genai-dotnet/ChatApp_RAG/Services/SemanticSearch.cs`
- [Ollama RAG app](https://github.com/ghulam8586/genai-for-dotnet/tree/main/genai-dotnet/ChatApp_RAG_Ollama): `genai-dotnet/ChatApp_RAG_Ollama`
- [Qdrant RAG app](https://github.com/ghulam8586/genai-for-dotnet/tree/main/genai-dotnet/ChatApp_RAG_Qdrant/ChatApp_RAG_Qdrant.Web): `genai-dotnet/ChatApp_RAG_Qdrant/ChatApp_RAG_Qdrant.Web`

### Semantic e-shop

- [Storefront](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/WebApp/Program.cs): `final-project/end/eshop-microservices/WebApp/Program.cs`
- [Aspire orchestration](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/AppHost/Program.cs): `final-project/end/eshop-microservices/AppHost/Program.cs`

### Shop services

- [Shopping basket](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Basket/Services/BasketService.cs): `final-project/end/eshop-microservices/Basket/Services/BasketService.cs`
- [Order management](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Ordering/Services/OrderService.cs): `final-project/end/eshop-microservices/Ordering/Services/OrderService.cs`
- [Product catalog API](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Services/ProductService.cs): `final-project/end/eshop-microservices/Catalog/Services/ProductService.cs`
- [AI product search](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs): `final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs`
- [Product vector records](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Models/ProductVector.cs): `final-project/end/eshop-microservices/Catalog/Models/ProductVector.cs`
- [Catalog database](https://github.com/ghulam8586/genai-for-dotnet/blob/main/final-project/end/eshop-microservices/Catalog/Data/CatalogDbContext.cs): `final-project/end/eshop-microservices/Catalog/Data/CatalogDbContext.cs`

### Other components

- **Developer or user**
- **Shop customer**
- **Qdrant vector store**
- **AI model provider**

## Connections

- Developer or user → Chat and text tasks: prompts (evidence: `README.md`)
- Developer or user → Local text tasks: prompts (evidence: `README.md`)
- Developer or user → Function calling: asks (evidence: `genai-dotnet/FunctionCall/Program.cs`)
- Function calling → AI model provider: requests completion
- Developer or user → Embeddings: provides text (evidence: `genai-dotnet/Embeddings/Program.cs`)
- Embeddings → AI model provider: generates vectors
- Developer or user → In-memory vector search: searches (evidence: `genai-dotnet/VectorSearch/Program.cs`)
- In-memory vector search → AI model provider: embeds query and records
- Developer or user → Local vector search: searches
- Developer or user → Image analysis: provides image (evidence: `README.md`)
- Developer or user → Local image analysis: provides image (evidence: `README.md`)
- Developer or user → Traffic extraction: submits camera images (evidence: `genai-dotnet/TraficCamAnalysis/Program.cs`)
- Traffic extraction → AI model provider: extracts fields
- Developer or user → RAG chat interfaces: asks questions (evidence: `README.md`)
- Document ingestion → Semantic retrieval: supplies documents
- RAG chat interfaces → Semantic retrieval: retrieves context
- Semantic retrieval → AI model provider: grounds answers
- Developer or user → Ollama RAG app: asks questions (evidence: `README.md`)
- Developer or user → Qdrant RAG app: asks questions (evidence: `README.md`)
- Shop customer → Storefront: browses and checks out
- Storefront → Shopping basket: calls basket API
- Storefront → Product catalog API: calls catalog API
- Storefront → Order management: calls ordering API
- Shopping basket → Order management: submits checkout
- Product catalog API → AI product search: routes semantic search
- AI product search → Catalog database: reads products (evidence: `final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs`)
- AI product search → AI model provider: generates embeddings and replies (evidence: `final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs`)
- AI product search → Product vector records: builds vector records (evidence: `final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs`)
- AI product search → Qdrant vector store: upserts and searches (evidence: `final-project/end/eshop-microservices/Catalog/Services/ProductAIService.cs`)
- Aspire orchestration → Storefront: runs services
- Aspire orchestration → Product catalog API: runs services
- Aspire orchestration → Shopping basket: runs services
- Aspire orchestration → Order management: runs services
