Skip to Content
Introduction

Introduction to Leadmetrics

Leadmetrics is an AI-powered marketing automation platform built for digital marketing agencies. It combines a fleet of specialised AI agents with a structured human-in-the-loop review workflow — so agencies can deliver high-quality, on-brand content at scale without sacrificing oversight.


The Problem We Solve

A DM agency managing dozens of clients faces a compounding challenge: each client needs a consistent stream of blogs, social posts, ad copy, backlinks, and reports — every month, on brand, on message, and on time. Manual production doesn’t scale. Pure automation produces generic output that misses the nuance of each client’s voice and goals.

Leadmetrics solves this by having AI do the research, drafting, and analysis — and humans do the final review and approval. Every piece of content passes through a defined approval chain before it reaches the client or gets published.


Who Uses It

Three different audiences use Leadmetrics, each through their own portal:

┌──────────────────────────────────────────────────────────────────────────┐ │ LEADMETRICS PLATFORM │ ├──────────────────┬──────────────────────────┬───────────────────────────┤ │ CLIENT │ DM TEAM │ PLATFORM ADMINS │ │ Dashboard │ DM Portal │ Manage │ │ :3000 │ :3002 │ :3001 │ │ │ │ │ │ • Review and │ • First-line review │ • Onboard new clients │ │ approve │ of all AI drafts │ • Manage billing │ │ strategy │ • Manage all clients │ • Configure AI agents │ │ • Approve │ • Upload brand docs │ • Monitor platform │ │ content │ • Edit content │ health │ │ • See analytics │ • Push to channels │ • Super-admin tools │ │ • Manage │ • Handle rejections │ │ │ channels │ │ │ └──────────────────┴──────────────────────────┴───────────────────────────┘ ┌────────▼────────┐ │ API (:3003) │ │ + AI Agents │ └────────────────┘

How It Works — The Full Lifecycle

Every client goes through the same lifecycle, from onboarding to monthly published content.

Stage 1 — Onboarding

When a new client signs up, the platform automatically researches them and builds a knowledge base before any content is produced.

Client signs up ┌─────────────────────────────────────────────────────────────────┐ │ SETUP CHAIN (fully automated, runs once) │ │ │ │ Step 1: Client Researcher │ │ ┌─────────────────────────────────────────────────────────┐ │ │ │ AI reads the client's website, scrapes pages, extracts │ │ │ │ company info, products/services, tone, USPs │ │ │ └─────────────────────────────────────────────────────────┘ │ │ │ │ │ Step 2: Competitor Researcher │ │ ┌─────────────────────────────────────────────────────────┐ │ │ │ AI identifies competitors, analyses their content, │ │ │ │ positioning, keywords, strengths and gaps │ │ │ └─────────────────────────────────────────────────────────┘ │ │ │ │ │ Step 3: Context File Writer │ │ ┌─────────────────────────────────────────────────────────┐ │ │ │ AI synthesises everything into a Client Context File: │ │ │ │ • Company overview and products │ │ │ │ • Brand voice and tone │ │ │ │ • Target audience │ │ │ │ • Competitor landscape │ │ │ │ • Key differentiators │ │ │ └─────────────────────────────────────────────────────────┘ │ └──────────────────────────┬──────────────────────────────────────┘ Context File injected into EVERY AI agent that works for this client from now on. This is how agents know who they're writing for.

Stage 2 — Strategy

With the context file ready, the Strategy Agent builds a marketing roadmap.

┌─────────────────────────────────────────────────────────────────┐ │ STRATEGY GENERATION │ │ │ │ AI reads Context File │ │ │ │ │ ▼ │ │ Generates Marketing Strategy: │ │ • Goals to pursue (e.g. "Increase organic traffic by 40%") │ │ • Recommended deliverable mix per goal │ │ • Monthly volumes (10 blogs, 12 social posts, 10 backlinks) │ │ • Platforms to target │ │ • 6-month timeline │ └──────────────────────────────────┬──────────────────────────────┘ ┌────────────────────┘ ▼ DM team reviews in DM Portal ┌─────────────────────────────────────────────────────────────────┐ │ DM TEAM APPROVAL │ │ │ │ ✅ Approve → Strategy goes live │ │ ✏️ Edit → Adjust goals, volumes, platforms │ │ ❌ Reject with feedback → AI revises and resubmits │ └──────────────────────────────────┬──────────────────────────────┘ │ approved ┌────────────────────────────────────┐ │ │ ▼ ▼ CLIENT APPROVES Goals & Deliverables strategy on dashboard created in the system

Stage 3 — Monthly Deliverables

Once the strategy is approved, the platform automatically creates a recurring monthly pipeline.

