Back
Content & Media Generation

A Five-Step AI Pipeline That Turns One Keyword Into a Fully Illustrated, Publish-Ready Article

How Pfactorial Technologies built an AI article generator that takes a single keyword through topic discovery, subtopic drafting, full article generation, and image creation for content and marketing teams.

August 21, 2026
Share
ENGAGEMENT SNAPSHOT

Pfactorial_Case_Study_Article_Generator image 1
Figure 1 - Key figures from this engagement, at a glance.
EXECUTIVE SUMMARY
Our client base spans content and marketing teams that need to produce blog posts, SEO articles, product descriptions and educational content at a pace that manual research and writing can't sustain, especially in fast-paced environments where full research and critical thinking for every piece isn't always feasible.
A single prompt asking a model to write an article about a topic would not have solved this: it produces generic, unstructured output with no user control over direction, when the actual need was a guided pipeline where a person steers topic and subtopic selection at each stage while the model handles research synthesis, drafting and illustration.
Pfactorial built the Article Generator, a five-step pipeline - keyword search, content selection, blog topic selection, article generation, and image generation - chaining GPT-3.5-turbo for text and DALL-E 2 for imagery, with the output of each step feeding the next and the user choosing direction at each handoff.
Why this engagement is representative This engagement demonstrates Pfactorial's ability to turn a single LLM call into a controllable, multi-stage content pipeline - user-directed at each stage rather than a one-shot prompt - applicable anywhere content needs to scale without losing editorial control.
THE CHALLENGE
Turning a keyword into a finished, illustrated article meant solving problems that a single prompt-and-response call can't.

1. A single prompt produces generic output with no editorial control

Writing "generate an article about X" in one call gives the user no say over which angle, subtopic or direction the piece actually takes.

2. Each stage needs the previous stage's output as its own input

Topics have to inform subtopics, and subtopics have to inform the introduction, conclusion and section text, chained rather than generated independently.

3. Text and image generation are two different models with two different jobs

The article draft comes from a language model while the accompanying image comes from a separate image-generation model, and the pipeline has to hand off cleanly between them.
The real brief Not "generate an article from a prompt" but "let a user steer a multi-stage pipeline - topic, then subtopic, then article, then image - so the output reflects an actual editorial choice at each step, not just whatever the first prompt happened to produce."
THE SOLUTION
Pfactorial built the Article Generator as a five-step pipeline, where the model's output at each stage becomes the input to a custom prompt at the next, with the user choosing direction between steps.
Pfactorial_Case_Study_Article_Generator image 2
Figure 1 - Each step's output feeds the next step's custom prompt, with the user choosing direction between topic, subtopic and final article.

Architectural principles

  • User-directed, not one-shot - The user selects a topic and one or more subtopics between pipeline stages, so the final article reflects an actual editorial choice rather than the first thing the model returned.
  • A custom prompt per stage, not one generic instruction - Keyword search, subtopic generation, introduction, conclusion and section drafting each get their own purpose-built prompt rather than a single generic instruction reused throughout.
  • Output chains forward - Each function's result becomes the next function's input - topic into subtopic, subtopic into introduction, conclusion and section text - so later stages stay grounded in what was actually selected.
  • Text and image generation are separated by design - Article drafting runs on a language model while the accompanying image runs on a dedicated image-generation model, keeping each stage focused on the job it's actually good at.
