The setup
The outline stage returns validated JSON. The draft stage writes each section separately, passing in the previous text for flow. The refine stage edits for repetition and can fact-check against a source file. Four guardrails then check length, outline-copying, structure and repetition. Tone, audience and length are configurable, and I ran it on three different topics.
Failure 1: 700 words requested, 1,004 delivered
My first fix was to trim the draft afterwards, but each pass removed only 10 to 20 words. The real cause was my own draft prompt, which demanded 2 to 3 paragraphs of 3 to 5 sentences per section. Five sections of that can never fit in 700 words. Scaling the paragraph rules to each section's word budget and adding a hard ceiling fixed it at the source.
Failure 2: my guardrails were wrong
I tested the checks with deliberately bad input. A pasted outline must fail the "not just the outline" check, and it did (12 of 12 key points copied). But testing also showed that my structure check wrongly flagged the one-paragraph conclusion, and my outline-copy threshold was too strict for short posts. A check you haven't tested against both bad and good output only measures your assumptions.
Failure 3: the fact-checker missed a real error
I planted three errors in a test draft, such as "PostgreSQL cannot store vectors", and the fact-checker found and fixed all three from the source file. Then I ran it on the real Transformer post. It reported zero issues, yet the post said attention scores are divided by the "inverse square root" of the key dimension. The correct operation is dividing by the square root. I caught it by reading the post myself.
Takeaways
- Fix length and quality problems in the prompt, where the content is created, not afterwards.
- Test your guardrails with bad input, or they prove nothing.
- LLM fact-checkers catch blatant contradictions but can miss subtle technical wording, so human review stays in the loop.
Read more
- Full write-up: How to Build an AI Content Pipeline: Why One Prompt Isn't Enough
- Code and all three generated posts: github.com/KRISH18833/ai-content-pipeline