Every month, at the start of the period: ┌────────────────────────────────────────────────────────────────┐ │ DELIVERABLE PLAN (e.g. April 2026) │ │ │ │ Goal: Increase organic traffic │ │ ┌─────────────────────────────────────────┐ │ │ │ 10 Blog Posts [ 0 / 10 ] 📝 │ │ │ │ 10 GBP Posts [ 0 / 10 ] 📍 │ │ │ │ 1 Performance Report [ 0 / 1 ] 📊 │ │ │ └─────────────────────────────────────────┘ │ │ │ │ Goal: Brand awareness │ │ ┌─────────────────────────────────────────┐ │ │ │ 12 Social Posts [ 0 / 12 ] 📱 │ │ │ │ 2 Email Newsletters [ 0 / 2 ] 📧 │ │ │ └─────────────────────────────────────────┘ │ │ │ │ Goal: Domain authority │ │ ┌─────────────────────────────────────────┐ │ │ │ 10 Backlink Outreaches [ 0 / 10 ] 🔗 │ │ │ └─────────────────────────────────────────┘ │ └────────────────────────────────────────────────────────────────┘ │ DM team approves the plan Activity pipelines kick off automatically for each deliverable type

Stage 4 — Content Production Pipeline

This is the core loop that runs for every piece of content. Here is the full pipeline for a single blog post:

BLOG POST PIPELINE — one of 10 blog posts for April 2026 ───────────────────────────────────────────────────────────────────── STEP 1 ┌───────────────────────────────────────────────────────┐ │ 🤖 KEYWORD RESEARCHER │ │ Finds best topics + keywords for this client's niche │ │ Output: 10 topic proposals with search intent │ └───────────────────────────┬───────────────────────────┘ STEP 2 ┌───────────────────────────▼───────────────────────────┐ │ 👤 DM REVIEWER │ │ Reviews topic proposals in DM Portal │ │ ✅ Approve topics / ❌ Reject with notes │ └───────────────────────────┬───────────────────────────┘ │ approved │ (one pipeline per approved topic) STEP 3 ┌───────────────────────────▼───────────────────────────┐ │ 🤖 BLOG WRITER │ │ Reads: topic brief + client context file + skills │ │ Writes: full blog post in client's brand voice │ │ Output: draft blog post (1500–2500 words) │ └───────────────────────────┬───────────────────────────┘ STEP 4 ┌───────────────────────────▼───────────────────────────┐ │ 👤 DM REVIEWER — first gate │ │ Reviews draft in DM Portal │ │ ✅ Approve / ✏️ Edit + approve / ❌ Reject │ │ If rejected: AI retries with feedback in prompt │ └───────────────────────────┬───────────────────────────┘ │ approved STEP 5 ┌───────────────────────────▼───────────────────────────┐ │ 👤 CLIENT — second gate (on dashboard) │ │ Client sees the post on their dashboard │ │ ✅ Approve / ❌ Reject with notes │ └───────────────────────────┬───────────────────────────┘ │ approved STEP 6 ┌───────────────────────────▼───────────────────────────┐ │ 🤖 PUBLISHER │ │ Posts to WordPress using stored OAuth credentials │ │ Output: live blog post URL │ └───────────────────────────┬───────────────────────────┘ ✅ Blog post PUBLISHED Deliverable counter: 1/10

The same pattern applies to social posts, GBP posts, newsletters, and other deliverable types — always: AI drafts → DM reviews → client approves → auto-published.


Stage 5 — Publishing to Channels

When content is approved, Leadmetrics publishes it directly to the connected platform using stored OAuth credentials. No copy-paste.

┌────────────────────────────────────────────────────────────────────┐ │ CONNECTED CHANNELS (linked once via OAuth, used every time) │ │ │ │ 📝 WordPress / Webflow ──────────────────► Blog posts │ │ 💼 LinkedIn Company Page ─────────────────► LinkedIn posts │ │ 📘 Facebook Business Page ────────────────► Facebook posts │ │ 📸 Instagram Business ────────────────────► Instagram posts │ │ 📍 Google Business Profile ───────────────► GBP posts │ │ 📧 Mailchimp / Resend ─────────────────────► Email newsletters │ │ 🔍 Google Ads ─────────────────────────────► Ad campaign sync │ │ 📊 Google Analytics / GSC ────────────────► Performance data IN │ └────────────────────────────────────────────────────────────────────┘ OAuth tokens are stored encrypted. The client connects once from their dashboard; the platform refreshes tokens automatically.

The Approval Chain

Every piece of content follows a defined approval chain. Nothing is published without explicit human sign-off.

AI produces output ┌──────────────────────────────────────────────────────────────────┐ │ APPROVAL GATE │ │ │ │ Status: pending │ │ │ │ Notifications sent immediately: │ │ 📱 In-app bell (DM Portal / Dashboard) │ │ 🔔 Mobile push notification │ │ 📧 Email (immediate for high-risk, batched digest for low) │ │ 📱 SMS (high-risk only) │ └────────────────────────┬─────────────────────────────────────────┘ ┌──────────┴──────────┐ │ │ ▼ ▼ ✅ APPROVED ❌ REJECTED │ │ ▼ ▼ Pipeline continues AI retries with (next step or publish) feedback in prompt New draft produced → back to approval gate (max 3 retries, then escalated)

The AI Agent Fleet

Leadmetrics runs 40+ specialised AI agents. Each does exactly one thing.

