FDE ACADEMY · MODULE 02 · LESSON 03
Retrieval is the product
Chunking, embeddings, hybrid search and re-ranking — and the discipline that separates a working deployment from a demo: evaluating retrieval on real questions before anyone is invited in.
- Effort
- A long afternoon: the deployment takes an hour, the evaluation takes the rest.
- Skills
- rag · llm-evaluation · vector-databases
Free and self-paced. No certification is offered.
Before you startYou have a model serving over HTTP from lesson 02, or a hosted endpoint you may use.
01Where quality actually comes from
When a retrieval deployment gives a bad answer, the model is rarely the cause. Nine times in ten the passage that contained the answer was never retrieved, or the document was never ingested, or the ingestion turned a table into unreadable text. The model faithfully answered the question it was given, which was the wrong question.
That should change where you spend your effort. Swapping in a larger model is the expensive intervention with the smallest effect; fixing chunking, adding keyword search alongside vectors, and re-ranking the candidates is cheap and usually decisive.
02The four stages, and what goes wrong in each
Ingestion converts a file into text and structure. Scanned PDFs, tables and multi-column layouts are where this fails, and it fails silently — the pipeline reports success and the text is nonsense.
Chunking splits that text into retrievable units. Too small and a passage loses the context that made it meaningful; too large and the embedding averages several topics into a vector that matches nothing well. Respect the document’s own structure — sections, clauses, headings — rather than counting characters.
Search finds candidates. Vector similarity alone misses exact terms: a case number, a product code, a person’s name. Combining it with keyword search covers both, and the combination is worth more than a better embedding model.
Re-ranking puts the best candidate first with a model that reads the query and the passage together, which is slower and much more accurate than a vector comparison. Retrieve widely, re-rank, then send a few passages to the model.
03Evaluate before rollout, and again after
Write twenty real questions with the document that should answer each. Run them. Count how often the right document appears at all, and how often it is first. That number is your baseline, and every change you make afterwards is measured against it.
It is also the only honest thing to show a customer before go-live. “Retrieval finds the right document first for seventeen of twenty questions your team wrote” is a statement they can act on. “It works well” is not.
04Do this
PRACTICAL TASK
Deploy the private knowledge base and evaluate its retrieval
Run the flagship recipe locally, load one real document collection, and produce a retrieval baseline from twenty questions written by someone who does the work.
What you need
- The endpoint from lesson 02, or the recipe’s serving step run again
- One real document collection you are permitted to use — twenty to a few hundred files
- Twenty questions with the document that should answer each
Steps
- 01
Work through the recipe’s eleven steps in order. Do not skip the evaluation step; it is step ten for a reason.
- 02
Load your collection and spot-check the extracted text of five documents, including one scan and one with a table. Read what came out, not what you assume came out.
- 03
Run your twenty questions. Record, per question, whether the right document was retrieved at all and whether it was first.
- 04
Change exactly one thing — chunk size, or adding keyword search alongside vectors — and re-run the same twenty. Keep both numbers.
- 05
Read the recipe’s evidence section to see which of its steps have a stored evidence record and which documentation page each came from.
You are done when
- You can quote a hit rate and a first-position rate over twenty questions, and say who wrote the questions.
- You changed one variable and can state its effect on both numbers.
- You have looked at the extracted text of a scanned document and know whether your pipeline reads it.
05Where these facts live
This lesson does not restate anything that is already recorded with its evidence elsewhere on the site. These are the pages it leans on.
- Private company knowledge base
The flagship self-hosted retrieval recipe: eleven steps, external data transfer none, evaluation before rollout.
- BGE-M3
The embedding model the flagship uses, with its registry facts and the stacks it appears in.
- Docling
Document conversion — the stage where a scanned PDF quietly becomes unusable text.
- Open WebUI, AnythingLLM, Onyx: which is for what
Three retrieval front ends compared on what they are for, rather than on feature lists.
Ticks are stored in your browser only. They are not sent anywhere, they are not attached to an account, and clearing your browser data removes them.