A water operations API feels slow, and engineers disagree whether prompt assembly, retrieval, or foundation-model completion dominates. Which practice best drives latency reduction?
Select an answer to reveal the explanation.
Short Explanation
You cannot fix a leak until you find which pipe is hissing. Profile prompt-to-completion latency across the water ops path so you optimize the real bottleneck, not a guess.
Full Explanation
When a water operations API feels slow and engineers disagree whether prompt assembly, retrieval, or foundation-model completion dominates, the correct first practice is to profile prompt-to-completion latency across services. Stage timings locate the true bottleneck so optimization effort hits the critical path—prompt construction, OpenSearch, network, Bedrock invocation, or post-processing—rather than guesses.
Rewriting unrelated billing screens first because they are easier to change does not address the water-ops GenAI path. Increasing every timeout blindly so slow calls simply wait longer masks symptoms and can worsen user-visible hangs without fixing root latency. Assuming the foundation model is always the only bottleneck without measuring other stages often misattributes delay when retrieval or prompt assembly is actually dominant.
Exam caveat: Profile before optimizing; blind timeout inflation and assumed single bottlenecks are common wrong answers. Operational check: emit spans for prompt build, retrieval, FM call, and render; dashboard p50/p95 per stage; pick the top contributor for the next sprint; re-measure after each change to confirm improvement on the water ops path.