Debugging prompts

Finding out what Aimogen Pro actually sent to the AI, why output differs from what you expected, and how to isolate the cause.

When output is not what you expected, the first question is always: what was actually sent? Prompts pass through placeholder expansion, spintax, nested shortcodes, prepend and append fields, retrieval injection and internet results before they reach the model.

See the real prompt#

Enable detailed usage tracking. Settings › Statistics › Enable Detailed Usage Tracking stores the prompt and the response for each request in the aiomatic_logmeta table, visible in System & Logs › Usage Logs.

This is the definitive answer. Everything else is inference.

Live AI Activity. System & Logs › Live AI Activity streams requests as they happen — useful while reproducing a problem.

Detailed logging. Enable Detailed Logging (Settings › General Settings) writes verbose entries to the plugin log file, whose location is shown on the Maintenance tab.

Isolate the cause#

Work down this list.

1. Did the placeholders resolve? If the prompt in the log still contains %%something%%, that placeholder is not available in that context. See Placeholder reference.

2. Is content duplicated? A prompt containing %%post_content%% and the auto-added content appears twice. Enable Do Not Auto Add The Content To The AI Prompt.

3. Is something being added you did not expect? Check the global prepend and append fields, retrieval injection and internet access. All three add to the prompt without appearing in the field you are editing.

4. Is the prompt being truncated? A very long prompt is trimmed to fit the model input limit. See Tokens, context and output length.

5. Is regex modifying it? Run Regex On Prompts changes the prompt before sending.

Test in the Playground#

The AI Playground runs a prompt in isolation, with no rule machinery around it.

If the prompt works there and not in a rule, the difference is something the rule adds: placeholders, prepend and append text, retrieval or internet results.

Model Comparison runs one prompt across several models at once. If every model produces the same problem, it is the prompt. If only one does, it is the model.

Common causes of unexpected output#

SymptomUsual cause
Generic content ignoring your topicPlaceholders did not resolve, so the model got a template
Content repeats itself across sections%%article_so_far%% is not in the section prompt
Output much shorter than askedMax Tokens too low, or a model output cap
Output in the wrong languageContent Language not set, or %%language%% not in the prompt
Model commentary in the outputThe prompt did not forbid it
Markdown fences around JSONSee Structured output
Identical output every run[aicontent] caching, or OmniBlock caching
Different output every runExpected. Lower temperature, or set a seed
Empty output, no errorA safety block. Check the finish reason in the logs

Isolating a stage#

Bulk rules run several prompts. To find which one is responsible:

  1. Identify which part of the output is wrong — the title, a section, the excerpt.
  2. That maps to one stage prompt.
  3. Change only that prompt.
  4. Re-run with Run Now.

Changing the content prompt will never fix a bad title.

Reproducing reliably#

Set a seed. Seed For AI Writer (Settings › Advanced AI Settings) makes the provider attempt deterministic sampling. Not guaranteed, but it greatly reduces run-to-run variance while you iterate.

Lower the temperature while debugging, then restore it.

Disable caching. [aicontent] caches for 30 days by default, and OmniBlocks have their own caching. A "change had no effect" is often a cache.

Debugging OmniBlocks#

Don't Render OmniBlock Shortcodes (Settings › OmniBlocks) leaves placeholders unresolved, showing exactly what each block received. See OmniBlocks troubleshooting.

Debugging with filters#

For developers, aiomatic_modify_ai_query fires with the final query:

php
add_filter( 'aiomatic_modify_ai_query', function ( $query ) {
    error_log( '=== Aimogen prompt ===' );
    error_log( is_string( $query ) ? $query : wp_json_encode( $query ) );
    return $query;
} );

aiomatic_modify_ai_reply gives you the response. See Filter reference.

Still stuck? Open a support ticket and include the diagnostics from Aimogen Pro › System & Logs › System Info.