CAPABILITIES DELIVERED
Each capability in the pipeline is exposed as its own function and endpoint, so it can be composed or integrated independently.
CAPABILITY
WHAT IT DOES
Keyword-to-topic search
Returns a list of topics related to a user-supplied keyword via the Search_topic function.
Subtopic generation
Returns subtopics related to a selected topic via the blog_section function.
Introduction & conclusion drafting
Generates a topic-specific introduction and conclusion via model_introduction and model_conclusion.
Section drafting
Generates the article body for each selected subtopic via section_texts.
Accompanying image generation
Generates an image for the article from the selected topic using DALL-E 2.
Pfactorial_Case_Study_Article_Generator image 3
Figure 2 - The pipeline exposes each stage - search, topic selection, section - as its own API endpoint.
Design note The pipeline was deliberately kept multi-step rather than collapsed into one call: it costs an extra round trip per stage, but it's what lets a user redirect the output - picking a different subtopic, for instance - without regenerating the entire article from scratch.
ENGINEERING FOR SCALE AND RELIABILITY
Four decisions shaped the pipeline as a set of composable functions rather than a monolithic generation call.

A dedicated function per pipeline stage

Search_topic, blog_section, model_introduction, model_conclusion and section_texts are each independent functions, so a stage can be revised or swapped without touching the others.

Three endpoints instead of one

The search, topic-selection and section endpoints each accept the previous stage's output and return the next stage's result, matching the pipeline's user-directed, multi-step shape.

A managed model for both text and image, not a self-hosted model

GPT-3.5-turbo-0125 for text and DALL-E 2 for imagery removed the need to train or host a custom model, at the cost of an ongoing usage-based API bill as volume scales.

Stateless functions composed by the caller, not a hidden internal state machine

Each function takes an explicit input and returns an explicit output, so the calling application controls sequencing and can persist or replay any stage without hidden pipeline state.
DELIVERY APPROACH
The pipeline was built stage by stage, in the order a user actually moves through it.
1. Keyword search - building Search_topic and the / endpoint to return related topics for a user-supplied keyword.
2. Topic and subtopic selection - building blog_section and the /topics endpoint to return subtopics for a selected topic.
3. Article generation - building model_introduction, model_conclusion and section_texts, chained behind the /section endpoint.
4. Image generation - adding Generate_image on DALL-E 2 to produce an accompanying image for the selected topic.
RESULTS AND IMPACT

Pfactorial_Case_Study_Article_Generator image 4
- Key outcomes from this engagement.
The pipeline delivers a complete set of outputs from one starting keyword - topics, subtopics, a full article with introduction, section text and conclusion, and an accompanying image - with the user directing which topic and subtopics carry forward at each stage.
Because each stage is its own function behind its own endpoint, the pipeline composes cleanly into the use cases it targets - content marketing, SEO articles, news production, product descriptions and educational materials - without requiring a rewrite for each one.

What it enabled commercially

Teams that need to scale content production gain a guided pipeline that compresses topic research and first-draft writing into a few directed selections, while keeping model-usage cost visible and predictable as the primary ongoing expense to plan around.
WHY PFACTORIAL
This engagement sits within Pfactorial's applied generative-AI product practice: composing managed models into a multi-stage, user-directed pipeline rather than a single unconstrained prompt, so editorial control is retained even as generation is automated.
Pfactorial_Case_Study_Article_Generator image 5
- Service lines this engagement draws on.
Engagement enquiries Pfactorial Technologies works with content, marketing and publishing teams that want AI-assisted drafting without losing editorial control over direction. If you're evaluating an AI content pipeline, we're happy to give you an honest read on scope and risk before anyone commits to anything. · pfactorial.ai
APPENDIX A - TECHNOLOGY STACK
The technology stack underpinning the system, grouped by the layer it serves.
Pfactorial_Case_Study_Article_Generator image 6

Result and Analysis

ENGAGEMENT SNAPSHOT

How Pfactorial Technologies built an AI article generator that takes a single keyword through topic discovery, subtopic drafting, full article generation, and image creation for content and marketing teams.

Pfactorial_Case_Study_Article_Generator image 1
Pfactorial_Case_Study_Article_Generator image 2
Pfactorial_Case_Study_Article_Generator image 3
Pfactorial_Case_Study_Article_Generator image 4
Pfactorial_Case_Study_Article_Generator image 5
Pfactorial_Case_Study_Article_Generator image 6