/fabric-cosmosdb-chat-analytics

fabconeurope2024: Demo material and fabric notebooks to analyze chat history stored in a CosmosDB noSQL container

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

fabric-cosmosdb-chat-analytics

Microsft fabconeurope2024: Demo material and Fabric notebooks for analyzing chat history stored in CosmosDB NoSQL containers

Prerequisites

You need the following services to run this notebook.

You also need to upload chat_history and product catalog information to a Cosmos DB NoSQL database as separate containers.

  • dataset: a sample dataset is provided in the chat_history_data directory. The sample dataset is syntethically generated using gpt-4 mimicking user-chatbot interactions with an e-compercy company.
  • For CosmosDB mirroring, please follow the documentation.
  • For creating a shortcut of mirrored database, please follow the documentation.

Extracting insights

Goal: extract product feedback from chat history data.

drawing

Solution architecture

drawing

Steps

  1. Mirror chat history and product catalog data in Fabric OneLake. The data for product catalog is found in product_catalog directory and a sample data for chat_history data can be found in chat_history_data directory. Please use the chathistory_all.json.

  2. Create Shortcuts of chat history and product catalog into the Lakehouse

  3. Run the analyis Notebook

Navigate to the analysis_notebook directory. Open the main_demo notebook and attach the lakehouse and run the notebook. bonus: you may run the RAG notbebook to vectorize chat history and ask ad-hoc questions.

  1. Use semantic modeling and powerbi copilot to create a dashboard