Why one RAG pipeline kept crashing: no fixed data format between steps
A developer's pipeline went down three times in one month, and the root cause was identical each time: no fixed contract for what data should look like when one stage hands it off to the next. In the first crash, the retrieval stage returned plain sentences instead of scored, ranked chunks, and the error only surfaced two stages later. In the second crash, after a small prompt tweak, the entity-extraction stage silently dropped two fields; the summarizer then received nulls and confidently invented plausible-looking content to fill the gaps, masking the failure.
In the third crash, a agent returned a flat string where the workflow expected structured, typed JSON. Each incident took about two hours to trace but only one line of code to fix. In every case, one stage's output shape changed while the next stage kept assuming the old shape, and nothing caught the mismatch until it reached production.
The developer says this problem only became a real concern after building enterprise-style workflows with an agent builder, where the hard part isn't getting one agent to answer well — it's preventing every handoff between stages from silently changing shape. Adding JSON schema contracts at each handoff point is what finally stopped the recurring failures. A schema won't fix flawed reasoning, but it does catch structural drift before it turns into a production incident.
Key points
- A crashed three times in one month, each time from the same root cause: silent format drift between pipeline stages
- Retrieval returned plain sentences instead of ranked chunks; the error wasn't caught until two stages later
- A prompt tweak caused the extraction stage to drop fields, and the next stage masked the failure by filling in plausible-looking fake data
- A agent returned a flat string instead of the expected typed JSON
- Adding JSON schema contracts between stages stopped the crashes — schemas catch structural drift even though they can't fix bad reasoning