This workflow is designed to automatically generate a short, engaging paragraph for a given webpage or topic. The generated paragraph contains links to the most relevant articles on your website, helping visitors seamlessly navigate to related content. This automation is especially useful for scaling the creation of “Related Articles” sections, boosting user engagement, and improving SEO by interlinking your content efficiently and consistently.
Workflow Overview
The process can be summarized in the following steps:
User Interaction & Welcome
- When the chat is opened, the user is greeted with a welcome message. This message explains the tool’s purpose and prompts the user to enter a topic or URL.
Input Handling
- The user provides a topic or a webpage URL via a chat input widget.
Initial Document Retrieval
- The system retrieves the most relevant document(s) from your website’s knowledge base using the user’s input as a query. This gives the workflow an initial context about the topic.
Prompt Construction (Contextualization)
- A prompt template combines the user’s input and the retrieved document(s) to create a context-aware query.
Related Articles Retrieval
- Using the contextualized prompt, the system retrieves up to 6 of the most relevant articles (excluding the current page) using a second document retriever. The content structure (H1-H4) is considered to ensure relevance.
Paragraph Generation Prompt
- A refined prompt template is prepared for the AI generator. This template instructs the language model to:
- Write as a skilled, easy-to-understand copywriter.
- Avoid generic or overly sophisticated language.
- Write a paragraph with 2 sentences per related article.
- Turn the most relevant keyword for each article into a markdown link.
- Exclude the current page from the related articles.
- Output in the same language as the related articles.
- If there are no related articles, return a single space character.
- A refined prompt template is prepared for the AI generator. This template instructs the language model to:
Keyword Extraction
- The retrieved related articles are analyzed for keyword frequency, identifying the most useful keywords to be used as anchor text for links in the final paragraph.
Final Prompt Assembly
- Another prompt template incorporates the top keywords and the context for the AI generator.
AI Generation
- A text generation model (LLM) processes the prompt and outputs the final paragraph containing embedded links to related articles.
Output Display
- The generated paragraph is displayed to the user as a chat message, ready to be used on your website.
Workflow Structure (Table)
| Step | Component | Purpose |
|---|---|---|
| 1. Chat Opened | ChatOpenedTrigger + MessageWidget | Greet user and introduce functionality |
| 2. User Input | ChatInput | Capture topic or URL from user |
| 3. Retrieve Main Document | DocumentRetriever (1 doc) | Find most relevant document for context |
| 4. Build Initial Prompt | PromptTemplate | Combine input and context for further retrieval |
| 5. Retrieve Related | DocumentRetriever (6 docs) | Get up to 6 most relevant related articles |
| 6. Prepare Paragraph Prompt | PromptTemplate (detailed instructions) | Instruct AI on how to generate the paragraph with links |
| 7. Extract Keywords | KeywordFrequencyEvaluator | Find top keywords for anchor text |
| 8. Assemble Final Prompt | PromptTemplate | Merge keywords and context for AI generation |
| 9. Generate Paragraph | Generator (LLM) | Generate the related articles paragraph |
| 10. Display Output | ChatOutput | Present the result to the user |
Why This is Useful
Scalability:
Automates the creation of related articles paragraphs for any page or topic, saving manual editorial time.Consistency:
Ensures every page receives a consistently formatted, high-quality related articles section.SEO & Engagement:
Smart internal linking through relevant keywords as anchor text helps with SEO. Engaging, contextual suggestions keep users browsing your site longer.Localization:
The paragraph is generated in the same language as the related articles, supporting multilingual sites.Customization:
Prompts are carefully crafted to avoid generic filler text and to focus on actionable, helpful suggestions for readers.
Ideal Use Cases
- Blogs or news sites wanting automatic “What to Read Next” paragraphs.
- E-commerce sites suggesting related guides or product pages.
- Knowledge bases or documentation sites guiding users to related help topics.
- Any website with a large content library seeking to improve navigation and SEO with minimal manual work.
Automation Flow Diagram (Simplified)
flowchart LR
A[User opens chat] --> B[Welcome message]
B --> C[User enters topic or URL]
C --> D[Retrieve main document for context]
D --> E[Build context-aware prompt]
E --> F[Retrieve related articles (up to 6)]
F --> G[Extract top keywords]
G --> H[Create AI prompt with links/keywords]
H --> I[AI generates paragraph]
I --> J[Display paragraph to user]
Summary
This workflow leverages document retrieval, prompt engineering, keyword analysis, and generative AI to automate the creation of high-quality, linked “Related Articles” paragraphs. It is a robust solution for any content-rich website looking to scale and optimize internal linking and user engagement with minimal effort.




