One rule
A citation is useful only if a user can find the same evidence again. Cite the retrieved chunk, not the model’s memory or a vague file name.
For this track, a good citation has document name, page or section if available, and a chunk id or quoted line.
What to cite
Your answer should cite every important factual claim that comes from the documents. If the answer has three facts from two chunks, show both sources.
Do not cite general filler like “based on the documents”. Cite claims such as dates, fees, eligibility, deadlines, policy rules, product limits, and names.
Keep source metadata
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done
Chunk record example
This is the kind of record your vector index should return. The exact database can change. The idea stays the same: text plus metadata.
{
"id": "fee_policy_p2_c1",
"text": "Students can pay semester fees by UPI, net banking, or demand draft. Late payment after 15 August has a fine of Rs 500.",
"metadata": {
"source": "college_fee_policy.pdf",
"page": 2,
"section": "Payment modes"
}
}Prompt for citations
Ask the model to use only the retrieved evidence and to cite source ids inline. Keep the citation format simple so you can test it later.
You are answering questions using only the evidence below.
If the evidence does not contain the answer, say: I don’t know from the provided documents.
For every factual claim, add a citation in this format: [source: id, page].
Evidence:
1. id: fee_policy_p2_c1, source: college_fee_policy.pdf, page: 2
Text: Students can pay semester fees by UPI, net banking, or demand draft. Late payment after 15 August has a fine of Rs 500.
Question: Can I pay fees using UPI? What happens if I pay late?
Answer:Answer users can verify
A useful answer is not just correct. It tells the user where to check it.
For your repo, save a few example questions and cited answers. Recruiters should be able to open the sample document and verify the citation.
Yes. You can pay semester fees using UPI, net banking, or demand draft [source: fee_policy_p2_c1, page 2]. If you pay after 15 August, the late fine is Rs 500 [source: fee_policy_p2_c1, page 2].Avoid fake citations
A common bug is letting the model invent file names or page numbers. Do not ask the model to create citations from memory.
Give it the exact citation labels in the evidence. Then tell it to cite only those labels. After generation, check that every cited id exists in the retrieved chunks.
Add a verifier
Before showing the answer, run a small check in code. Extract citation ids from the answer and confirm they are in the retrieved result ids.
This does not prove the answer is fully grounded. Lesson 6 handles evaluation. But it catches many broken citations.
import re
retrieved_ids = {"fee_policy_p2_c1", "hostel_rules_p1_c3"}
answer = "You can pay by UPI [source: fee_policy_p2_c1, page 2]."
cited_ids = set(re.findall(r"source:\s*([a-zA-Z0-9_\-]+)", answer))
missing = cited_ids - retrieved_ids
if missing:
raise ValueError(f"Answer cites sources not retrieved: {missing}")Do this now
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done