RAG (Retrieval-Augmented Generation) ایک LLM کو ایک retrieval system کے ساتھ جوڑتا ہے — knowledge base سے متعلقہ معلومات حاصل کر کے انہیں LLM کو context کے طور پر فراہم کرتا ہے تاکہ درست اور مستند (grounded) جوابات تیار کیے جا سکیں۔ یہ custom data پر LLM applications بنانے کے لیے ایک کلیدی تکنیک ہے۔
What RAG does
RAG → augment an LLM's generation with RETRIEVED relevant information:
1. RETRIEVE → search a knowledge base (your documents/data) for info relevant to the query
2. AUGMENT → add the retrieved info to the LLM's prompt as CONTEXT
3. GENERATE → the LLM answers using the provided context (grounded in your data)
→ gives the LLM relevant, up-to-date, specific knowledge it wasn't trained on
