Inspiration
We were inspired by the Wakefern HackRU challenge. Everybody on our team has busy lives, and often resorts to eating unhealthy junk food or eating out because it's easier than buying groceries. So, to encourage healthier diets for people, we wanted to make it an easier process to shop for groceries. No longer would be it a time-sink to shop for healthy food options.
What it does
Our web application creates grocery list suggestions for you based on your budget and dietary requirements, and helps you to choose healthy food products within your budget. No student wants the burden of worrying about budgeting their next meal, which is why it's important to have a way to get what you need without the hassle.
How we built it
Within our frontend, we ask the user to describe their dietary and budget needs in a text field using normal human language. This information is sent to the backend where we use Cloudflare's AI Workers to call the LLAMA 13B model to understand the requirements of user in a structured format and then represent this structured data into vector embeddings. These embeddings are then compared using KNN classifier to an already vectorized price and food options available from Wakefern's grocery item API. The vector search thus produces a list of items that adhere to the user's requirements, which are sent back to the frontend. We also have a robust authentication system powered by Auth0.
Challenges we ran into
We originally tried to use the Aceturnity UI library for our frontend, which required use of tailwind, but we ran into problems installing and using tailwind because none of us were experienced with it. Instead, we then migrated to use the MaterialUI React component library, and eventually migrated to use default React components. Auth0 was very difficult to implement as well, since the tutorials we found were outdated. Eventually, we understood how to make Auth0 work properly by adjusting our environment variables.
Our backend was where we faced the pain point with prompt engineering. When we were expecting a list of grocery items and prices in JSON, Cloudflare Models would either not provide JSON or ask further questions for clarity. We also had to limit the number of prompts and retries the model would try to prevent from running in a continuos never ending loop. We adjusted the prompts we used for machine learning and were able to make our program work as expected. Extracting items from Wakefern's API and store them as Vector embedding for accurate results was a hilly road but we overcame it with the power of Vectorization.
We were unable to complete all of the project's goals due to the time constraint, and at the moment our app only provides a list of grocery items available in the store by understanding users' natural language query
Accomplishments that we're proud of
Auth0 was difficult to make work, but now we can login through Google, Microsoft, Facebook, Github, or you can create a username and password, allowing flexibility in our app's use. Understanding Cloudflare's APIs and practically implementing them for our vector search functionality within Hackathon's timeframe.
What we learned
We learned how to use the LLM APIs working on the edge computing network for the first time, and Auth0 for security measures.
What's next for HackRU 2024
Built With
- auth0
- cloudfare
- flask
- javascript
- jupyter
- python
- react
- vite
- wakefern
Log in or sign up for Devpost to join the conversation.