Add rag module: Spring AI 2.0 RAG with pgvector, chunking, reranking and a faithfulness check

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B38FGKKam5SCGgwgduVAh3
This commit is contained in:
Claude
2026-09-21 19:09:05 +00:00
commit 1d4625a1c2
62 changed files with 3715 additions and 0 deletions
@@ -0,0 +1,27 @@
# PagePdfDocumentReader: what one PDF page becomes
pages in the PDF: 4, documents read: 4
page document metadata: {page_number=1}
page document metadata: {page_number=2}
page document metadata: {page_number=3}
page document metadata: {page_number=4}
--- page 2 as read (single spaces as dots, runs of 4+ as [n spaces], line ends as a pilcrow) ---
[12 spaces]4.1··Annual···Leave···Entitlement.···Full-time···employees[5 spaces]are··entitled·to·20··working···days[104 spaces]¶
[12 spaces]of·annual···leave··per··calendar···year.··Part-time···employees[5 spaces]receive···leave··pro··rata.[107 spaces]¶
[12 spaces]4.2··Leave···Carryover.···Unused[5 spaces]annual···leave··may···be··carried··over··for·a·maximum[6 spaces]of·5·days[96 spaces]¶
[12 spaces]into·the··next··calendar···year··and···must··be··used···by·31··March.[133 spaces]¶
--- page 2 after IngestionService.tidy ---
4.1·Annual·Leave·Entitlement.·Full-time·employees·are·entitled·to·20·working·days¶
of·annual·leave·per·calendar·year.·Part-time·employees·receive·leave·pro·rata.¶
4.2·Leave·Carryover.·Unused·annual·leave·may·be·carried·over·for·a·maximum·of·5·days¶
into·the·next·calendar·year·and·must·be·used·by·31·March.
--- size of page 2 ---
as read : 862 characters, longest run of spaces 133
tidied : 304 characters, longest run of spaces 1