Introduction to RAG

ClaimFlow Week 3 RAG Understanding

Goal

Week 3 is not a chatbot. It is a policy-grounded coverage assistant.

The system should answer claim coverage questions using retrieved policy clauses and citations.

Claim context
+ user coverage question
+ retrieved policy clauses
→ grounded answer with citations

1. Loading

Loading means fetching document content and attaching metadata.

In ClaimFlow, loading currently uses simple synthetic markdown policy files:

sample-data/week-03-policy-rag/policies/*.md

Current loader:

packages/rag/load-policy-documents.ts

For now, documents are simple markdown. Later, loading may include PDFs, images, public policy docs, S3 files, or OCR output.


2. Chunking

Chunking means splitting a document into smaller retrievable units.

In ClaimFlow:

one policy clause = one chunk

Example: