Filter a search by document date
Look one word ahead when copying titles and labels. · 197 words
Give the AI a clear date filter and tell it to check dates before ranking passages. For example, the prompt might say, "Find current rules for beach closures. Use only sources published or revised on or after January 1, 2024. Show each source's title, revision date, and exact quoted passage." The Coastal Safety Guide, revised May 2025, is acceptable, while the 2018 Beach Map is not. The checkable result should identify the 2025 guide and quote its closure rule. If no document has a visible publication or revision date, the model should say that its date cannot be verified rather than treating an old file as current.
A travel example makes the boundary equally clear. A user asks about entry requirements for a city. The prompt can limit the search to official pages revised in 2025 or 2026 and require the displayed update date beside every answer. The City Travel Portal, updated February 2026, would qualify. A 2019 tourism page would fail the filter. A useful final instruction is, "Rank verified, recent sources first, but list the date for every cited source." The reader can confirm both relevance and freshness without guessing which result the model preferred.
Check your recall
What date filter should the coastal-safety prompt use, and what should the model do if a source has no visible date?
Check your answer
Use only sources published or revised on or after January 1, 2024. If a source has no visible date, the model should report that its date cannot be verified and should not present it as current.
Sources and credits
Original KeyTouch lesson. Background reading · DAIR.AI · Retrieval Augmented Generation.