Latency Budgets for Web Search in Real-Time LLM Applications
Allocating latency to web search separately ensures your LLM pipeline stays responsive.

A web search API for AI agents and RAG pipelines needs to return links quickly and deliver clean, context-ready content within a set latency budget. The choice depends on tail latency, content the pipeline can use, and what happens when search misses its deadline.
Why real-time LLM applications need a web search sub-budget, not just an end-to-end target
Users feel latency before they see an answer, which makes Time to First Token the immediate measure of responsiveness. Jakob Nielsen's three UX thresholds of 0.1 s, 1.0 s, and 10 s give that pressure a concrete frame. A Time to First Token above 1 second breaks conversational flow. Yet a production pipeline may run query rewriting, embedding, hybrid retrieval, reranking, and LLM prefill before it produces that first token.
Web search makes this sequence harder to diagnose because its delay comes from outside the internal retrieval system. Network round-trips, third-party API variance, and page-rendering overhead add costs that internal tuning cannot fully control. In agentic pipelines, those costs recur across every search tool call a task requires. A delay that seems manageable in one lookup can therefore become a substantial part of a multi-step interaction. Search can be slow, and its contribution to latency changes across requests.
An end-to-end service-level objective, or SLO, records the combined result of those stages. It does not reveal whether a missed target came from model inference, retrieval, or an external search call. That distinction matters because each cause requires a different intervention. An aggregate target can establish that the experience is broken without giving engineers an actionable signal about where it broke.
Where the milliseconds actually go in a production retrieval pipeline
A worked p99 budget for an internal retrieval endpoint shows how much time is committed before web access enters the picture. Network round-trips, including client-to-edge traffic, internal hops, and the response payload, account for approximately 40 ms. Vector ANN search takes a moderate share of the time, and metadata and feature fetch take about as much. Query embedding takes a small but still meaningful share of the time, and queue and batching wait take about as much. The remaining lines are the reranker over top candidates, post-processing at approximately 5 ms, and a headroom reserve for variance and tail latency.
Within that budget, vector search is rarely the bottleneck. A well-indexed search over a large document set runs in tens of milliseconds, whereas the reranker is the largest single inference line item. A cross-encoder's cost grows with candidate count and input length, so a smaller candidate pool runs meaningfully faster. Generation adds another important distinction between waiting for the first token and waiting for the completed answer. Halving output tokens cuts roughly half of generation latency, while halving input tokens produces only a small fraction of that gain.
Web search does not appear in this internal retrieval budget at all. A typical search API call adds 500ms or more on top of inference costs, introducing an external delay with a much wider spread. Machine-ready content delivered in a single call, as in Seltz's approach, removes the separate SERP and scraping stages that otherwise add to that delay. A pipeline can meet every internal allocation and still miss its end-to-end SLO whenever it makes an unbudgeted web search call.
Why web search is categorically harder to budget than internal retrieval
Traditional search APIs return material intended for navigation, including links, metadata snippets, and paid placements. An LLM needs clean, structured content for its reasoning step. When a SERP response supplies only the route to that content, the application must scrape the result URLs separately. The search call and scrape can fail independently, while retries and result stitching add further work. Separate providers can also mean two API keys and two billing cycles, although the latency problem remains the more immediate production constraint.
Bot-blocking and too little usable text can force retries or leave the application without useful evidence. Raw HTML extraction also brings in roughly double the text needed before de-boilerplating. That excess propagates into token counts and reranker input size, increasing costs in stages that already consume substantial time.
Providers vary enough in latency to make architecture a budget decision. The latency spread is on the order of 20× between the fastest and slowest, but median speed alone cannot settle the choice. A SERP API may be fast enough for many queries while slow or blocked results still drive tail-latency violations. Dirty context adds a separate risk because advertisements and navigation elements can contribute to inaccurate responses.
How to set a concrete web search sub-budget before writing any code
Start with the interaction's end-to-end ceiling rather than the search provider's average response time. A conversational assistant needs latency under roughly 1,000 ms to preserve conversational flow, while a voice agent has a tighter constraint. A document-analysis batch pipeline has a different budget because its interaction pattern is different. The latency target is therefore a product specification before it is an infrastructure metric. Applying the same target to all three would produce unnecessary engineering in some cases and inadequate responsiveness in others.
Next, subtract the fixed, measurable work from that ceiling. Account for LLM prefill and decode, internal retrieval through vector search, embedding, and reranking, network round-trips, and post-processing. What remains is the maximum time available for web search. If generation takes the majority of a conversational budget, search must stay well under half of the total. If the measured search stage cannot meet that remainder, the design is already in conflict with the product target.
Express this allocation at p95 or p99. CASCADE, published on arXiv in August 2026, treats available headroom as a per-request latency budget based on the SLO and predicted remaining service time. Its approach shows how average latency can hide how much more urgent some requests are than others. SAGE's August 2026 adaptive-retrieval research found that targeting P95 latency and varying retrieved passage counts improved P95 SLO compliance while cutting P95 latency. Together, these approaches support tracking the remaining budget per query and giving the search stage its own p99 alert, rather than treating its allocation as a static design aspiration.
Parallelism and speculative execution strategies that shrink the search stage
For external calls, overlapping work can reduce wall-clock time more effectively than optimizing the call itself. Sequential retrieval makes every stage wait for the previous one, so search latency adds directly to the user's delay. Speculative execution removes waiting from the critical path by allowing search to overlap with other pipeline work. A speculative search can still outlast the confidence threshold assumed for it, so overlap does not remove the need for a deadline.
When a task needs more than one search, concurrent fan-out lets the calls run at the same time. Their total wall-clock time is then the time the slowest call takes, rather than the time all the calls take added together. That is especially important for agents whose search costs would otherwise accumulate through sequential tool use. The sub-budget must account for the slowest call in the group, rather than assume that a typical single-call measurement describes the whole search stage.
Caching goes further by avoiding some retrieval work altogether. A semantic query cache can serve repeated or similar requests with a meaningful latency reduction, while a result cache can bypass the search call entirely on a hit. Result-cache hits may be less frequent, but their per-hit savings can be larger. AI gateways can move the repeated-query check earlier in the pipeline while managing throughput and semantic caching. These hit rates are meaningful rather than a majority, so uncached requests still need to meet the search sub-budget.
Graceful degradation policies for when the search stage exceeds its budget
A search budget is incomplete without a defined response when it expires. In production, teams can expect provider slowdowns, bot-blocking retries, slow rendering on script-heavy pages, and late speculative results. A soft timeout at the search sub-budget ceiling should trigger a fallback. A hard timeout at the end-to-end SLO minus minimum generation time should force a response using whatever context has been collected.
The fallback order depends on the request's freshness requirement. First, serve from the semantic cache when a slightly stale entry remains acceptable, since a result from hours ago is more useful than no result for most queries. Second, use only results returned within the soft timeout and reduce the candidate set passed to the reranker to fit the remaining budget. Third, generate from model knowledge alone with an explicit uncertainty signal that tells the user the information could not be verified in real time. This hierarchy preserves the strongest available grounding without presenting absent evidence as successful retrieval.
Such a path is a design requirement. Naive RAG pipelines can produce confident, well-structured answers grounded in wrong or absent documents, so missing retrieval is not a rare edge case. CASCADE makes the scheduling consequence visible by continuously updating per-request latency headroom. The same delay can be tolerable for one request and enough to break another's SLO. Track how often each fallback tier fires as well as total latency, because meeting end-to-end p99 by silently dropping to model-only generation leaves a retrieval problem hidden and unresolved.
What a web search API designed for RAG pipelines does differently to make these budgets holdable
Parallelism and degradation can compensate for a poorly matched search layer, but they cannot replace infrastructure designed for AI consumption. The required output is clean, structured, context-ready content within a predictable latency envelope. Raw HTML, navigational snippets, and pages that need a second rendering round-trip leave a lot of work to do beyond what looks like the search call. A wrapper also inherits the variance of the services it wraps. Owning the full data pipeline gives control over latency, quality, and failure modes together.
That control matters downstream as well as inside search. Filtering, ranking, and shaping content before it reaches the LLM cut token counts and reranker input size. A dual-engine approach that returns clean Markdown in place of raw HTML can use fewer tokens than raw extraction. Seltz owns its full data pipeline and delivers context-engineered, machine-ready web content, and it treats predictable latency and data ownership as part of the engineering work. Those choices address the earlier budget constraints, especially when search repeats across an agent's tool calls, without establishing a substitute for measuring performance under real workloads.
Production readiness also extends beyond response time. Enterprise teams need role-based access control, document-level permission enforcement, and options for Zero Data Retention. Stale permissions create a distinct failure in which a RAG index retrieves a document the user can no longer access. These requirements belong in the infrastructure assessment, but they do not establish that every platform implements them.
Dell Technologies engineers found that multi-query retrieval fusion added latency through query rewriting and larger candidate sets, while reranking and truncation largely neutralized the recall gains. The pipeline paid for improvements it discarded before the user saw them. The right infrastructure removes avoidable tradeoffs between speed and data quality, so engineers do not have to choose between a responsive application and evidence worth using.


