AI Content PipelineAI Workflow
Ingest RSS feeds, classify articles by topic with AI, render prompts from templates, generate summaries with an LLM, and validate outputs with guardrails. A full content processing chain.
Prerequisites
Environment variables
OPENAI_KEYInstall
npx radzor@latest recipe add ai-content-pipelineAI Prompt
“Run `npx radzor@latest add rss-feed ai-classifier prompt-template llm-completion guardrails` to install 5 Radzor components. Then read components/radzor/rss-feed/radzor.manifest.json, components/radzor/ai-classifier/radzor.manifest.json, components/radzor/prompt-template/radzor.manifest.json, components/radzor/llm-completion/radzor.manifest.json, components/radzor/guardrails/radzor.manifest.json and each component's llm/integration.md. Wire them together to ingest RSS feeds, classify articles by topic with AI, render prompts from templates, generate summaries with an LLM, and validate outputs with guardrails. A full content processing chain. Use the manifest's inputs (check envVar for required environment variables), outputs (check fields for object shapes), composability (check mapField for field extraction), and actions — don't invent custom interfaces.”
Paste this into Claude Code, Cursor, Windsurf, or any AI coding agent.
Pipeline
RssFeed
Watches RSS feeds for new articles
AiClassifier
Classifies article topic
PromptTemplate
Renders a summarization prompt
LLMCompletion
Generates the summary
Guardrails
Validates output for safety
Scaffolded Code
// npx radzor@latest add rss-feed ai-classifier prompt-template llm-completion guardrails
import { RssFeed } from "./components/radzor/rss-feed"
import { AiClassifier } from "./components/radzor/ai-classifier"
import { PromptTemplate } from "./components/radzor/prompt-template"
import { LLMCompletion } from "./components/radzor/llm-completion"
import { Guardrails } from "./components/radzor/guardrails"
const feed = new RssFeed({ defaultPollIntervalMs: 300_000 })
const classifier = new AiClassifier({ apiKey: process.env.OPENAI_KEY!, mode: "llm" })
const prompts = new PromptTemplate({})
const llm = new LLMCompletion({ provider: "openai", apiKey: process.env.OPENAI_KEY!, model: "gpt-4o", maxTokens: 512 })
const guard = new Guardrails({ enableBuiltinRules: true, maxOutputLength: 2000 })
// Define categories
classifier.defineCategory("tech", "Technology and software articles")
classifier.defineCategory("business", "Business and finance articles")
classifier.defineCategory("science", "Science and research articles")
// Register prompt template
prompts.register("summarize", `Summarize the following {{category}} article in 3 bullet points.
Title: {{title}}
Content: {{content}}
Be concise and factual.`)
// Process new RSS items
feed.on("onNewItem", async (item) => {
// 1. Classify the article
const { category } = await classifier.classify(item.title + " " + (item.description ?? ""))
// 2. Render the prompt
const { text: prompt } = prompts.render("summarize", {
category,
title: item.title,
content: item.description ?? "",
})
// 3. Generate summary
const { content: summary } = await llm.complete(prompt)
// 4. Validate output
const validation = guard.validateOutput(summary)
if (!validation.passed) {
console.warn("Guardrails blocked:", validation.violations)
return
}
console.log(`[${category}] ${item.title}\n${summary}`)
})
// Start watching
await feed.watch("https://hnrss.org/newest?points=100")Components used
LLM tip
Pass all 5 radzor.manifest.json files to your agent at once. It will read the outputs of each step and match them against the inputs of the next — wiring the full pipeline without any extra instructions.