Status: Proof of Concept · Presented: November 5, 2025 · Branch: users/prnag/chat-assistant-dev (repo https://github.com/EG-A-S/egu-partnerportal/tree/users/prnag/chat-assistant-dev) · Ticket[EGU-2282] Exploring AI Chat Assistant in Zynergy Partners - EG A/S

Author: Pragnya Nagure, Team Nova

Purpose of this page: Document what was built, explain the underlying RAG pattern, and serve as a reference for future chat/AI-assistant implementations in the platform.

1. Overview

Luma is an AI-powered chat assistant embedded in the Zynergy Partners Application that answers questions about work orders and platform features using natural language, in English, Danish, or Swedish. It combines live database queries, indexed documentation, and page-level context to generate grounded answers via Azure OpenAI (GPT-4o) — rather than relying on the model's general knowledge alone.

This was built as a proof of concept to validate the approach; it is not yet production hardened. The goal of this page is to capture both the concept (so teams can apply the same pattern) and the concrete implementation (so this POC can be extended rather than rebuilt from scratch).

2. Why This Matters

For users: instant answers instead of support tickets, natural-language search instead of filters, multilingual, available on every page.
For the business: deflects repetitive support requests, surfaces what users are actually struggling to find, and demonstrates a reusable pattern for adding AI assistance to other parts of the platform.

3. Concept: What is RAG?

Retrieval-Augmented Generation is the core pattern behind Luma, and the one worth reusing elsewhere:

This matters because it lets a general-purpose model like GPT-4o answer accurately about private, current data (this user's work orders, this platform's release notes) that it was never trained on.

The three data sources Luma retrieves from:

SourceWhat it isHow it's retrieved in this POC
Live DataWork order records, scoped by role/permissionsEF Core query against Azure SQL, reusing the existing IWorkOrderApiService
Static dataUser Manuals, release notes, FAQsIndexed in Azure AI Search, queried via keyword search
Frontend contextCurrent page/section the user is viewingPassed from the Blazor client on each request


4. Technical Architecture


Request flow:

  1. Chat Widget (Blazor, MudBlazor) → user sends a message → HttpClient.PostAsJsonAsync("api/chat", ...)
  2. ChatController → rate limiter (in-memory sliding window, 10 req/min/user) → OpenAIService
  3. OpenAIService orchestrates: detect language → load conversation history → build RAG context → build system prompt → call GPT-4o → persist turn → return response
  4. DataRetrievalService decides what to retrieve based on the query: work-order data, documentation, or page context - and enforces role-based filtering (ApplicationAdmin / GridAdmin / GridUser / ContractorAdmin / ContractorUser) before returning data
  5. Azure AI Search returns matching documentation chunks (keyword search over an index built from PDFs/release notes/manuals)
  6. Everything is assembled into a prompt and sent to Azure OpenAI; the response streams back as JSON and renders in the chat widget


5. Technology Stack


6. Feature Highlights (see recordings)

Each of these was demoed live on November 5, 2025:


7. POC Status & Known Limitations

Area

LimitationWhy it matters
AuthChat endpoint has no [Authorize]; UserId is client-supplied, not verified server-sideRole-based data filtering is real, but trusts a client-given ID - needs to read the user from the authenticated token instead. 
This chatbot implementation was done before the token authentication security implementation between services
SearchOnly keyword search is active; vector search is implemented but unusedSemantic/vector search would likely improve retrieval quality for natural-language queries
Session managementDELETE api/chat/session/{id} is a stubSessions can't actually be cleared yet
ScalabilityRate limiter & session store are in-memory onlyWon't work across multiple app instances; needs a distributed cache (e.g. Redis) before scaling out


8. Recommendations for Future Implementations

Takeaways for building similar AI features on this platform:

9. Appendix - API Reference

Method

RouteNotes
POSTapi/chat  Main chat endpoint
GETapi/chat/statusEnabled flag, limits, supported languages
DELETEapi/chat/session/{sessionId}Stub, not implemented
GETapi/chat/ratelimit/{userId}Remaining requests for a user


Config sections (in appsettings.Development.json): AzureOpenAI, AzureAISearch, ChatSettings - see repo for full key list.