What is retrieval-augmented generation?
Retrieval-augmented generation, or RAG, is a method for making an AI assistant answer from your information rather than from what the model happened to learn during training. It works in two steps:
- Retrieve. Your documents (FAQ, return policy, delivery charges, product descriptions) are split into small chunks and indexed, usually as embeddings that capture meaning. When a customer asks a question, the system finds the chunks that best match it.
- Generate. Those chunks are given to the language model along with the question, and the model writes a reply based on them.
If nothing relevant is found, a well-built system says so or passes the chat to a person instead of inventing an answer.
Why does it matter for sellers in Bangladesh?
A general AI model knows nothing about your delivery charge outside Dhaka, your exchange policy or which courier you use. Without RAG it may guess, and a wrong promise in chat turns into a return or a bad review. With RAG you upload your own policies once and update them when they change, and the AI agent answers from them.
Example
A customer asks, "Exchange korte parbo? Size boro hoye gele?". The system retrieves the exchange-policy paragraph ("size exchange within 3 days, unworn, with tag") and the AI answers from it, in the customer's language.
In SaleMag's AI chatbot, your knowledge-base documents are split into chunks and searched for each question, and only chunks above a relevance cutoff reach the AI. When it cannot answer from that material, it can hand the chat to your team.
Related terms
AI agent, human handover, Banglish.
Frequently asked questions
Does RAG stop an AI from making things up?
It reduces it a lot, because the model is told to answer from the retrieved text. A good setup also tells the AI to hand over to a person when nothing relevant is found.
What content should I add to a knowledge base?
Delivery areas and times, return and exchange policy, payment options, size guides, opening hours and answers to the questions customers ask most.
Do I need to retrain the AI when my prices change?
No. With RAG you update the documents or product data, and the next answer uses the new information.
About the author
WhatsApp & F-commerce automation, Dhaka
The Dhaka team that builds SaleMag, the AI sales inbox for WhatsApp, Messenger and Instagram used by online sellers in Bangladesh.