Semantic Layer course
Data layer 40 min AccuracyExplainability

GraphRAG: the PDFs join the graph

The arrears definition was on page 34 the whole time

Section 1

Page 34

Next section
Section 2

What vector search is good at, and what it is not

Next section
Section 3

Getting documents in

Next section
Section 4

Building the lexical graph

Next section
Section 5

Retrieval, in six steps

Next section
Section 6

Two graphs, on purpose

Next section
Section 7

Extraction that knows what to look for

Hands on

Make the credit policy queryable

40 min

Chunk the Meridian Credit Policy PDF, extract concepts, build a small lexical graph in Fuseki, embed the chunks into a local vector index, then run a hybrid retrieval that answers the arrears question with a page citation and links the answer to the ontology class.

make lab-up            # once, starts Postgres + Fuseki + Ontop
make lab lab10-graphrag

Full instructions, starter files and the solution are in labs/modules/lab10-graphrag/README.md. The lab checks its own work, so you will know if it passed.

Check yourself

Quiz

7 questions, pass mark 70%. Answers are explained either way, so a wrong guess is not wasted.

1 Vector-only RAG answers "what does the credit policy say about arrears?" well but fails on "which of Daniel's documents support the income figure the assessment used?". Why?
2 Which two things does the two-tier split between the lexical graph and the curated semantic layer graph give you? (pick two)

Select all that apply.

3 Why must the model that embeds an incoming query be the same model and version used to build the index?
4 The completion handler publishes to an SNS topic that four SQS queues subscribe to, instead of invoking the four services directly. Which is not a reason given for that?
5 Which edge in the lexical graph is what makes a GraphRAG answer able to cite "page 34"?
6 An LLM extracts Daniel Okafor's annual income as 54,000 at confidence 0.91 and his employer as a payroll provider name at 0.62. Meridian's shape requires 0.75 minimum. What happens?
7 You need to pull loan IDs and write-off dates out of 40,000 loan agreements. Which technique does the guidance point you at first?