What Breaks First in AI-Built Apps
AI-built apps break first at authorisation, database access rules, leaked secrets and unverified payment webhooks, not at the feature they were built to demo. They fail at the thing nobody demonstrate

Retrieval-augmented generation is the default architecture for most production LLM applications now, and for good reason: it's how you get a model to answer from your data instead of its training set. But the demo-to-production gap for RAG is brutal, and it fails in a specific way. The prototype works on the ten documents you tested with, ships against ten thousand, and starts returning confidently wrong answers. Nobody files a bug, because the answer looks right. You find out from a support ticket, or worse, from a customer who acted on it.
The uncomfortable truth is that most RAG failures are retrieval failures, not model failures. When RAG returns a bad answer, the instinct is to blame the LLM or reach for a bigger model. The real problem is upstream in most cases: the retrieval step handed the model the wrong context, and no model can reason its way out of a bad set of source documents. That is the through-line for everything below and the core of how we approach RAG systems: fix retrieval quality first, then grounding, then everything else.
The canonical starter RAG is three steps: chunk your documents, embed them into a vector database, and at query time embed the question and return the top-K most similar chunks. It works beautifully in a notebook and degrades sharply the moment your corpus grows.
The problem is that pure vector similarity is a blunt instrument. Top-K nearest-neighbour search returns chunks that are semantically near the query but don't contain the answer, and misses the chunk that does when it phrases things differently from the question. As the corpus grows, near-misses crowd out real hits, and the model synthesizes a plausible answer from whatever you handed it. That's the silent failure.
Two fixes matter more than any model upgrade:
The second place RAG systems break is ingestion. The lazy default, splitting every document into fixed-size chunks of N tokens, treats a legal contract, a support article, and a table of figures identically. A fixed chunk boundary drawn through the middle of a table, a code block, or a numbered clause destroys the meaning the retriever needs.
Documents have structure, and good chunking respects it: split on headers and sections, keep tables and lists intact, carry section metadata with each chunk so retrieval can filter by it. Query-document length asymmetry matters too; a short question and a long document do not embed the same way, and the strategy should account for that.
There's an operational dimension people forget: ingestion is not a one-time job. Documents get updated, superseded, and deleted. If your pipeline does not handle re-ingestion and deletion, your vector store fills with stale chunks that outrank the current answer: a data-freshness bug that looks exactly like a model bug.

A recurring architectural mistake is treating the vector database as the system of record. It isn't. A vector DB is a cache of embeddings; the source of truth lives in Postgres or a document store. Embeddings get recomputed when you change your embedding model or chunking strategy, and you will change both, so anything you cannot rebuild from the source of truth is data you risk losing.
Which vector store to use is a per-project decision, not a default:
If you are weighing these against your real constraints (scale, cost, existing infrastructure), our Tech Stack Picker walks the trade-offs without a sales call attached.
A RAG answer with no source is an assertion, and users have learned not to trust ungrounded LLM assertions. Citation is what makes the system usable, not a nice-to-have bolted on at the end. When every answer links back to the chunk and document it came from, users can verify, and verification drives adoption. Citations also give you a debugging handle: when an answer is wrong, you can see which retrieved chunk led the model astray and whether the failure was retrieval or synthesis.
Grounding goes a step further: detecting when the retrieved context does not support an answer, and having the system say "I don't have that" instead of confabulating. Confidence scoring and hallucination-detection patterns let you draw that line by design rather than hoping the model draws it for you.
This is the discipline that separates RAG systems that stay good from ones that rot. RAG quality degrades silently: a corpus change, an embedding-model swap, a chunking tweak, or a prompt edit can each regress retrieval without warning, and without evaluation you find out from your users.
An eval harness is not exotic: a ground-truth dataset of representative questions with known-relevant source documents, run against the pipeline on every meaningful change. Frameworks like Ragas exist for this, and custom evals are often worth building for your domain. The point is regression testing for retrieval: when someone changes the chunker, the eval tells you whether retrieval got better or worse before it ships. Treat it like unit tests, because that's what it is for a RAG system.
RAG shows up across industries (internal knowledge bases, customer-facing assistants, document search, regulatory lookups), and in regulated domains the compliance requirement reshapes the design rather than sitting on top of it. HIPAA-architected healthcare retrieval, for example, keeps the source of truth in a compliant data store, treats the vector DB strictly as a cache, and designs the ingestion and access path around the compliance boundary from the start. That is the same pattern that makes RAG good in general, which is why building for compliance and building for quality tend to converge. Our stance is on the HIPAA page, and if you're wiring RAG into existing data sources, the Integration Readiness Checker names the real risks before you start.
For a team taking RAG from prototype to production, the order matters:
RAG also sits inside larger AI systems, as a retrieval tool inside an agentic workflow, or one piece of a broader AI/ML build, and the same retrieval-first discipline carries over.
If you're scoping a RAG build and want the architecture right before writing code, a Discovery Sprint is the right container. If you already have RAG in production and suspect it's failing silently, a Tech Audit diagnoses retrieval quality, grounding, and eval coverage. And if you need senior engineers who think in retrieval quality rather than embeddings, that's what our staff augmentation is for.
The teams that win with RAG aren't the ones on the newest model. They're the ones who treated retrieval as the hard part: hybrid search with re-ranking, structure-aware chunking, a vector store used as a cache with a real source of truth behind it, citations that build trust, and an eval harness that catches regressions before users do. Build that, and RAG becomes a durable asset instead of a demo that quietly stopped working.
Written by
Senior Software Engineer
Senior software engineer at Robust Devs, working across PHP, Laravel, ReactJS, and AWS.
AI-built apps break first at authorisation, database access rules, leaked secrets and unverified payment webhooks, not at the feature they were built to demo. They fail at the thing nobody demonstrate
A code audit report earns its fee when it contains four things: an executive summary the person paying can act on, findings ranked by severity that cite specific files and lines, an architecture asses
Technical due diligence rarely kills a round. It re-prices one, and it does so at the worst possible moment: after the term sheet exists, when the fund has already decided it wants in and you have alr

Tactical writing for founders building AI products. Browse the archive for more field notes like this one.
Browse all articlesIf you are building in this space, book a call or get in touch.