Skip to content

This repository represents a set of detailed prompt engineering examples using Retrieval-Augmented Generation (RAG) for four supply chain challenges in food production sector

Notifications You must be signed in to change notification settings

SK-SCMLab/Prompt-library-for-AI-using-RAG-technique-in-Food-production-sector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

πŸŒͺ Prompt-library-for-AI-using-RAG-in-Food-production-sector

This repository represents a set of detailed prompt engineering examples using Retrieval-Augmented Generation (RAG) for four supply chain challenges in food production sector namely:

  1. Inefficient sales forecast
  2. Demand-supply fulfillment
  3. Invisible stock transport orders (STO)
  4. Longer lead times

🌎 Retrieval Augmented Generation (RAG)

It is a prompting technique that supplies domain-relevant data as context to produce responses based on that data and the prompt. This technique is similar to fine-tuning. However, rather than having to fine-tune a Foundation model (FM) with a small set of labelled examples, RAG retrieves a small set of relevant documents from a large corpus and uses that to provide context to answer the questions. RAG will not change the weights of the foundation model whereas fine-tuning will change model weights. This approach can be more cost efficient than regular fine-tuning because RAG approach does not incur the cost of fine-tuning a model. RAG also addresses the challenge of frequent data changes because it retrieves updated and relevant information instead of relying on potentially outdated sets of data. In RAG, the external data can come from multiple data sources, such as a document repository, databases, or APIs. Before using RAG with Large Language Models (LLM) you must prepare and keep the knowledge base updated.


🐾 Prompt 1: Inefficient Sales forecast

Introduction

Utilize RAG to refine sales forecasting by extracting patterns from historical sales, promotions, and external events

Context

The food manufacturer struggles with sales forecast accuracy due to seasonality, promotions, and shelf-life constraints

Input

"Retrieve sales data, promotional activity, and external market events from the database and use this context:

  • Sales data: [Last 2 years SKU-wise sales by week]
  • Promotional activity: [List of promotions, discounts, campaign details]
  • Market events: [Holidays, Festivals, climate data impacting demand]"

Output Indicator

  • SKU-wise forecast for the next 12 weeks
  • Graph of anticipated demand vs actual trend
  • List of external events impacting sales
  • Suggestions for adjustment or contingency planning

β›ˆ Prompt 2: Demand-Supply fulfillment

Introduction

Use RAG to align supply with demand by extracting constraints, SKU-wise available stock, and historical lead time

Context

A food production company faces delays and penalties due to mismatched supply and demand

Input

"Retrieve:

  • [SKU-wise available inventory and batch status]
  • [Historical order delays]
  • [Current open order status]
  • [Lead time data]"

Output indicator

  • List of SKU-wise delays and shortages
  • Suggested production and allocation priorities
  • Risk of penalties by SKU and customer
  • Lead time adjustment recommendations

🌳 Prompt 3: Invisible Stock Transport Order (STO)

Introduction

Utilize RAG to provide visibility across warehouses, making in-transit shipments actionable for planning

Context

A food manufacturer operates multiple warehouses and plants, making it challenging to track in-transit stock required for fulfillment

Input

"Retrieve:

  • [All open STOs across warehouses]
  • [Current in-transit quantity by SKU]
  • [ETA for each transport order]"

Output indicator

  • Consolidated view of available and in-transit inventory
  • Suggested reallocation/reschueduling of shipments
  • Impact assessment for open sales orders
  • Visibility of potential delays across warehouses

πŸ„ Prompt 4: Longer Lead times

Introduction

Use RAG to compare lead times across suppliers and plants, extracting actionable recommendations for lead-time optimization

Context

A food manufacturer faces longer lead times due to fragmented sourcing and delays across its supply chain

Input

"Retrieve:

  • [Lead times across suppliers and plants]
  • [Current order status and delays]
  • [Historical lead times vs actual performance]

Output indicator

  • List of bottleneck suppliers/plants and associated delays
  • SKU-wise recommendations for lead-time optimization
  • Suggested alternation between suppliers/plants
  • Simulations of benefits from reducing lead times

πŸ“ Functionalities used

  • Foundations of Prompt Engineering
  • FMCG sector challenges

"Prompt Engineering is the bridge between human thought and machine understanding"

About

This repository represents a set of detailed prompt engineering examples using Retrieval-Augmented Generation (RAG) for four supply chain challenges in food production sector

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published