AI & RAG Pipeline
RankWriting doesn't just send a prompt to an AI. It runs a multi-stage augmented generation pipeline that grounds every article in real data.
Overview
User submits keywords
↓
① Web research
↓
② Knowledge Base retrieval (RAG)
↓
③ Internal links & brand context injection
↓
④ Claude AI writes the article
↓
⑤ Media enhancement (images / videos)
↓
Published to WordPress / Shopify
Stage 1 — Research
The system researches the target topic using live web sources, extracting recent facts, statistics, and credible references. These are injected into the prompt so the article is grounded in real information rather than the AI's training data alone.
Stage 2 — RAG retrieval
If a Knowledge Base is configured, the system uses vector similarity (pgvector) to retrieve the 5 most relevant content passages and injects them as brand-specific context.
Stage 3 — Context assembly
The following context is assembled into the prompt:
- ·Research data and sources
- ·Knowledge Base retrieval results
- ·Brand Profile (tone, audience, blocked keywords)
- ·Internal link candidates (from published articles)
- ·Brand page link candidates
- ·User-defined outline and Q&A answers
Stage 4 — Generation (Claude AI)
Claude writes the full article and returns a strict JSON object: title, meta_title, meta_description, and content (HTML).
Stage 5 — Media enhancement
After the text is generated, Claude Haiku quickly decides image and video placement, search queries, and ALT text. Images are fetched from Pexels and videos from YouTube, then injected into the article HTML.
Why this matters
Generic AI writing tools send one prompt and hope for the best. RankWriting's pipeline ensures every article has real sources backing it up, while still sounding like your brand.