Content revision 4e771eaf0390cc87b6c7c6fd8469f3508f6ceeec7119472e6c1ccf17e2e1e5d2 ## Retrieving a passage with the note it refers to A Structure-Preserving RAG Ingestion Pipeline Source ID ragflow-pipeline:notes Original https://www.henryw.me/#/ragflow-pipeline#notes A sentence could cite Note (4) several pages before the note appeared. Extracting both passages accurately still left retrieval with two separate pieces. A question might match the citing passage closely while giving the search little reason to return the note it refers to. I needed to make their explicit reference part of the material being indexed. I considered linking the resulting chunks through metadata and attaching the note to its citing text immediately after parsing. The second approach was simpler to carry through retrieval. MinerU preserved the reference metadata, and the document’s surrounding context was still available at that point. A custom Python linker could resolve the relationship before chunk boundaries were set. Repeated note numbers meant that matching a label alone was insufficient. The linker used the relevant section, position and surrounding context, repaired fragmented notes, and normalised inconsistent labels. It then placed the note beside its citation and removed the duplicate standalone copy. Chunking could keep the passage and its linked note in one unit of evidence. The example connects a sentence on page 3 with its note on page 5. Across the controlled document, the linker resolved all 13 cross-page references. In the retrieval check, the combined passage and note became the top result for the question they answered. Other approaches I tested Baidu Unlimited OCR offered a multi-page mode. In tests on difficult public government documents, it preserved much of the layout, while the relationship between a passage and a later note still needed explicit linking. Reading several pages together did not by itself establish which passages belonged together. I also examined image-based and multimodal retrieval. Keeping each page as an image retained its visual layout while leaving cross-page relationships separate. The RAGFlow path I evaluated converted images to text before embedding them. Linking the references in that text let me determine which pieces would be retrieved together.