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:
- Inefficient sales forecast
- Demand-supply fulfillment
- Invisible stock transport orders (STO)
- Longer lead times
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.
Utilize RAG to refine sales forecasting by extracting patterns from historical sales, promotions, and external events
The food manufacturer struggles with sales forecast accuracy due to seasonality, promotions, and shelf-life constraints
"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]"
- 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
Use RAG to align supply with demand by extracting constraints, SKU-wise available stock, and historical lead time
A food production company faces delays and penalties due to mismatched supply and demand
"Retrieve:
- [SKU-wise available inventory and batch status]
- [Historical order delays]
- [Current open order status]
- [Lead time data]"
- List of SKU-wise delays and shortages
- Suggested production and allocation priorities
- Risk of penalties by SKU and customer
- Lead time adjustment recommendations
Utilize RAG to provide visibility across warehouses, making in-transit shipments actionable for planning
A food manufacturer operates multiple warehouses and plants, making it challenging to track in-transit stock required for fulfillment
"Retrieve:
- [All open STOs across warehouses]
- [Current in-transit quantity by SKU]
- [ETA for each transport order]"
- 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
Use RAG to compare lead times across suppliers and plants, extracting actionable recommendations for lead-time optimization
A food manufacturer faces longer lead times due to fragmented sourcing and delays across its supply chain
"Retrieve:
- [Lead times across suppliers and plants]
- [Current order status and delays]
- [Historical lead times vs actual performance]
- 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
- Foundations of Prompt Engineering
- FMCG sector challenges
"Prompt Engineering is the bridge between human thought and machine understanding"