PowerMarketing Docs
Back to App

AI Agent Guide

Understanding, monitoring, and improving PowerMarketing's AI agents.


Agent Overview

PowerMarketing runs eight AI agents. Each agent is triggered differently and produces a specific output.

AgentPrimary triggerWhat it doesOutput
ContentDispatcherScheduler / manualReads calendar, generates content, routes to Track 1 or 2Posts + decisions
ContentCreatorDispatcher / Create page / manualWrites post content for one platformPost content
ContentRepurposerManualAdapts existing post for a new platformNew post
EngagementAnalystManualAnalyses performance context and gives recommendationsText recommendations
LeadNurtureNurture scheduler / manualDrafts personalised outreach for a lead; when autopilot permits, sends directly within the nurture sequenceCommunication draft or sent message
VideoCreatorManualWrites video script + storyboardVideo record
PublisherDispatcher (Track 1) / manualPosts approved content to social platformPublished post
PlannerManual — Insights "Propose plan" or Command Center AI command boxReads content pillars + audience funnel and proposes a whole-funnel weekly plan (content + newsletter + nurture) as one approvable DecisionPlan Decision

The Two-Track Pipeline

This is the most important concept in PowerMarketing's automation.

Track 1 — Auto-publish (zero human action)

Calendar Entry → Dispatcher → ContentCreator → Publisher → Live on platform

The brand configures which content types are Track 1 in Settings → Automation → Publication Rules. Default Track 1 eligible types: news, trend_scan, short_post, repurposed.

The user never has to touch Track 1 posts. They appear in the Command Center's overnight summary bar after they've been published.

Track 2 — Approval required

Calendar Entry → Dispatcher → ContentCreator → Decision Inbox → Human approves → Publisher → Live

Used for strategic, high-visibility content. Default Track 2 types: article, post, story, carousel, video, reel, email.

video and email types are always Track 2 — this cannot be changed.

Per-Entry Override

A calendar entry's "Require approval" checkbox forces Track 2 for that entry, regardless of the brand's publication rules. Useful for sensitive topics even in normally auto-published content types.

Fallback Behaviour

If Track 1 auto-publish fails (no credential configured, API error), the post falls back to Track 2 — the post appears in the Decision Inbox instead of being silently dropped. Errors are logged in the agent run record.


Autopilot — Supervision Levels

Every brand has a per-brand autopilot dial that controls how much outward action agents take without a human in the loop. Set it in Command Center → Brand Settings → Autopilot.

Manual

Everything waits

All agent outputs land in the Decision Inbox. Nothing is published or sent until a human approves. Best for new brands or tightly controlled campaigns.

Review Default

Routine auto, strategic waits

Track 1 content and routine nurture steps auto-publish/send. Strategic content (articles, emails, plans) still requires approval. The right balance for most brands.

Auto-guardrails

Fully autonomous

Agents act on all outputs automatically. The system pauses only when a guardrail fires: monthly budget cap reached, complaint-rate spike detected, or required credentials are missing.

Guardrails always apply. Even in auto-guardrails mode, the three pause conditions (budget cap, complaint spike, missing credentials) cannot be disabled. They protect the brand regardless of supervision level.

Earned autonomy (per content type): beyond the dial, individual content types can earn auto-publish grants. The system tracks unedited-approval rates per type; at ≥95% over 20+ reviews it proposes a 🎓 Autonomy Upgrade decision. An approved grant lets that type auto-publish even at Review level — but never at Manual, and never for locked types (video, email) or entries flagged "require approval". See the Feedback Loop.


The ContentDispatcher in Detail

The dispatcher is the orchestration layer. Here is the full execution sequence per calendar entry:

  1. Fetch brand's llm_provider, llm_model, api_key, tavily_api_key
  2. For each platform in the entry's platforms field:
    1. Create a posts row (status = draft)
    2. Call ContentCreatorAgent with appropriate mode (trend_scan for news/trend_scan content, product_topic for everything else)
    3. On success: evaluate should_auto_publish(content_type, brand, require_approval_override)
    4. Track 1: call PublisherAgent → mark post published
    5. Track 2: create Decision record (status = pending)
    6. On LLM failure: log error, leave post as draft, continue to next platform
  3. Mark calendar_entries.status = 'dispatched' after processing all platforms

A single LLM failure does not abort the entire dispatch run. Each platform is processed independently.


Generation Modes

ContentCreator supports three modes:

ModeBest forWhat the AI does
product_topicArticles, thought leadershipWrites from brand perspective using brand voice, pillars, messaging
trend_scanNews, industry updatesFetches live web content (Tavily), connects trends to brand story
competitor_signalPositioning contentDifferentiates brand against specific competitors

The mode is auto-selected by the dispatcher based on content type. When generating manually on the Create page, the user selects mode explicitly.


Nurture Automation

A nurture sequence is an ordered list of steps. Each step defines a delay, a delivery channel, and an AI prompt used to personalise the message for the lead.

How the scheduler processes a due step

Step 1
Due step detected
Scheduler finds a sequence step whose delay has elapsed for a lead.
Step 2
LeadNurture drafts
Agent reads the step's AI prompt + lead profile and writes personalised outreach.
Step 3
Autopilot gate
If autopilot permits (review for routine steps, auto-guardrails for all), the message sends. Otherwise it queues as a Decision.
Step 4
Advance sequence
Lead moves to the next step; delivery timestamp is recorded.

Each step in a sequence carries:

  • Delay — time to wait after the previous step (or enrolment for step 1), e.g. 2d, 1w
  • Channelemail, linkedin_dm, or sms
  • AI prompt — the instruction passed to LeadNurture for this step; can reference merge fields like {{lead.first_name}} or {{lead.company}}

