The first warning that a travel itinerary planner's retrieval architecture mishandles document versioning often arrives as a support ticket: “Is the museum open on Tuesday?” The bot cited a guide replaced last week. The request succeeded. The answer did not. On-call sees a healthy API latency graph beside an itinerary built from yesterday’s train timetable.
This is a versioning incident.
Short answer: keep immutable document revisions in a controlled vector index, attach an effective time and source revision to every chunk, and query only revisions valid for the itinerary’s travel date. Add live retrieval when current conditions matter. This gives you freshness, control, and citations without pretending that one copy of a document can serve every date.
The alert is late because the wrong signal is green
Most teams alert on ingestion success and query latency. Those are useful, but neither tells you whether a traveler received the right revision. A green pipeline can faithfully embed an obsolete cancellation policy.
Work backwards from the user-visible contract. For each answer, record the destination, the travel date, the source publication timestamp, and the revision used. A retrieval trace should say “rail timetable revision 184, effective 2026-10-14,” not merely “top result: timetable.” The distinction is what lets an incident reviewer explain a bad recommendation.
I once thought a nightly rebuild would be enough for trip planning. It wasn't. A supplier can publish a corrected platform number at 09:12, while a user is assembling a 10:00 departure. The first useful alert is therefore a freshness budget measured against the source's effective timestamp, not just the time your worker last ran.
The threshold needs restraint. Page when a meaningful slice of valid documents is outside its budget, such as a high percentile or a sustained count by source. Page on every late chunk and the team will mute the alert; page on nothing and stale reservations become a customer-facing incident.
How should a travel itinerary retrieval architecture handle document versioning?
Treat a document revision as a new, immutable retrieval object. Give it a stable logical document ID, a monotonically increasing revision ID, an effective_from and effective_until interval, and a source URL. Never overwrite the vector for revision 183 with revision 184. Instead, upsert the new chunks and mark the old interval closed in metadata. The query then has two filters: the traveler’s destination or tenant, and the date interval that contains the itinerary date. A current query can use an open-ended interval; a historical itinerary should resolve to the revision that was valid on that date. This is ordinary temporal data modeling, applied before semantic similarity gets a vote. Chunk boundaries matter here: split around a policy section, route segment, or table row, and carry the parent revision metadata into every chunk. A chunk that says “last departure 18:30” without its route, station, and effective date is not evidence; it is a tempting fragment. Keep enough neighboring context to render a citation, but avoid embedding an entire guide when only one schedule row changed. Finally, expose ingestion, query, and citation assembly as three observable stages. Measure each one separately. A missing revision in ingestion is a different failure from a bad metadata filter, and both differ from an answer renderer that drops the source link.
The page that should fire earlier
Add a synthetic check that asks a fixed itinerary question for a known travel date. The expected top result includes a revision ID and an effective interval. Store the check as a small labeled evaluation set: questions, acceptable sources, and the revision that should win. Run it before changing chunking, embedding, or ranking.
Here is a compact Go shape for the metadata contract. The interval check is intentionally boring; it is easy to inspect in a postmortem.
package versioning
import "time"
type Chunk struct {
LogicalID string
RevisionID int64
EffectiveFrom time.Time
EffectiveUntil *time.Time
SourceURL string
}
func ValidOn(c Chunk, travelDate time.Time) bool {
if travelDate.Before(c.EffectiveFrom) {
return false
}
return c.EffectiveUntil == nil || travelDate.Before(*c.EffectiveUntil)
}
The check becomes an operational metric: what fraction of labeled questions return a valid revision in the top five? Pair it with freshness lag, duplicate-revision rate, and citation completeness. A single aggregate recall number hides the exact class of error that wakes the on-call.
When a new revision arrives, write it first, verify that a sample query finds it, then close the previous interval. If the order is reversed, a short gap can make every revision ineligible. When a source retracts a document, preserve the tombstone and exclude it from retrieval; deleting only the vector leaves downstream systems unable to explain what happened.
Choosing control, freshness, and failure behavior
There are two broad shapes. A managed vector service reduces operational work but still requires your ingestion job, metadata schema, and deletion policy. A self-hosted search engine gives deeper control over filtering and audit storage, while making upgrades, capacity, and backups your responsibility. A live web search path offers current public context, but pages can change between retrieval and citation and may not provide a durable revision identifier.
The trade-off is contextual:
| Approach | Strength | Cost or limit | Suitable use |
|---|---|---|---|
| Controlled vector index | Repeatable retrieval and revision filters | You own ingestion and freshness | Published schedules and policies |
| Self-hosted lexical/vector search | Fine-grained ranking and audit control | Operations team carries scaling and upgrades | Large catalogs with strict governance |
| Live web retrieval | Fast access to changing public facts | Less reproducible citations and variable markup | Weather, closures, and same-day notices |
Use a controlled index when a source can publish stable revisions and the itinerary must be explainable later. Add live retrieval for volatile facts, but label those claims as live and retain the fetched timestamp. Stick with a specialist crawler when contractual source coverage is the requirement; a vector index cannot compensate for a source you are not allowed to fetch.
The catch is that version-aware filtering narrows recall if publishers omit effective dates or reuse a revision ID. In that case, route the document to a review queue or require a source-side timestamp; do not silently treat “latest ingested” as “valid for travel.” Your mileage may vary across suppliers, and the missing field is a data-contract problem, not a ranking knob.
Instrumentation changes the false-positive bill
Emit one trace per answer with logical document IDs, revision IDs, filter values, candidate count, selected sources, and citation URLs. Sample the full payload only where privacy rules allow it; otherwise keep hashes and timestamps. The alert should fire on a user-visible failure rate or a freshness percentile, then guide the responder through ingestion lag, interval filters, tombstones, and citation assembly in that order.
That ordering matters. We have been paged by duplicate deliveries in other scheduled systems, and the same idempotency reflex applies here: an ingestion event may be retried, so upserting the same logical ID and revision must be safe. A duplicate vector is not harmless; it can crowd out the correct revision and make ranking look random.
Keep the runbook short.
Confirm the source revision, replay the labeled query, inspect the filter, and only then adjust ranking. A noisy synthetic check costs a few minutes of attention. A missed timetable change costs a traveler a connection.
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.