chido.designs
All projects

Featured case study / AI engineering

Revenue Intelligence Agency & Baseline Recovery Tool

How I engineered a bounded GenAI layer to diagnose publisher revenue constraints

AI & Data

  • DeepSeek API
  • Python

Backend

  • Node.js (Express)
  • TypeScript
  • REST APIs
  • Python

Infrastructure

  • Render
  • Docker
  • PostgreSQL
  • CI/CD
  • Linux
  • GitHub Actions

Frontend & Integration

  • Next.js
  • Tailwind CSS
  • GA4 Integration

01 / The problem

Visibility has a cost.

Publishers can lose valuable traffic when technical constraints keep content from being discovered. Pages marked as crawled but not indexed are one signal that a site's content may not be reaching its audience.

The Baseline Recovery Tool brings traffic data and executive reporting together to help surface potential constraints. Rather than promising a revenue outcome, it frames the data as a starting point for investigation and recovery planning.

02 / The AI architecture

Intelligence, with boundaries.

DeepSeek turns calculated metrics into an accessible narrative. The interpretation layer is bounded by policy checks and deterministic alternatives, so the model does not have the final word unchecked.

Constrained Metric Interpretation

DeepSeek interprets a bounded packet of calculated metrics, connecting the diagnostic results to a clear executive narrative.

Policy Validation

Generated output is checked against reporting policies, including rejecting claims that imply guaranteed revenue.

Deterministic Fallbacks

When AI output cannot be accepted, a deterministic fallback keeps the report grounded in the underlying data.

03 / Implementation

From sessions to a story.

  • GA4 data ingestion

    Ingest session data from Google Analytics 4 to establish a picture of traffic performance.

  • Baseline calculation

    Calculate traffic baselines before passing a bounded metric packet to the interpretation layer.

  • PDF generation

    Present the diagnostic findings and recovery narrative in an executive-ready PDF report.

04 / Guardrails in practice

Validate before you communicate.

The DeepSeek response is evaluated against reporting policy before it reaches the executive report. If it claims guaranteed revenue, the response is rejected and the deterministic report is used instead.

This illustrative pseudocode shows the intent of the validation, not production source code.

interpretation.tsTypeScript · Pseudocode
// Example of the bounded AI interpretation layer
const aiResponse = await deepseek.interpretMetrics(packet);

// Policy Validation: Reject if LLM hallucinates revenue
if (aiResponse.claimsGuaranteedRevenue) {
   return deterministicFallback(reportData);
}

05 / Visual showcase

The agency website.

A look at the Revenue Intelligence Agency website.

Revenue Intelligence Agency homepage featuring its publisher diagnostics and system map.