# Gemini FAQ Generation Fix

**Date:** 2026-03-03  
**Issue:** FAQ answers were manually created instead of using Gemini API  
**Root Cause:** Script was run without `--use-ai` flag

## Problem

During the lebenslauf-vorlage template creation, `generate-template-faq-answers-optimized.php` was run **without** the `--use-ai` flag. This caused the script to output empty answer placeholders instead of generating answers via Gemini API.

## Solution

Re-ran the script with the `--use-ai` flag:

```bash
php v2/scripts/templates/generate-template-faq-answers-optimized.php --template=lebenslauf-vorlage --use-ai
```

## Results

✅ **Successfully generated 12 FAQ answers** via Gemini API:
- Word count: 50-70 words per answer (within 40-80 target range)
- Primary keyword integration: Natural inclusion of "lebenslauf klassisch vorlage download"
- Format: HTML formatted with `<p>` and `<strong>` tags
- Tone: Proper du tone (informal German)
- Quality: Passed `validate-template-faq-quality.php`

## Key Learnings

1. **Always use `--use-ai` flag** when running `generate-template-faq-answers-optimized.php`
2. **API key is configured** - `GEMINI_API_KEY` is available via `ai-faq-config.php`
3. **Script works correctly** - The issue was user error (missing flag), not script bug
4. **Validation passes** - AI-generated answers meet all quality requirements

## Workflow Update

Updated `TEMPLATE_FAQ_WORKFLOW.md` to emphasize that `--use-ai` is **required** for production use, not optional.

## Comparison: Manual vs AI-Generated

**Manual answers (previously created):**
- 48-52 words each
- Good quality, but less keyword optimization
- Created due to misunderstanding script behavior

**AI-generated answers (current):**
- 50-70 words each
- Better keyword integration
- More consistent structure
- Natural Ordio mentions where appropriate

**Decision:** Keep AI-generated answers (current state) as they're better optimized for SEO.
