Back to guides
5
5 min

Marketing App

Dashboard & Content Studio

From Infrastructure to Interface

You have a data lake with temporal metadata, an encoding pipeline with time-aware embeddings, a hybrid retrieval system with temporal reranking, and an AI gateway with brand guardrails. Now you need an interface that marketing teams actually want to use.

The Marketing Intelligence dashboard serves three primary workflows:

  • Competitive monitoring — at-a-glance view of competitor landscape with change detection
  • Trend analysis — streaming AI-powered analysis with source citations and time context
  • Content drafting — brand-compliant content generation with voice checking
  • Dashboard Architecture

    The app is a Next.js application with three main areas:

    Competitor Comparison Cards

    The landing view. Each card represents a competitor with:

  • Name and positioning summary — one-line description of their current messaging
  • Threat level — green (low overlap), yellow (moderate overlap), red (high overlap with your positioning)
  • Recent changes badge — "3 changes since last check" with timestamp
  • Click to expand — full competitive brief with positioning, features, pricing, and trend timeline
  • Threat levels are computed by comparing competitor positioning embeddings against your own brand messaging pillars. High cosine similarity = high threat (they're targeting the same space).

    Change detection compares the current competitor profile against the previous snapshot. Any field that differs gets flagged. This is why temporal metadata from Module 1 matters — without dated snapshots, you cannot detect changes.

    Streaming Analysis Panel

    A chat-like interface powered by the AI Gateway (Module 4). Users type questions and get streaming responses with:

  • Source citations — each claim links back to its source document with time period
  • Confidence indicator — high/medium/low based on retrieval quality and source recency
  • Suggested follow-ups — based on retrieved context, suggest related questions
  • Time context — responses note which time period the data covers
  • The streaming implementation uses Server-Sent Events (SSE). The API route calls the LangGraph gateway, which streams tokens as they're generated. The frontend renders tokens incrementally for real-time feedback.

    Trend Visualization

    Charts and timelines that make patterns visible:

  • Engagement rate over time — line chart showing your engagement vs competitors across platforms
  • Share of voice — stacked area chart showing how conversation share shifts quarter to quarter
  • Sentiment trajectory — sentiment scores over time, highlighting inflection points
  • Competitor positioning timeline — horizontal timeline showing when competitors changed messaging
  • These visualizations use the temporal metadata baked into your chunks. Each data point is a chunk with an observation_date and time_period, aggregated and plotted.

    Content Drafting Workspace

    The content workspace is where the marketing intelligence system creates direct value. Instead of just analyzing data, it helps the team produce content.

    Brand-Aware Drafting

    The workspace loads brand guidelines as persistent context. When a user requests "Draft a blog post about industry trend X," the AI:

  • Retrieves relevant industry report chunks and competitor positioning
  • Generates a draft using brand voice, tone, and messaging pillars
  • Runs the draft through the brand compliance check (Module 4)
  • Presents the draft with a compliance score and any flagged issues
  • Side-by-Side View

    The workspace shows the AI draft on the left and the brand guidelines reference on the right. This lets the writer:

  • Check terminology against approved language
  • Verify tone matches the target persona
  • Ensure messaging pillars are represented
  • Catch competitor mentions that should be anonymized
  • Tone Scoring

    A real-time tone checker that scores the draft against brand voice rules. The scorer looks for:

  • Formality level — too casual? too stiff?
  • Active vs passive voice — most brands prefer active
  • Jargon density — too much industry jargon for the target audience?
  • Emotional tone — does it match the brand's emotional register?
  • The score updates as the user edits, providing immediate feedback on brand alignment.

    Technical Implementation

    Streaming Chat API

    The chat API route connects to the LangGraph gateway and streams responses:

    Client → POST /api/chat { query, history }
           → SSE stream: data: { token, sources?, done? }

    Each SSE event contains either a text token (for incremental rendering) or metadata (sources, confidence, suggestions). The stream terminates with a done: true event that includes the complete response and execution metadata.

    Conversation Persistence

    Conversations are stored in a marketing_conversations table:

  • user_id, team_id
  • messages (JSON array of { role, content, sources, timestamp })
  • query_intents (what types of questions were asked)
  • created_at, updated_at
  • This enables:

  • Conversation history (continue where you left off)
  • Team knowledge sharing (see what analyses teammates have run)
  • Usage analytics (what questions are teams asking most?)
  • State Management

    The dashboard uses React state for:

  • Selected competitor (for expanded view)
  • Active time range (for filtering all views)
  • Chat history (for conversation context)
  • Draft content (for the content workspace)
  • Competitor data and trend data are fetched on load and refreshed on a configurable interval. The chat is real-time via SSE.

    Design Decisions

    Why a dashboard, not just a chatbot? Chat is great for ad-hoc questions but bad for monitoring. Marketing teams need to glance at a dashboard and see "CompetitorX changed their pricing page yesterday" without asking. The dashboard provides ambient awareness; the chat provides deep analysis.

    Why side-by-side brand guidelines? Brand compliance is easier to enforce when the rules are visible. Hiding guidelines behind a "check" button means writers only discover violations after writing. Side-by-side display makes brand-aware writing the default behavior.

    Why streaming? Marketing analyses can take 5-15 seconds. Without streaming, users see a blank screen and wonder if the system is working. Streaming shows progress immediately and lets users start reading before the full response is ready.

    What You'll Build

  • Explore the pre-seeded Next.js app with competitor cards and streaming analysis
  • Extend competitor cards with threat indicators, change badges, and expandable briefs
  • Add trend visualization components for engagement, sentiment, and positioning changes
  • Build the content drafting workspace with brand voice scoring
  • Glossary

    TermMeaning
    SSEServer-Sent Events — a protocol for streaming data from server to client
    Threat levelCompetitive overlap score based on positioning similarity
    Change detectionComparing current vs previous data snapshots to identify changes
    Tone scoringEvaluating content against brand voice rules for compliance
    Ambient awarenessDashboard information visible at a glance without explicit queries

    This is chapter 5 of AI Marketing Intelligence.

    Get the full hands-on course for $100 and build the complete system. Your projects become your portfolio.

    View course details