Andrés Meza Escallón Head of AI at Grydd, Inc.
Systems Engineer/CS and Master in Communicationwith 30 years of experience leading web software development and applying machine learning/AI
to drive innovation, leveraging diverse technologies
and clear communication across technical
and non-technical audiences.
In a previous post we discussed what are Large Language Models (LLM), the engines behind Generative AI, and today we will talk about how to harness the power of GenAI implementing Retrieval Augmented Generation systems.
We can think of these LLMs as a smart intern, fresh from college, eager to help using her theoretical knowledge despite her lack of practical experience. If you ask the intern on her first day to answer the phones or process incoming orders from your customers, she will likely do a poor job because the best practices learned in college can only take her so far. But if you give her the internal phonebook, she will know to whom the next call should be directed. If she can look at your standard operating procedures, she will be able to process a basic order. If she can read the status of a shipment, she will be able to provide actionable feedback to a customer when asked. See the pattern?
Enter Retrieval Augmented Generation (RAG)
With LLMs, we can do the same as with the intern, providing the model with the specific context for a specific situation. This way, we harness the inherent power of the LLM to grasp context, syntax, and semantics to generate coherent and contextually relevant responses. That is what Retrieval Augmented Generation or RAG is about.
RAG systems use a Retriever to get only the relevant information from available data sources. Then, the Augment process integrates the retrieved data with the query from the user. Finally, the Generation process uses the LLM to generate relevant responses to the user query.
For example, the Retriever in a RAG system can feed an LLM your dietary restrictions (gluten free, keto, 500 calories, etc.) and a restaurant’s menu. When you ask it for recommendations, it will pull up the items on the menu that fit your individual criteria. This is what Vistry.ai is doing with LLM/RAG.
Another example is Assembly’s intranet solution that feeds HR policies, procedures and other employee-related documents to a RAG-powered system called Dora AI. This way, when an employee ask a question in the intranet, DoraAI is able to answer accurately and providing a link to the source document.
Application in Supply Chain
- Examples of RAG in Supply Chain
- Compliance Checks: Retrieve the customs regulations and procedures of the destination country to check whether the paperwork is compliant.
- Customer Preferences: Retrieve the history of past shipments by the same customer to identify preferences and offer them as default choices.
- Risk Alerts: Retrieve the latest updates about the Panama Canal from reliable news outlets to alert about potential risks of delays.
- Benefits of RAG Systems
- Bridge Knowledge Gaps: RAG systems enable LLMs to handle and respond accurately to domain-specific queries by retrieving specific data not available during initial training.
- Improve Relevance: RAG systems help keep responses concise and on point by filtering out unnecessary information and focusing on the query.
- Reduce Hallucinations: By providing factual data, RAG systems prevent LLMs from making guesses or providing made-up answers.
- Efficiency: Filtering only relevant data significantly reduces the cost of using an LLM, which depends on how many tokens are used to provide context.