Skip to content

debugnlift07/SKF.ProductAssistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SKF Product Assistant (Mini)

A lightweight AI-powered product assistant built using C#, Azure Functions, Microsoft Semantic Kernel, Azure OpenAI, and Redis. The system answers natural‑language questions about SKF bearing attributes using local JSON datasheets while maintaining conversation context and capturing user feedback.

Architecture Overview

User Request
     ↓
Azure Function HTTP Endpoint
     ↓
Intent Orchestrator (Semantic Kernel)
     ↓
 ┌───────────────┬────────────────┐
 │               │                │
Q&A Agent     Feedback Agent
 │               │
Redis Cache     Redis Feedback Store
 │
JSON Datasheets (authoritative source)
 │
Conversation State (in-memory)

Components

  • Azure Function: Single HTTP endpoint used to receive user messages.
  • Intent Orchestrator: Uses Semantic Kernel + Azure OpenAI to classify requests (Question / Feedback).
  • Q&A Agent: Extracts product + attribute, checks Redis cache, reads JSON datasheets if needed.
  • Feedback Agent: Captures user corrections and stores them in Redis.
  • Conversation State: Maintains last product, attribute, and answer.

How to Run

1. Clone Repository

git clone <repo-url>
cd SKF.ProductAssistant

2. Install Dependencies

dotnet restore

3. Run Azure Function

func start

4. Test API

POST http://localhost:7071/api/AskProduct

Required Environment Variables

Add one local.settings.json
{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"AOAI_ENDPOINT": "https://developer-***-foundry.*****.azure.com/",
"AOAI_DEPLOYMENT": "****************************",
"AOAI_API_KEY": "****",
"REDIS_CONNECTION": " **********"

} }

Caching Strategy

User Question
   ↓
Redis Cache Check
   ↓
Cache HIT → return answer
Cache MISS → JSON lookup
   ↓
Save answer to Redis

Hallucination Reduction

  • Answers only generated from local JSON datasheets.
  • LLM used only for extraction and classification.
  • If data not found → system abstains.

Example Interactions

Q: What is the width of 6205?
A: The width of the 6205 bearing is 15 mm.

Q: And what about its diameter?
A: The diameter of the 6205 bearing is 52 mm.

Q: That last width is wrong—store my correction: 6205 width 15 mm.
A: Thanks—your feedback for 6205 / width has been saved.

Q: Diameter for 9999?
A: Sorry, I can’t find that information for ‘9999’.

Technologies Used

  • C# / .NET 8
  • Azure Functions
  • Microsoft Semantic Kernel
  • Azure OpenAI
  • Redis Cache
  • Newtonsoft.Json

About

AI Product Assistant built with C#, Azure Functions, Semantic Kernel, Azure OpenAI and Redis caching.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages