msalemor / adventureworks-viewer-ai

A demo application to showcase adding intelligence to an application with different levels of complexity.
10 stars 4 forks source link

Adventureworks-AI-Viewer

Overview

A demo application to showcase adding intelligence to an application at different levels of complexity.

A screen capture of Advetureworks AI viewer showing getting data in differente modes.

Architecture

graph LR;
  A((User))<-->F(Frontend)
  F<-->B(Backend)
  B<--GptBot-->O(GPTBot)
  B<--SQLBot-->SQL(Sqbot)
  B<-->RAG
  B<--Assistants API Bot-->Asst(Assistants API Bot)
  B<--MultiagentBot-->M(Multiagent Bot<br/>Proxy Agent<br/>Semantic Processing)
  M<--Other or<br/>Unknown<br/>Intent-->O
  M<--SQL Scripts<br/>Intent-->SQL
  M<--Charts<br/>Intent-->Asst
  M<--RAG<br/>Intent-->RAG

Application Options

Selection Description
No AI A user can click on the icons to show the data on the table on the grid in the UI.
Chatbot A user can ask questions related to top customers and products.
RAG A user can ask questions about product information.
Sqlbot A user can ask the system to generate SQL statement. The SQL statements are then executed and presented on the grid in the UI.
Assistants API Bot A user can ask the system to perform complex data analysis related to top customers and top products and generate bars and charts.
Multiagent Bot This Bot will decide which agent to call (Chatbot, SQLbot or Assistant Bot based on the user's intent and will respond accordingly.

Requirements

Database

This app leverages the SQL Adventurework database data. However, additional views need to be deployed. You will need to:

A screen capture of Advetureworks AI viewer showing getting data in differente modes.

Backend - Python

Backend - C

Frontend - React

Debugging - Python

DB_HOST=<NAME>.database.windows.net
DB_PORT=1433
DB_USER=<ADMIN_USER>
DB_PASSWORD=<ADMIN_PASSWORD>
DB_DATABASE=<DB_NAME>

OPENAI_FULL_URI=https://<NAME>.openai.azure.com/openai/deployments/gpt4-1106-preview/chat/completions?api-version=2024-02-15-preview
OPENAI_URI=https://<NAME>.openai.azure.com/
OPENAI_KEY=<API_KEY>
OPENAI_GPT_DEPLOYMENT=gpt4-1106-preview
OPENAI_VERSION=2024-02-15-preview
OPENAPI_URL=/openapi.json

Debugging - C

DB_HOST=<NAME>.database.windows.net
DB_PORT=1433
DB_USER=<ADMIN_USER>
DB_PASSWORD=<ADMIN_PASSWORD>
DB_DATABASE=<DB_NAME>

OPENAI_FULL_URI=https://<NAME>.openai.azure.com/openai/deployments/gpt4-1106-preview/chat/completions?api-version=2024-02-15-preview
OPENAI_URI=https://<NAME>.openai.azure.com/
OPENAI_KEY=<API_KEY>
OPENAI_GPT_DEPLOYMENT=gpt4-1106-preview
OPENAI_VERSION=2024-02-15-preview
OPENAPI_URL=/openapi.json