Skip to content
ML to LLMs
Labs / LLM and RAG Lab

RAG pipeline

Chunk documents, retrieve and rerank for a question, and see what happens when retrieval misses.

Theory and worked examples: The RAG pipeline

RAG pipeline lab

Four synthetic policy documents. Chunk them, retrieve for a question, optionally rerank, and see whether the evidence reaches the model.

Question: Are shipping costs refunded if my item was broken on arrival?

Query terms (common words dropped):shippingcostsrefundeditembrokenarrival

  1. #1refundscosine 0.408in context [1]contains the evidence

    they have not been accessed. Shipping fees are not refundable unless the item arrived damaged.

  2. #2shippingcosine 0.347in context [2]

    Shipping. Standard shipping takes 3 to 7 business days. Express shipping takes 1 to 2 business days and costs 15

  3. #3shippingcosine 0.112in context [3]

    business days and costs 15 dollars. International orders may take up to 21 days and can incur customs fees paid

Grounded answer: “Yes: shipping fees are refundable when the item arrived damaged.” [1]

The evidence made it into the context at position 1, so the model can answer and cite it.