Ingestion: From Files to Searchable Chunks
Load Markdown, HTML, PDFs and tables, clean and de-duplicate them, chunk with context and metadata, and re-ingest only what changed.
Retrieval can only find what ingestion put into the index. A page loaded with its navigation menu, a PDF read in the wrong column order, a table flattened into a row of numbers, a chunk cut in the middle of a sentence: each one is a wrong answer waiting to happen, and no embedding model or ranker can repair it afterwards. This phase is about the work that happens before search, and it is where most real RAG systems are won or lost.
You will build every step by hand, in Python, Java and JavaScript: a loader interface for Markdown and HTML, reading order for PDF columns, tables turned into sentences, cleaning, exact and near-duplicate detection with a hash and shingles plus Jaccard similarity, four chunking strategies measured side by side, heading paths and titles that give chunks their context, a metadata schema that is checked, and an incremental sync with stable chunk ids. Where real embeddings show something a toy cannot, you run a search lab in your browser.
The Build topic adds a complete ingestion pipeline to AskDocs: load, clean, chunk with context, attach metadata, embed and upsert, with a second run that changes only what changed. This phase adds new handbook documents (a price table, D13, and a Markdown rental guide, D14) and never changes D1 to D12.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.