microsoft / RAG_Hack

Hack Together: RAG Hack | Register, Learn, Hack
MIT License
402 stars 84 forks source link

Project: MyFitnessBuddy - AI powered Fitness Assistant [RAGHack] #145

Open JeevaSaravanan opened 2 months ago

JeevaSaravanan commented 2 months ago

Project Name

MyFitnessBuddy - AI powered Fitness Assistant

Description

RagHack - GenAI Fitness Advisor App

Problem Definition:

banner

  1. Personalized Fitness Guidance: MyFitnessBuddy is a GenAI Fitness Advisor App that provides customized workout routines, diet plans, and a food calorie calculator, addressing the limitations of generic fitness apps.

  2. Advanced Retrieval-Augmented Generation: It leverages a hybrid approach combining Retrieval-Augmented Generation (RAG) and Graph Retrieval-Augmented Generation (GRAG) to deliver accurate and context-aware responses to user queries.

  3. Showcasing Innovation at RAGHack: Developed for the RAGHack hackathon, MyFitnessBuddy demonstrates the power of RAG technologies in creating engaging and effective AI-driven fitness solutions using Azure AI and popular frameworks.

Architecture and Implementation:

Architecture Overview:

alt text

Fig.1 Architecture

MyFitnessBuddy uses a hybrid architecture combining Retrieval-Augmented Generation (RAG) and Graph Retrieval-Augmented Generation (GRAG). Data is extracted using a Python script and ingested into Azure Blob Storage for structured data and Azure Cosmos DB (Gremlin API) for unstructured data. Azure AI Search indexes the structured data, while the graph database manages complex relationships in the unstructured data. The application utilizes Azure AI Studio and Prompt Flow to define chat logic and connect data sources. User queries are processed by the app server, retrieving relevant information from Azure AI Search and Cosmos DB, which is then sent to Azure OpenAI Services (ChatGPT) to generate personalized responses. This hybrid approach ensures accurate, context-aware, and personalized fitness guidance for users.

Implementation Overview:

Data Extraction and Ingestion:

ArchitectureGraphRag

Fig 2. Data Extraction Architecture

Hybrid RAG Approach:

ArchitectureGraphRag

Fig 3. Hybrid RAG Architecture

AzureCosmoDB AzureCosmoDB

Fig 4. Example of how Unstructured Data is stored as Graph in Azure CosmoDB(Gremlin API)

Azure AI Studio:

AzureCosmoDB

Fig 5. Azure AI Studio Architecture

Prompt Flow

We deployed two endpoints using Azure Prompt Flow. One is a rewrite intent endpoint, and the other is a My Fitness Buddy. These endpoints are designed to solve two different use cases: one focuses on optimizing document retrieval through query generation, while the other offers personalized fitness advice within predefined safe boundaries with the knowledge base of the RAG.

1. Rewrite Intent Endpoint

Purpose: This endpoint was designed to handle a specific task: generating search queries based on a user's question and previous conversation history. By combining the "current user question" and prior context, the endpoint generates a single canonical query that includes all necessary details, without variants. This is employed for document retrieval systems, where generating these precise queries and intent leading to more accurate results.

rewrite intent

Fig 6. Flow of Rewrite Intent endpoint

2. My Fitness Buddy endpoint

Purpose: The second endpoint is a My Fitness Buddy that offers personalized fitness advice, workout plans, and nutrition tips based on user input. The assistant is programmed to avoid medical advice and stick solely to the provided dataset to ensure that all recommendations are safe, motivational, and evidence-based and the knowledge base is retreived for the chuncks of documents configured as search indexes.

rewite intent

Fig 7. Flow of My Fitness Buddy endpoint

Application Flow:

Application Application Application Application Application Application

Fig 8. Application

Application

Fig 9. Testing tool for endpoints

Technologies Used:

Target Audience:

Conclusion and Future Works:

Conclusion

MyFitnessBuddy demonstrates the potential of combining advanced AI techniques like Retrieval-Augmented Generation (RAG) and Graph Retrieval-Augmented Generation (GRAG) to create a highly personalized and context-aware fitness advisor. By leveraging Azure AI's capabilities and integrating multiple data sources, the app provides customized workout routines, dietary plans, and accurate responses to user queries. This approach enhances user engagement and satisfaction by delivering tailored and relevant fitness guidance.

Future Work

Developers:

Rohan Ponramesh Jeeva Saravana Bhavanandam

Technology & Languages

Project Repository URL

https://github.com/rohanramesh38/RagHack/tree/main

Deployed Endpoint URL

No response

Project Video

https://www.youtube.com/watch?v=qELr2ZOh-GU

Team Members

@JeevaSaravanan [sarava25@msu.edu] , @rohanramesh38 [ponrames@msu.edu]

jeremiah-louis commented 2 months ago

Really love you guy's entries goodluck ✨

JeevaSaravanan commented 2 months ago

Really love you guy's entries goodluck ✨

Thanks

jeremiah-louis commented 2 months ago

You're welcome. I also dropped a follow

jaydestro commented 2 months ago

@JeevaSaravanan do you have a deployed version I can demo?

rohanramesh38 commented 2 months ago

@JeevaSaravanan do you have a deployed version I can demo?

To minimize costs and API usage, we chose not to deploy it publicly. Feel free to send me an email, and we can arrange a private demo if that works for you.

multispark commented 1 month ago

Hello @JeevaSaravanan, thank you for participating in RAG Hack!

The team is working hard to distribute badges. Please have each team member fill out this form: aka.ms/raghack/badge-dist

Thank you!