Meal-planning assistant

Summary

Recipe discovery and conversational guidance for a food platform.

The platform needed to connect a recipe catalogue with user preferences and conversational meal-planning requests.

An assistant combining recipe retrieval, a fine-tuned Llama 3 model and GPT-3.5-based guidance, with APIs and cloud infrastructure for serving.

Tech Stack

  • Python
  • Rust
  • OpenAI
  • HuggingFace
  • PyTorch
  • Milvus
  • LangChain
  • Kafka
  • Kubernetes
  • AWS
  • Docker

Project workstreams

  1. 01

    2 weeks

    Solution Architecture Design

    Solution Architect

    AWS Cloud Infrastructure Setup

    DevOps
  2. 02

    4 weeks

    Development of Scraping and Parsing Tools

    System Engineer, NLP Engineer

    Data Cleaning & Preprocessing

    2x NLP Engineers
  3. 03

    8 weeks

    Agent Case-Specific Customization

    System Engineer, Data Engineer, NLP Engineer

    LLMs Finetuning

    2x NLP Engineers
  4. 04

    4 weeks

    Vector Search Use-Cases Optimization

    Data Engineer, NLP Engineer

    Integration, Testing & Deployment

    System Engineer, Data Engineer, NLP Engineer, Dev Ops

Tech Challenge

  • The primary challenge was integrating a diverse range of recipes and nutritional knowledge into a cohesive system. This involved structuring the data in a way that provided efficient retrieval and understanding by the AI assistant. Ensuring that the chat-bot could handle various types of queries, from ingredient substitutions to dietary restrictions, required robust data organization and retrieval mechanisms.

  • The project aimed to provide personalized recipe recommendations based on user preferences and nutritional goals. This required developing algorithms that could dynamically adjust recommendations based on user feedback and previous interactions. Ensuring that the assistant could adapt its suggestions over time to better align with user tastes and dietary needs posed a complex technical challenge.

  • As the client’s platform already included a substantial database of recipes and meal plans, scalability was a critical consideration. The AI assistant needed to handle a potentially large volume of user requests efficiently, ensuring quick response times and minimal latency. Scaling the system to accommodate growing user bases and increasing data volumes while maintaining performance standards was a continuous technical challenge.

  • Leveraging Milvus as a vector database for recipe embeddings presented both opportunities and challenges. Optimizing queries to retrieve relevant recipes based on ingredient similarity and nutritional content required fine-tuning the integration between Milvus and the AI assistant. Ensuring that retrieval times were minimized while maintaining accuracy in recipe recommendations was a key focus area.

Solution

  • Rust was used for API and serving components, while Python supported model training and experimentation. GGML provided a local-inference path, alongside the hosted-model components described in the project.
  • The AI assistant’s intelligence was enhanced through fine-tuning language models (LLMs) on a comprehensive knowledge base in collaboration with dietitians. We processed the provided books and scientific articles to compose the dataset of the relevant information. This approach ensured that the assistant could provide accurate and contextually correct nutritional advice and recipe recommendations tailored to individual user needs and preferences.

  • To enable quick and efficient retrieval of recipe and nutritional data, we established data pipelines that transformed and fed relevant information into Milvus and FAISS. These technologies facilitated optimized storage and retrieval of recipe embeddings, supporting personalized recommendations based on user preferences and dietary requirements.

  • Hosting LLMs presented infrastructure challenges, which were overcome by implementing dynamic load balancing and scaling strategies using Kubernetes (EKS) on AWS. This setup ensured the system could handle varying loads, from minimal usage periods to peak activity times, without compromising performance or user experience.

  • We integrated GGML for LLM inference and quantization, ensuring that the AI assistant could deliver accurate responses with minimal latency. This technological integration supported the system’s ability to adapt its knowledge base dynamically, incorporating updates such as new recipes or nutritional guidelines seamlessly into its recommendations.

Outcome

A meal-planning assistant built around the platform’s catalogue and dietitian-prepared material.

Published

DRL Team