Subtitle: Learn how system prompts, retrieved context, and customer questions work together to build a reliable AI shopping assistant.
1. Why Does Prompt Architecture Matter?
Imagine a customer visits Varastra, an Indian ethnic wear e-commerce platform, and asks ShopBot:
"Does this silk saree need dry cleaning?"
Varastra's product database contains this information:
- Dry clean only.
- Do not machine wash.
ShopBot has the correct information. But how do we ensure it answers using that information instead of adding unsupported advice?
This is where prompt architecture comes in.
Prompt architecture organizes the instructions, product information, and customer question before sending them to the language model.
Its goal is to help the AI provide answers that are relevant, clear, and supported by evidence.
2. The Three Main Components
A. System Prompt — Set the Rules
The system prompt tells ShopBot how to behave.
For example:
- Answer using the provided product information.
- Use simple, natural language.
- Do not invent product details.
- If the information is missing, admit it.
These instructions help the AI understand the boundaries of its response.
B. Retrieved Context — Provide the Evidence
ShopBot retrieves relevant information from Varastra's product database using the RAG pipeline.
For example:
Product: Silk Saree
Care Instructions: Dry clean only. Do not machine wash.
This is the retrieved context. It provides the evidence needed to answer the customer's question.
C. Customer Question — Define the Task
The customer asks:
"Does this silk saree need dry cleaning?"
The question tells ShopBot what information the customer wants.
The system prompt defines the rules, the retrieved context provides the evidence, and the question defines the task.
3. How the Prompt Builder Works
Before sending information to the language model, the application combines all three components into one structured prompt.
For example:
SYSTEM:
You are ShopBot, Varastra's AI shopping assistant.
RULES:
1. Answer using the provided context.
2. Use simple, natural language.
3. Do not invent unsupported product details.
4. If information is missing, admit it.
CONTEXT:
Product: Silk Saree
Care instructions: Dry clean only.
Do not machine wash.
QUESTION:
Does this silk saree need dry cleaning?
This is an example of an assembled prompt.
The prompt builder prepares the information, and the language model uses it to generate an answer.
4. Two Possible Outcomes
Outcome A: A Grounded Answer ✅
ShopBot responds:
"Yes, dry clean only. Do not machine wash."
This answer directly addresses the customer's question and stays within the retrieved evidence.
Outcome B: An Unsupported Answer ❌
ShopBot responds:
"Yes, dry clean only. Store in muslin cloth and avoid direct sunlight."
The extra advice might sound reasonable, but it was not included in the retrieved product information.
This is an example of answer drift: the AI adds claims that are not supported by the available evidence.
For an e-commerce platform, unsupported product advice can confuse customers and reduce trust.
The goal is not to make answers longer. It is to make them accurate and evidence-based.
5. Why Does the System Prompt Matter?
Compare these two instructions.
Weak instruction:
"Answer the customer helpfully."
This leaves room for the model to add information from its general training.
Stronger instruction:
"Answer using the provided product context. Do not add product-specific claims that are not supported by the context. If the information is missing, explain that you could not find it."
The stronger instruction sets clearer expectations.
However, prompts cannot guarantee perfect accuracy. The system must also retrieve reliable information and test the answers it generates.
6. What Does Temperature = 0 Mean?
The diagram shows temperature=0.
Temperature affects how a language model selects the next token while generating a response.
A lower temperature generally makes responses more predictable and less varied.
For ShopBot, this can help produce consistent answers to common product questions.
However, temperature = 0 does not guarantee accuracy. The model can still misunderstand the context or produce unsupported information.
Reliable answers also require accurate data, relevant retrieval, clear instructions, and proper testing.
7. What If the Answer Is Missing?
Imagine a customer asks:
"Can I iron this silk saree at a high temperature?"
But the retrieved context only says:
"Dry clean only. Do not machine wash."
The available evidence does not explain whether high-temperature ironing is safe.
ShopBot should not guess.
A better response would be:
"I couldn't find specific ironing instructions for this saree. Please contact Varastra support for guidance."
Admitting that information is missing is better than inventing an answer.
8. How Prompt Architecture Fits into RAG
Prompt architecture is one of the final stages of a Retrieval-Augmented Generation (RAG) pipeline.
The workflow is:
- Customer Question: The customer asks about a product.
- Embedding Model: Converts the question into a vector.
- Retriever: Searches the vector database for relevant information.
- Retrieved Context: Supplies matching product details.
- Prompt Builder: Combines instructions, evidence, and the question.
- Language Model: Generates the response.
- Grounded Answer: Returns the response to the customer.
Each component has a different responsibility.
The retriever finds evidence. The prompt builder organizes the information. The language model generates the answer.
If the retrieved information is incorrect or incomplete, a good prompt cannot fix the underlying data problem.
Reliable AI answers require both relevant evidence and well-designed prompts.
Key Takeaways
- System Prompt: Defines the AI's rules.
- Retrieved Context: Provides verified product information.
- Customer Question: Defines what needs to be answered.
- Prompt Builder: Combines the instructions, evidence, and question.
- Language Model: Generates the response using the assembled prompt.
The main lesson is simple:
Finding the right evidence is only half the job. The prompt must also guide the AI to answer using that evidence.