Tip: Keep early-sequence steps short and informational (autopilot-friendly), and reserve longer, high-stakes messages for later steps where human review is natural.


Feedback Loop

The agents learn from three signals — what performed, what you edited, and why you rejected:

  • Performance: a nightly job fetches real engagement metrics (likes, comments, shares) for published posts and computes an engagement score. The Planner's prompt includes the brand's recent top performers ("lean into what works"), the recycler re-queues proven winners, and the auto dispatch mode learns the best posting hour.
  • Edits: when a reviewer changes a post's content before approving, the pending decision is flagged edited. Content types you consistently approve unedited (≥95% over 20+ reviews) earn an 🎓 auto-publish grant proposal — human review shrinks to the types that still need it.
  • Rejections: every rejection captures a reason code that feeds the Insights page.
Reason codeMeaning
off_brandTone, language, or positioning doesn't match the brand
inaccurateFacts, claims, or figures are wrong or unverifiable
wrong_formatStructure, length, or platform conventions are off
weak_ctaCall to action is unclear, missing, or low-impact
otherFree-text note required

What Insights does with this data:

  • Shows a rejection summary chart broken down by reason code and agent
  • Surfaces AI-generated prompt-tweak suggestions — e.g. "Your off_brand rejection rate on LinkedIn is 40%; consider adding a tone constraint to your platform_linkedin prompt"
  • Allows one-click navigation from the suggestion directly to Settings → Prompts

Reason codes accumulate over time. The feedback signal becomes most useful after ~10 rejections per agent — earlier data is shown but suggestions are marked as low-confidence.


Agent Prompts — Customisation

Every agent uses a system prompt. These can be overridden per-brand in Settings → Prompts.

Available customisations:

  • system — the agent's core instruction set
  • platform_linkedin — LinkedIn-specific style instructions
  • platform_twitter — Twitter/X style instructions
  • (and other platform keys)

Leave a prompt blank to use the platform default. Changes take effect immediately on the next generation. This is the most powerful quality lever after brand voice.


Improving Output Quality

Quality improvements in order of impact:

  1. Brand Voice — most impactful. Must be 80+ chars. Should describe tone, what to avoid, and style examples. Use AI Assist (✦ AI Assist button) to generate it from structured questions.
  2. Content Pillars — clear, simple topic names (use the pill UI, not JSON). AI rotates through these.
  3. Owner Voice Descriptions — if calendar entries use owners, rich voice descriptions produce more personalised content.
  4. Agent Prompts — platform-specific style overrides in Settings → Prompts.
  5. Calendar Entry Notes — the Notes field maps to the objective parameter. Use it to give the AI extra context.
  6. Key Points — when creating manually, the "Key Points" field forces specific claims into the output.
  7. Feedback Loop — reject with a reason code. Insights will suggest prompt tweaks based on patterns.

Monitoring Agents

WhereWhat you see
Command Center — overnight summaryCount of Track 1 posts auto-published since last visit
Command Center — Decision InboxPending Track 2 posts awaiting approval
Command Center — Recent ActivityLast 8 agent runs with status
Log page (/log.html)All agent runs: status, tokens, duration, errors
Insights — Rejection SummaryRejection reason codes by agent; AI prompt-tweak suggestions

A failed Track 1 post always appears in the Decision Inbox — content is never silently lost.


Tavily powers the trend_scan generation mode and the Trend Research panel on the Create page.

Setup:

  1. Add Tavily API key in Settings → API Keys
  2. Enable Web Search in Settings → Automation

When enabled, ContentCreator fetches up to 5 live articles on the topic before writing. The fetched content is passed as trend_context to the LLM, grounding the output in current industry events.

If Tavily is disabled or the key is missing, trend_scan mode still runs but generates content from brand knowledge only (no live data).


LLM Configuration

SettingWhere
Provider (Claude / DeepSeek / Moonshot)Settings → Brand Profile → AI Provider
Default model for this brandSettings → Brand Profile → model dropdown
API key for the providerSettings → API Keys
Global model registrySettings → LLM Models
Connection testSettings → Brand Profile → Test Connection button

The LLM Models registry is global (shared across all brands). Add new models there once; all brands can then select them.

Supported providers:

  • Claude (Anthropic): claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5 (and future releases)
  • DeepSeek: deepseek-chat, deepseek-reasoner
  • Moonshot/Kimi: moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k

Cost Control — Optional LLM Gateway

For brands running high message volumes, PowerMarketing can route all agent LLM calls through a LiteLLM gateway instead of calling provider APIs directly. The gateway enforces per-brand monthly budget caps and automatically selects a model tier based on the task's stakes.

Model tiers

TierModelsUsed forCost profile
local Ollama open-weight (e.g. Llama 3, Mistral) High-volume, low-stakes: nurture drafts, short posts, repurposed content Near-zero (self-hosted)
mid DeepSeek · Moonshot/Kimi Default for most content generation tasks Low–medium
frontier Claude (Opus / Sonnet) High-stakes or escalation: strategic articles, Planner decisions, competitor analysis Higher; gated by budget cap

Budget cap & fallback

Set a per-brand monthly budget (USD) in Settings → LLM Gateway. When spend reaches the cap:

  • Frontier-tier calls are blocked and the task is queued as a Decision for the next billing period.
  • Mid- and local-tier calls continue normally.
  • An alert fires in the Command Center.

Gateway off = direct keys. When the LiteLLM gateway is disabled (the default), each brand uses its own provider API key configured in Settings → API Keys. The gateway is purely optional and additive — disabling it has no effect on normal operation.