6 words

Client: Hobby project

A social platform where a question receives an AI image cover and the community replies in exactly 6 words. Key innovation: Prompt-on-Prompt technique, where AI first translates an abstract query into a precise visual descriptor before it enters the diffusion model. Fully asynchronous pipeline via Symfony Messenger, credits, automatic categorization, typo-tolerant search, and a custom auto-moderation system.

AI Prompt Engineering Symfony Messenger PHP 8.5 DALL-E 3 GPT-4 Symfony AI EasyAdmin Imagick
6 words

Concept

A simple idea with a deep technological core: the user writes a question consisting of exactly six words, the platform generates an AI image as a cover, and the community must reply in exactly 6 words. Not 5, not 7 — exactly 6. The limit forces deep thought, and the results are surprisingly witty, wise, and poetic.

The platform operates within the Slovak-Czech community and as of August 2026 records 203 questions, 1,274 answers, and 39 registered users. Questions cover categories such as Relationships, Health, Personal Development, Culinary, Finances, or Self-Reflection — each of which is not only named but also visually portrayed by AI.

Prompt-on-Prompt Pipeline

The biggest problem in generative graphics is the inaccuracy of direct prompting. An abstract question like "What is love?" produces generic outputs. I implemented a two-phase process:

  1. Phase 1 — Prompt Enhancer: GPT-4 receives the question and a system instruction to deconstruct it into a precise visual descriptor — scene description, color palette, composition, mood.
  2. Phase 2 — Image Generation: The optimized prompt enters DALL-E 3 at a resolution of 1792×1024px.

The results are significantly more consistent and visually striking than with direct prompting.

Asynchronous AI Pipeline

Every system event triggers a dedicated Messenger handler, ensuring lightning-fast UI responsiveness even during intensive AI operations:

  • AiImageGenerateHandler — Prompt-on-Prompt + DALL-E 3 question cover generation
  • AiAnswerGenerateHandler — GPT generates initial answers for every new question (seed content)
  • AiCategoryGenerateHandler — GPT assigns the question to an existing or new category
  • AiCategoryImageGenerateHandler — DALL-E 3 generates a cover for the new category
  • AiNicknameGenerateHandler — GPT generates a pool of unique nicknames for new users
  • SendDailyUserUpdatesHandler — daily email digest of new answers and likes
  • SpecialDayNotificationHandler — special event emails with interactive buttons

Credit System & Scheduler

Adding a question costs credits. Credits are replenished automatically via Symfony Scheduler with two recurring jobs:

  • AddFreeCoinsProvider — replenishes credits according to rules every minute (cron: * * * * *)
  • Daily Reports — cron at a random time between 8:00–20:00, dynamically generating a list of users with new activities

The scheduler runs without an external cron daemon — purely through Symfony Messenger workers.

Full-text Search & Auto-moderation

Loupe — a typo-tolerant full-text search engine in pure PHP — indexes all questions. Minimum prefix length 3 characters, fuzzy matching, zero dependency on an external server.

AutoModerationService implements Weighted Report Score (WRS): each report carries weight based on severity (1–4), reporter trustworthiness (reporterTrust: 0.5–1.5), and time degradation. The system suggests an action: visible / soft_hidden / hard_hidden / quarantine. Reporter trust evolves based on their reporting history.

HeroGenerator — Composite Image Engine

A custom Imagick-based HeroGeneratorService generates hero backgrounds for profiles and special pages. The algorithm:

  1. Loads AI category images as tiles (600×400px)
  2. Arranges them into a grid with a brick pattern (every second row offset by half a tile)
  3. Applies a sigmoid gradient blend mask between tiles for smooth blending
  4. Rotates the entire canvas by −15°
  5. Crops the result to 2560×1440px, increases saturation, and exports as JPEG 80%

The result looks like a generative AI background, yet it is a deterministic composition of existing images.

Symfony-AI Integration

The project is one of the first production deployments of the symfony/ai package. Individual AI agents are defined as Symfony services with the #[Autowire(service: ...)] attribute:

  • ai.agent.image_prompt — Prompt Enhancer for DALL-E
  • ai.agent.answers — seed answer generator
  • ai.agent.category — question category classifier
  • ai.agent.nickname — nickname generator
  • ai.agent.optimize_categories — category optimizer

DALL-E 3 is called directly via PlatformInterface with a custom ImageUrl response format.

Prompt-on-Prompt Pipeline

Two-phase AI transformation: GPT-4 first translates an abstract question into a precise visual descriptor, DALL-E 3 generates a cover at 1792×1024.

Fully Asynchronous AI Pipeline

7 specialized Symfony Messenger handlers — images, answers, categories, nicknames, emails. UI never waits for AI.

Daemon-less Symfony Scheduler

Credits, daily digests, and special events managed purely via Symfony Messenger workers. No external cron.

Auto-moderation with WRS

Weighted Report Score system with time degradation, report severity, and dynamic reporterTrust score for every user.

Loupe Full-text Search

Typo-tolerant search without external dependencies — pure PHP, indexing directly into local storage.

HeroGenerator — Imagick Engine

Generative hero backgrounds from AI category images — brick grid, sigmoid blend masks, rotation, 2560×1440px crop.

Technical Features

  • OpenAI GPT-4o + DALL-E 3
  • Asynchronous Symfony Messenger + Scheduler
  • Prompt-on-Prompt (two-phase image generation)
  • Loupe — typo-tolerant full-text search (PHP-native)
  • Weighted Report Score with dynamic reporterTrust
  • Custom Imagick composite engine (brick grid + sigmoid blend)
  • 203 questions · 1,274 answers · 39 users (Aug 2026)