SETUP & STRATEGY ├── Client Researcher — reads client website, extracts business info ├── Competitor Researcher — analyses competitor landscape ├── Context File Writer — synthesises research into the context file ├── Strategy Writer — builds the marketing strategy └── Deliverable Planner — breaks strategy into monthly deliverables CONTENT CREATION ├── Blog Writer — long-form blog posts (1500–2500 words) ├── Social Post Writer — platform-specific social copy ├── Social Calendar Planner — monthly content calendar ├── GBP Post Writer — Google Business Profile posts ├── Email Writer — newsletters and sequences ├── Landing Page Writer — conversion-focused landing pages ├── Google Ads Writer — RSA and display ad copy └── Meta Ads Writer — Facebook / Instagram ad copy SEO & RESEARCH ├── Keyword Researcher — topic and keyword discovery ├── Content Brief Writer — detailed SEO briefs ├── Topic Researcher — in-depth topic research notes ├── Site Auditor — technical SEO health check ├── Backlink Researcher — link building opportunity discovery └── Backlink Outreach Writer — personalised outreach emails ANALYTICS & INSIGHTS ├── GSC Insights — Google Search Console analysis ├── GA Insights — Google Analytics analysis ├── Google Ads Insights — ad campaign performance ├── Meta Ads Insights — Facebook/Instagram ad analysis ├── GBP Insights — Google Business Profile trends ├── LinkedIn Insights — LinkedIn page performance ├── Brand Narrative Analyst — brand sentiment and AI visibility └── Channel Score Explainer — explains channel health scores PERFORMANCE & OPTIMISATION ├── Ads Analyst — paid campaign performance analysis ├── Anomaly Detector — flags unusual metric changes ├── SEO Optimizer — blog SEO scoring and improvement ├── Search Term Classifier — classifies Google Ads search terms ├── Campaign Optimizer — bid and budget recommendations └── Goal Tracker — weekly goal progress snapshots REPORTS & COMMS ├── Report Writer — monthly performance reports ├── Custom Report Writer — on-demand AI-generated reports └── Review Response Writer — Google review reply drafts

All agents are driven by the Client Context File — they know who they’re writing for, in what voice, and toward what goals.


The Technical Stack (Summary)

┌──────────────────────────────────────────────────────────────────────┐ │ CLIENT-FACING APPS │ │ Dashboard (:3000) · DM Portal (:3002) · Mobile (iOS/Android) │ │ Built with: Next.js 15, React 19, TailwindCSS │ ├──────────────────────────────────────────────────────────────────────┤ │ ADMIN APP │ │ Manage (:3001) — super-admin portal │ │ Built with: Next.js 15, React 19, TailwindCSS │ ├──────────────────────────────────────────────────────────────────────┤ │ API (:3003) │ │ Fastify · JWT auth · Socket.IO real-time · Swagger docs │ ├──────────────────────────────────────────────────────────────────────┤ │ AI AGENT SERVERS (background processes) │ │ 40+ agent workers · BullMQ job queues · Claude / OpenAI / Gemini │ │ RAG engine · Search indexer · Notifications · Billing │ ├──────────────────────────────────────────────────────────────────────┤ │ DATA LAYER │ │ PostgreSQL (Prisma) — all application data, 100+ models │ │ Redis — job queues, rate limiting, real-time pub/sub │ │ MongoDB — immutable audit logs │ │ Typesense — full-text search across all content │ └──────────────────────────────────────────────────────────────────────┘

Key Concepts at a Glance

ConceptWhat it is
Client Context FileA Markdown document auto-generated by the setup chain. Contains company overview, brand voice, audience, and competitors. Injected into every AI agent that works for this client.
StrategyThe marketing roadmap — goals, deliverable types, and monthly volumes. AI-generated, approved by the DM team, then shown to the client.
GoalsHigh-level outcomes (e.g. “Increase organic traffic by 40%”). Each goal has a measurable target and is tracked monthly.
DeliverablesMonthly output commitments attached to goals (e.g. 10 blog posts/month). Tracked against a period counter.
ActivityA single unit of work — one blog post, one social post, one backlink email. Goes through a status pipeline from draft to published.
ChannelA connected publishing platform (WordPress, LinkedIn, Facebook, GBP, etc.) linked via OAuth. Approved content is auto-published.
CreditsThe unit of platform consumption. Each AI task consumes credits. Plans include a monthly credit allocation.
DM PortalThe internal reviewer interface — where the DM team does first-line review of all AI drafts before clients see them.

Where to Go Next

If you’re new to the platform:

  • Architecture — how the control plane, queues, and agent workers connect
  • Workflow Model — the full lifecycle from onboarding to published content with detailed pipeline examples

If you’re building or maintaining the platform:

  • Apps & Portals — screen specs and flows for every app
  • API — all API routes, auth, and schemas
  • Database — PostgreSQL schema and decision guide

If you’re working with AI agents:

  • AI Agents — master index with queue names, models, costs, and pipeline positions
  • Adapters — how Claude, OpenAI, and Gemini adapters work
  • Skills System — how client context is injected into agents

If you’re working on content pipelines:

If you’re working on integrations:

  • Channels — OAuth-connected publishing platforms
  • Providers — every external service, its config, and integration pattern

© 2026 Leadmetrics — Internal use only