Read-only analytics agent on Flash Lite: 2.2% cache hit rate, full cost data

RedaHaloubi · reddit · 2026-09-17

Developer RedaHaloubi updates his read-only POS analytics agent (route→fetch→narrate→ground, Node/TS + Vercel AI SDK): after community feedback he parked HITL writes — preview ≠ confirm, idempotency + optimistic locks, fail closed near mutations — and won't add mutate tools until the read loop tightens.

Model & cost: still Gemini Flash Lite (cheap, only needs tool selection + small JSON reads + bilingual narration, not a reasoner). Typical ask (50 intent turns, one store, Redis miss): 4,840 input tokens, 0 Gemini cached input, 123 output tokens, 2 LLM round trips, 1 tool call, 2.3s wall time. Across n=229 runs, implicit cache hit only 2.2% overall, 0/96 on CORE-12, 0/51 on pinned — the prefix can cache but isn't, so he skipped a second model call.

Two open questions: ① dates — when the phrase table misses ("hier", "this month vs last"), pause with UI chips or keep defaults and name the window in the first sentence? ② bilingual routing — English keyword pins miss French queries; he's leaning toward EN+FR synonym tables on the same regexes, not translate-for-routing (mangles $/%). Full cost table included.

Related event: Read-only POS agent retrospective: cache hit rate near zero, writes on hold(2 posts)→

Original post →

More from coding & agent

coding & agent channel →