RETRIEVAL-AUGEMENTED GENERATION: A way to make AI answers more reliable by combining searching for relevant information and then generating a response. Instead of guessing based only on old training data, it first finds useful data from external sources.
- Fetches up-to-date data and reduces incorrect or made-up answers.
- Works well with specialized data like medical or legal content.
- No need to retrain the model every time new data comes.
- Can use user-specific data to give more relevant responses.
COMPONENTS OF RAG:
- External Knowledge Source.
- Text Chunking and Preprocessing.
- Embedding Model.
- Vector Database.
- Query Encoder.
- Retriever.
- Prompt Augmentation Layer.
- LLM (Generator).
- Updater.
CREATING EXTERNAL DATA: External data from APIs, databases or documents is chunked, converted into embeddings and stored in a vector database to build a knowledge library.
RETRIEVING RELEVANT INFORMATION: User queries are converted into vectors and matched against stored embeddings to fetch the most relevant data ensuring accurate responses.
AUGMENTING LLM PROMPT: Retrieved content is added to the userβs query giving the LLM extra context to work with.
ANSWER GENERATION: LLM uses both the query and retrieved data to generate a factually accurate, context aware response.
KEEPING DATA UPDATED: External data and embeddings are refreshed regularly in real time or scheduled so the system always retrieves latest information.



Top comments (0)