Google CloudProfessional Agentic Architect2026-093.2 Integrating enterprise domain knowledge
Balance the retrieval operating point
Completed by the knowledge check
Learning objective
Balance retrieval quality, freshness, latency, scalability, and cost for a production retrieval system. This lesson focuses on the combined operating point, not on choosing embeddings, tuning individual relevance controls, adding reranking, or selecting a retrieval product.
Core idea
Treat retrieval design as a constraint envelope, not a search for one maximum score. Define the quality floor, maximum visibility lag, latency and cost ceilings, and expected load and corpus size. Then choose the least costly configuration that stays inside every hard boundary.
A configuration outside one boundary is not balanced. Perfect relevance that misses the deadline is unusable, as is a fast index containing yesterday’s withdrawn policy. Capacity may protect peak latency, but it raises cost.
Optimize by query class when requirements differ. A live incident alert and an archived manual should not inherit the same freshness target merely because one agent searches both.
Define a measurable envelope
Use a separate metric for each dimension:
| Dimension | Example measure | Question it answers |
|---|---|---|
| Quality | Recall@K, NDCG@K, grounded-answer rate | Does useful evidence reach the model, and is it ordered well? |
| Freshness | p95 indexing lag; stale-result rate | How long after an accepted source change can retrieval use it? |
| Latency | p95 and p99 retrieval latency | Do ordinary and tail requests meet the response budget? |
| Scalability | Peak queries per second (QPS) and corpus size within all other targets | Does the operating point survive growth and bursts? |
| Cost | Cost per 1,000 queries plus ingestion, index, storage, and reranking cost | What does the complete retrieval path consume? |
Freshness is visibility lag, not update frequency. Measure from the accepted source version to its first successful retrieval; parsing, embedding, queuing, and index propagation all count. Google Cloud recommends monitoring data age and update frequency against service-level agreements, as well as RAG context relevance, groundedness, and vector-query throughput, in its AI and ML reliability guidance.
Scalability is not a synonym for low latency. It is the ability to preserve the other targets at forecast corpus size, peak QPS, and concurrent ingestion. Test tail latency because saturation can disappear inside an average.
Move the operating point deliberately
Start with a representative labeled query set and an exact or high-effort baseline on a sample. This separates relevance problems from approximation loss. Load-test while updates run, then change one class of lever at a time:
- Search effort: Searching more candidates or index partitions can improve approximate-nearest-neighbor recall, but it usually processes more data. Vector Search documents that increasing
approximateNeighborsCountor the fraction of leaf nodes searched can increase recall, latency, and cost; see query-time performance settings. - Freshness path: Streaming or incremental updates reduce visibility lag for volatile content but add update work. Batch updates suit stable content. Vector Search streaming updates become queryable after a short delay and incur update and later compaction costs, as described in Update and rebuild an active index.
- Serving capacity: More or faster replicas protect throughput and tail latency but increase compute cost. Autoscaling improves utilization; the minimum replica count controls ready burst capacity. A maximum replica count caps spend at the risk of higher latency or lower availability; see Vector Search deployment settings.
- Work avoided: Restricting the eligible corpus, routing simple queries to a smaller index, or caching stable permitted results can reduce work. Test every shortcut for quality. A cache also needs invalidation that satisfies freshness and authorization requirements.
Trace cost across ingestion and serving. Google Cloud identifies index size, QPS, node count, and machine type as Vector Search cost drivers and recommends autoscaling to improve utilization; see its cost and performance considerations.
Choose a point on the measured trade-off curve only after it meets every hard target. Re-run the experiment when query mix, corpus size, embedding version, or traffic shape changes.
Key distinctions and trade-offs
Retrieval quality versus answer quality: Retrieval metrics evaluate the evidence selected. Grounded-answer evaluation checks how the model uses that evidence. Improving one does not guarantee the other, so measure both.
Freshness versus consistency: Low visibility lag says an update appears quickly. It does not prove that replicas, related chunks, or caches show the same version. Define transition behavior for deletions and policy changes.
Latency versus throughput: Latency measures time per request; throughput measures completed work per unit time. A system can be fast at low QPS and miss its tail-latency target when concurrent load saturates it.
Unit cost versus total cost: A cheaper query can still produce a larger bill as usage grows. Track both unit cost and the total budget.
Architecture / decision scenario
A global support agent searches 30 million product-document chunks. Ordinary manual revisions must become searchable within 24 hours. Safety bulletins must appear within two minutes. At a forecast burst of 1,200 QPS, the requirements are at least 90% Recall@20, p95 retrieval latency below 150 ms, and a fixed monthly budget.
The team schedules incremental updates for manuals and streams safety bulletins. It records source-acceptance and searchable timestamps to measure lag. Product and region metadata restrict the search space. Stable manual results may be cached with version-aware invalidation; safety results are not.
Against an exact baseline, the team increases ANN search effort only until Recall@20 clears 90%. It load-tests that setting during concurrent ingestion. Autoscaling handles sustained growth, while ready replicas cover the expected burst. The maximum replica count keeps the deployment inside its cost ceiling.
The design meets all five targets. Streaming the entire corpus would buy freshness that manuals do not require. Maximizing recall or provisioning for an unbounded peak would also spend outside the stated constraints.
Common exam traps
- Maximizing retrieval quality before defining latency, freshness, and cost constraints.
- Calling a frequent ingestion schedule a freshness guarantee without measuring end-to-end visibility lag.
- Testing latency at average traffic while ignoring peak QPS, corpus growth, concurrent updates, and tail percentiles.
- Treating more replicas as a quality improvement. Capacity primarily changes throughput, latency, availability, and cost.
- Caching retrieval results without considering source updates, deletions, or authorization changes.
- Using one operating point for query classes with different risk and freshness needs.
- Comparing infrastructure cost while omitting embedding, update, reranking, storage, and downstream context costs.
What to remember
- Define a constraint envelope with explicit targets for all five dimensions.
- Measure freshness as source-to-search visibility lag and scalability under peak load, growth, and concurrent ingestion.
- Use exact or high-effort retrieval as a quality baseline, then spend search effort only until the required quality floor is met.
- Separate volatile and stable content when their freshness value differs.
- Choose and continuously verify the least costly operating point that remains inside every hard boundary.
Knowledge check
An ingestion job runs every minute, yet changed documents take twelve minutes to become retrievable. The freshness requirement is five minutes. Which measurement determines compliance?
Retrieval meets quality and latency targets at low QPS but misses p99 during bursts with concurrent ingestion. Which experiment tests the claimed operating point?
A retrieval cache returns a previously permitted document after its access rights are revoked. Which cache requirement was missed?
References
- Google Cloud, Query-time settings that impact Vector Search performance
- Google Cloud, Update and rebuild an active index
- Google Cloud, Deployment settings that impact Vector Search performance
- Google Cloud Architecture Center, RAG infrastructure using Agent Platform and Vector Search
- Google Cloud Architecture Center, AI and ML perspective: Reliability