Writing

Flarum Forum – AI-Powered Reply Generation, Scheduling & Automation

by rajesh · updated 10/19/2026

Prompt

# Flarum Forum – AI-Powered Reply Generation, Scheduling & Automation

## Objective

Build and deploy a fully automated, research-driven forum reply system for the existing Flarum installation. The system must generate exactly **one high-quality, relevant, expert-level reply per discussion thread**, schedule publication, and continuously process new and pending discussions without manual intervention.

The goal is to complete the existing forum backlog as efficiently as possible while maintaining genuine value, strict publishing limits, and long-term automation.

## 1. Flarum Extension Setup

- Install, configure, and enable the **Friends of Flarum Drafts (`fof/drafts`)** extension.
- Enable scheduled publishing and configure the required Flarum scheduler/cron jobs.
- Verify compatibility with the installed Flarum version.
- Test draft creation, scheduling, automatic publication, and error handling before bulk processing.
- Preserve existing discussions, users, settings, and forum functionality.

## 2. Process All Existing Discussions

- Scan every existing discussion across all forum categories and tags.
- Read the original question, description, and existing replies to understand the context.
- Generate **exactly one new reply per eligible discussion**, regardless of the total number of existing replies.
- Never generate multiple automated replies for the same discussion.
- Track processed, scheduled, published, failed, and pending discussions in a persistent database or tracking system.
- Skip discussions already processed by this automation, locked discussions, and threads where posting is not permitted.

## 3. Mandatory Reply Quality Standards

Every generated reply MUST:

- Use natural, fluent, human-readable language, avoiding robotic or repetitive AI-generated phrasing.
- Directly address the specific question or problem raised in the discussion.
- Provide genuinely useful, accurate, practical, and expert-level information.
- Demonstrate relevant research, technical understanding, or credible real-world examples.
- Include actionable solutions, explanations, recommendations, or troubleshooting steps where appropriate.
- Reference credible research, documentation, or authoritative sources by name when relevant.
- Be context-aware, original, informative, and appropriately detailed.
- Avoid generic responses, filler, keyword stuffing, promotional language, and unnecessary repetition.
- **NEVER contain URLs, hyperlinks, domain names used as links, or promotional links.**
- Never fabricate facts, research findings, references, personal experiences, or expertise.

Apply automated quality validation before scheduling. Regenerate replies that fail these requirements. Clearly identify automated contributor accounts rather than presenting them as independent human users.

## 4. User Account Management

- Use authorized contributor accounts for publishing replies.
- Create additional clearly identified contributor accounts if required and permitted by the forum configuration.
- **Each account MUST publish replies in no more than 100 distinct discussion threads in total.**
- Maintain persistent account usage counters.
- Automatically select an eligible account for each scheduled reply.
- Prevent duplicate responses and account-limit violations.

## 5. Publishing and Scheduling Rules

- **Maximum 50 published automated replies per calendar day across the entire forum and all accounts combined.**
- Use Friends of Flarum Drafts to prepare and schedule replies in advance.
- Distribute scheduled publications throughout the day rather than publishing everything simultaneously.
- Queue additional replies for subsequent days whenever the daily limit is reached.
- Track scheduled publishing slots and prevent overlapping jobs from exceeding the limit.
- Use the forum's configured timezone consistently.
- Automatically detect failed publications and retry safely without duplicating replies.

**Important:** Generate and schedule the existing backlog as quickly as system capacity permits, but never exceed the daily publishing limit.

## 6. DeepSeek AI Integration

Develop a production-ready automation script using **DeepSeek API** for research-assisted reply generation.

- Read API credentials, model configuration, forum connection settings, and publishing limits from a secure `.env` file.
- Never hardcode or expose API keys.
- Retrieve discussion content using supported Flarum APIs or appropriate backend integrations.
- Use DeepSeek to generate contextual, technically accurate replies.
- Validate generated output before creating scheduled drafts.
- Implement API retries, rate-limit handling, logging, and structured error reporting.
- Make processing idempotent so repeated script executions cannot create duplicate replies.
- Keep configuration flexible for future changes.

## 7. Continuous Automation for Future Discussions

Implement a recurring background job that:

1. Scans the forum for newly created and previously unprocessed discussions.
2. Identifies threads requiring a reply.
3. Retrieves the complete relevant discussion context.
4. Generates and validates a research-informed DeepSeek response.
5. Assigns an eligible contributor account.
6. Creates a scheduled draft in Flarum.
7. Allocates the earliest available publishing slot within the 50-replies-per-day limit.
8. Updates processing status, logs, and account usage counters.
9. Retries recoverable failures without duplicate processing.

The system must run automatically through cron or a suitable scheduler, recover safely after restarts, and continue until all eligible discussions have been addressed.

## 8. Monitoring, Testing & Deliverables

Provide:

- Fully configured and verified Flarum Drafts extension and scheduler.
- Working DeepSeek-powered automation script with `.env.example`.
- Persistent queue and discussion/account tracking.
- Automated quality checks, publication limits, and duplicate prevention.
- Logs and summary reporting for completed, pending, scheduled, and failed replies.
- Deployment instructions, cron configuration, and troubleshooting documentation.
- Successful end-to-end tests covering generation, scheduling, publication, account limits, and error recovery.

## 9. Execution Requirements

**This is an implementation task, not merely a proposal.**

First inspect the existing Flarum installation, configuration, database structure, and available APIs. Back up relevant configuration and data before making changes.

Implement the solution, validate it using a small test batch, then begin processing the full existing backlog.

Prioritize correctness, reliability, research quality, and publishing compliance. Do not sacrifice reply quality to increase processing speed.

**Final success criteria:** Every eligible existing and future forum discussion receives exactly one valuable, research-informed, automatically scheduled reply, with no duplicate publications, no URLs in responses, no account exceeding 100 threads, and no more than 50 automated replies published per day.
Sign in to fork