Short answer: use a two-stage retrieval path with a hard deadline, and treat chunk freshness as a first-class input to ranking. For a travel itinerary planner, I would reserve roughly half the request budget for candidate retrieval, keep a small rerank slice, and spend the remainder on answer generation and network jitter. The exact milliseconds depend on your mobile SLO and provider mix; your mileage may vary.

That choice is less glamorous than tuning an embedding model. It is also what lets a one-person SaaS ship weekly. A stale museum closure is worse than a slightly less relevant paragraph, so the planner should prefer a fresh, moderately similar chunk over an old perfect match.

Trust the clock.

How should a travel itinerary planner split retrieval latency across stages?

Start with a request contract, not a database setting. Define a p95 target for the whole itinerary response, then assign a budget to each hop. One workable contract is 300 ms before generation: 120 ms for lexical and vector candidate reads in parallel, 60 ms for metadata filters, 80 ms for reranking, and 40 ms as a timeout cushion. Those numbers are a starting hypothesis, not a universal standard.

Deadlines have to propagate. Every function receives an AbortSignal; when the clock expires, it returns the best candidates already available. A slow secondary source must not hold the entire answer hostage.

type Candidate = { id: string; text: string; score: number; updatedAt: number; }; export async function retrieve(query: string, signal: AbortSignal): Promise<Candidate[]> { const [lexical, vector] = await Promise.all([ lexicalSearch(query, signal), vectorSearch(query, signal), ]); const merged = mergeAndDeduplicate([...lexical, ...vector]); return rerank(merged, { signal, maxAgeMs: 24 * 60 * 60 * 1000 }); } 

In Node.js, the caller can derive the signal from a timer and pass it through the storage and model clients. Do this at the boundary. Retrofitting cancellation after a few production incidents is a bad use of founder time.

Chunk freshness is a ranking feature, not a cleanup job

Travel data changes in uneven bursts. A flight schedule may be stable for weeks, while a park closure changes this morning. Store updatedAt, sourceType, and a content hash beside each chunk. Re-index only when the hash changes, but still expose the timestamp to retrieval.

I use a freshness decay rather than a binary “expired” flag. For a chunk age of a hours, one simple multiplier is exp(-a / h), where h is a source-specific half-life. The final score can combine semantic similarity, lexical score, and that multiplier. Keep the components observable; a single opaque score makes debugging impossible.

There is a catch: freshness can overrule useful context. A ten-year-old visa rule may be authoritative, while a new blog post is noise. Put policy metadata in the document and let the ranker apply different half-lives by source class. If a source has no reliable timestamp, mark that uncertainty explicitly and require a conservative fallback.

Chunk by meaning first, then by a token ceiling. Splitting every 500 characters creates fragments that lose dates, locations, and exceptions; making chunks huge inflates rerank time and encourages irrelevant context. Preserve section titles and itinerary day labels in each chunk so a result can stand alone.

For freshness checks, a small manifest is enough:

type ChunkManifest = { documentId: string; generation: string; contentHash: string; updatedAt: string; expiresAt?: string; }; 

The manifest also gives you an audit trail when a user asks why an itinerary still recommends a closed venue. Log the document ID and generation, never the traveler’s private notes.

This is where the index boundary matters. Keep two indexes during refresh: an active generation and a building generation. Write changed chunks to the building index, run a sample query set, then flip a pointer. This avoids mixing yesterday’s and today’s versions in one response. The pointer flip is cheap; repairing partial updates is not. At small scale, a manifest plus one nightly rebuild may be enough. Do not pay for dual generations until stale results are a recurring support ticket.

That boundary earns its keep.

What fails first when the latency budget is real?

The common failure is parallel work that is only pretending to be parallel. A vector call starts immediately, then waits on a metadata service before it can be scored. Measure queue time, network time, index time, and rerank time separately. A p95 of 110 ms can hide a p99 timeout that users feel during peak booking hours.

Another failure is retry multiplication. One retry on three independent providers can turn a 300 ms contract into a one-second tail. Use one bounded retry only for idempotent reads, and shorten the remaining deadline before attempting it. Return a partial candidate set with an explicit confidence flag when the deadline is reached.

I once assumed that increasing top-k would improve itinerary quality. It did, until reranking consumed the entire budget and generation began with an empty context. The trace showed three vector batches queued behind one metadata lookup; each retry then multiplied the tail. I split the lookup, capped candidates per source, added a diversity constraint by city and day, and recorded the cutoff reason. The resulting answer used fewer chunks but retained the closure notice that mattered. Small wins compound when revenue per hour matters.

What I would change at scale

At higher traffic, move embedding and indexing into an asynchronous pipeline, cache normalized queries for a short window, and keep a per-source freshness queue. Add traces that connect a user request to its retrieval generation, plus alerts on deadline exhaustion and stale-result rate. These controls are more valuable than another model swap. They also let me spend a Friday shipping a feature instead of explaining a tail-latency graph to myself.

The approach is not suitable when you need strict transactional inventory guarantees, sub-50 ms responses from a single region, or complex joins across live booking systems. In those cases, keep retrieval for descriptive content and use a transactional search or booking engine for availability. Stick with a simpler single index when your corpus is small and updates are rare; the operational surface of dual generations is not free.

The decision rule is straightforward: spend latency where it changes the itinerary, measure freshness as part of relevance, and let a deadline produce a bounded answer instead of a hung request. That is enough architecture to keep a travel planner trustworthy while one person keeps shipping.

References