KDDI’s consumer RAG app, Buffmee, cut overall response latency by 38% and improved time‑to‑first‑token by roughly 18% through a systematic evaluation loop and prompt‑tuning workflow. Practitioners building generative AI services can adopt the same automated testing and log‑driven bottleneck analysis to meet strict latency targets while preserving answer groundedness.
RAG latency optimization: automated evaluation pipeline
The team replaced manual QA with a data‑driven framework built on the Gemini Enterprise Agent Platform Evaluation Service. By generating hundreds of test cases with an LLM‑as‑a‑Judge approach and applying the “Rule of Hundreds,” they created a benchmark dataset that measured answer reliability across the full document corpus (books, magazines, web media). This process raised groundedness scores by 25%, providing a quantitative baseline for further performance work.
Agentic log analysis to surface bottlenecks
Production logs were streamed into BigQuery using the Agent Development Kit (ADK) log analysis agent. The analytics surface highlighted two dominant contributors to latency: excessive skill‑division overhead and prompt bloat caused by large, multi‑page system prompts. Visualizing these factors allowed the engineers to iteratively trim the system prompt, inline necessary skills, and adjust sub‑agent routing. The resulting changes eliminated deep‑stack delays without degrading answer quality.
Four core technical practices
KDDI distilled their approach into four practices, the first of which was moving from scalar to binary evaluation of answer correctness. The remaining practices, while not detailed in the source, are implied to reinforce repeatable, measurable testing and continuous improvement.
Related CloudNinjas coverage: Google Cloud.
What This Means For Practitioners
Adopting a similar loop means you can:
- Instrument RAG pipelines with automated test generation to catch hallucinations early.
- Leverage cloud‑native log analytics (e.g., BigQuery) to pinpoint prompt‑related latency spikes.
- Iteratively refine system prompts and skill composition based on measurable impact.
- Track groundedness metrics alongside latency to ensure quality does not regress.
By treating evaluation and log analysis as continuous, automated stages, teams can achieve sub‑second response times even when grounding answers in large, heterogeneous content collections.


