Skip to content

Contact LV

lv@dablock.com

Juan Lago (LV) uses your details to reply to enquiries (legitimate interest), fulfil a contract with you, or take steps you request before entering one. Privacy and your rights

RAG (Retrieval-Augmented Generation)

Retrieving source material before generating an answer

LV glossary Updated

What is RAG (Retrieval-Augmented Generation)?

Retrieval-augmented generation supplies relevant external material to a model before it answers. The retrieval step can use keywords, vectors, filters, or a combination. RAG can support grounded answers, but poor retrieval or incorrect interpretation can still produce errors.

How it works

What is the refund deadline in this sample policy?

Refund policy · section 2

You can request a refund within 14 days of purchase. Include your order number with your request.

Answer

You have 14 days from the purchase date to request a refund. [1]

Key takeaways

  • Keep sources current and access-controlled.

  • Include unsupported questions and contradictory sources in evaluation.

▸

Illustrative example

In a hypothetical policy assistant, retrieve the currently approved refund policy, pass the relevant clause to the model, and link the answer to that clause. If no applicable clause exists, report that the source does not answer the question.

Build and check the retrieval path

Index the policy with its effective date and keep a record of the passages supplied for each answer. Suppose a reader asks how long they have to request a refund. If retrieval returned last year’s policy, check the version filter. If the model received the current clause but cited the deadline for a different product, the mistake happened after retrieval. Keeping the passage alongside the answer makes those failures distinguishable.

RAG, prompting, and fine-tuning

Scroll the table to see every column.

RAG, prompting, and fine-tuning
ApproachWhat changesA suitable need
PromptingInstructions and examples in the requestClarify the task, format, or source-use rule
RAGEvidence retrieved for an answerUse current or attributable documents
Fine-tuningModel parameters through further trainingImprove repeatable behavior under measured evaluation
Combined systemDifferent parts of the applicationThese methods can be used together

Sources and documentation