The gap between a working prototype and a production pipeline
Intent extraction is not optional
The latency problem is almost always in the wrong place
- Intent extraction (Gemini Flash): ~80ms
- Embedding the query (e5-base-v2): ~120ms
- pgvector retrieval: ~340ms
- LLM response generation: ~600ms (streaming, so perceived latency was lower)
Redis saved me, but not how I expected
Streaming makes latency feel irrelevant
Observability is the real infrastructure
- The raw query
- The extracted intent (structured filters)
- Which products were retrieved and their similarity scores
- The latency of each step
- Whether the user engaged with the result
RAG in production is not a hard engineering problem. It's a systems problem of latency, caching, observability, and feedback loops, wrapped around what looks like a simple search feature.
The demo took an afternoon. The production version took three weeks. Both were worth it.