Applied Sciences (Oct 2024)

LLM Based Chatbot for Farm-to-Fork Blockchain Traceability Platform

  • José Benzinho,
  • João Ferreira,
  • Joel Batista,
  • Leandro Pereira,
  • Marisa Maximiano,
  • Vítor Távora,
  • Ricardo Gomes,
  • Orlando Remédios

DOI
https://doi.org/10.3390/app14198856
Journal volume & issue
Vol. 14, no. 19
p. 8856

Abstract

Read online

Blockchain technology has been used with great effect in farm-to-fork traceability projects. However, this technology has a steep learning curve when it comes to its user interface. To minimize this difficulty, we created a solution based on a Large Language Model (LLM) conversational agent. Our implementation, starting with an existing knowledge base that is prepared and processed with an embedding model to be stored in a vector database, follows a Retrieval-Augmented Generation (RAG) approach. Other non-textual media like images and videos are aggregated with the embeddings to enrich the user experience. User queries are combined with a proximity search in the vector database and feed into an LLM that considers the conversation history with the user in its replies. Given the asynchronous nature of these models, we implemented a similarly asynchronous scheme using Server-Sent Events that deliver the models’ replies to a UI that supports multimodal media types such as images and videos by providing the visualization of these resources. The end solution allows users to interact with advanced technologies using a natural language interface; this in turn empowers food traceability projects to overcome their natural difficulty in engaging early adopters.

Keywords