Make answers cite their sources and admit gaps

You will be able to prompt a model to answer only from retrieved text, cite it, and say when it cannot answer.

Daniel's retrieval was working. Then a colleague asked the tool whether the firm paid for gym memberships. The handbook says nothing about gyms. Retrieval returned the five closest chunks anyway, on medical benefits, the wellness day and the flexible benefits scheme, and the model wrote a confident paragraph saying gym fees could be claimed under flexible benefits up to an annual limit. It cited a section that does not mention gyms. The colleague submitted a claim, and Daniel had to explain why it was rejected.

Retrieval finds text. It does not stop the model from going beyond that text. The answering prompt is where you set that boundary.

Answer only from the passages

The model already knows a great deal about how companies usually handle benefits, and it will happily fill gaps with that general knowledge unless told not to. For an HR tool, a policy assistant or anything else where the answer must come from your documents, that general knowledge is a liability.

So the answering prompt says three things clearly. Answer using only the passages provided. If the passages do not contain the answer, say you could not find it in the documents, and do not guess. Do not use outside knowledge about how other companies or laws handle the matter.

Then format the request so the boundary is visible. Put the retrieved passages in a clearly marked block, each with an ID, and the question after them. Daniel's prompt numbers each passage and labels it with its source, then says "Question:" before the user's text. The clearer the separation, the less the model blends passages, question and its own knowledge together.

Give the model a fixed phrase for the gap, such as "I could not find this in the HR documents. Please check with HR." A fixed phrase is easier for your code to detect and count, and it reads better than an apology the model invents each time.

Make every claim point to a source

Ask the model to put the ID or source label of the supporting passage after each statement in its answer. In lesson 3.3 you stored metadata with every chunk. This is where it pays off. Your code turns passage IDs back into readable references like "Claims Policy, section 4.2, page 7", so the citation is built from your stored data rather than typed by the model.

If you took Working with AI assistants, lesson 5.2, Make it quote and point to the source, taught the same habit for chat. In an application you can check it automatically. Confirm that every ID the model cites was among the passages you sent. A citation to a passage that was never retrieved is a sign the answer drifted, and your code can flag it before the user sees it.

Citations do not guarantee the cited passage supports the claim. The gym answer cited a real section. It just did not say what the answer claimed. That is why the next two habits matter.

When an answer is wrong, check retrieval first

When the tool gives a wrong answer, the instinct is to rewrite the prompt. Usually that is the wrong place to look. Most wrong answers in a retrieval system come from retrieval: the right passage was never found, so the model worked with the wrong material.

So when an answer is wrong, look at the passages that were sent before you touch the prompt. If the right passage is not among them, the problem is chunking, embedding or search, and no prompt change will fix it. If the right passage is there and the model still got it wrong, then the prompt or the model is the problem.

Daniel added a debug mode that prints the retrieved passages under each answer. After that, chasing a bad answer took minutes instead of an afternoon, because he could see straight away which half of the system had failed.

Show the sources to the user

Finally, show the citations to the person asking, with enough detail to find the page. People trust an answer more when they can check it, and they catch mistakes the tool cannot. For anything that matters, like a claim or a leave application, a staff member should open the cited section before acting.

Daniel's tool now shows the answer, the source under each sentence, and a link to open the document at that page. Since then, wrong answers get reported within a day, usually with the exact passage that disagrees.

Daniel now counts an honest "I could not find this" as a correct answer, and he tests for it on purpose. The activity below has you write the answering prompt and try it on two questions your documents cannot answer.

Write the answering prompt for your tool and test it with two questions your documents cannot answer.

Course

Junxiong-WFG Organisation is an authorised representative of AIA Financial Advisers Private Limited (Reg. No. 201715016G).