Skip to main content

Shared Infrastructure

Status: Documentation Complete ✅
Scope: Cross-cutting systems used by all business units

What Shared Infrastructure Does

Shared Infrastructure is the intelligence and automation layer that powers all four business units. These systems extract patterns from content, understand audiences, generate new content, and distribute across platforms.
┌─────────────────────────────────────────────────────────────────────────┐
│                    SHARED INFRASTRUCTURE ARCHITECTURE                    │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│   BUSINESS UNITS (Consumers)                                            │
│   ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐               │
│   │Publisher │  │ Platform │  │  Agency  │  │  Store   │               │
│   └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘               │
│        └─────────────┴─────────────┴─────────────┘                      │
│                              │                                           │
│   ════════════════════════════════════════════════════════════════════  │
│                     SHARED INFRASTRUCTURE                                │
│   ════════════════════════════════════════════════════════════════════  │
│                                                                          │
│   ┌─────────────────────────────────────────────────────────────────┐   │
│   │                    CONTENT INTELLIGENCE                          │   │
│   │   Sources → Raw Content → Analysis → Patterns → Feedback        │   │
│   └─────────────────────────────────────────────────────────────────┘   │
│                              │                                           │
│   ┌─────────────────────────────────────────────────────────────────┐   │
│   │                   AUDIENCE INTELLIGENCE                          │   │
│   │   Profiles → Events → Segments → WTP Scoring → Predictions      │   │
│   └─────────────────────────────────────────────────────────────────┘   │
│                              │                                           │
│   ┌─────────────────────────────────────────────────────────────────┐   │
│   │                    GENERATION ENGINE                             │   │
│   │   Voice Profiles → Templates → AI Generation → Quality Gate     │   │
│   └─────────────────────────────────────────────────────────────────┘   │
│                              │                                           │
│   ┌─────────────────────────────────────────────────────────────────┐   │
│   │                   DISTRIBUTION SYSTEM                            │   │
│   │   Platforms → Scheduling → Publishing → Metrics → Optimization  │   │
│   └─────────────────────────────────────────────────────────────────┘   │
│                              │                                           │
│   ┌─────────────────────────────────────────────────────────────────┐   │
│   │                   COST OPTIMIZATION                              │   │
│   │   Model Router → Token Tracking → Caching → Budget Control      │   │
│   └─────────────────────────────────────────────────────────────────┘   │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

All shared infrastructure follows this master flow:
INGEST → ANALYZE → PREDICT → GENERATE → DISTRIBUTE → MEASURE → OPTIMIZE → FEEDBACK
   │         │         │          │           │           │          │         │
   ▼         ▼         ▼          ▼           ▼           ▼          ▼         ▼
Sources  Patterns   What      AI         Platforms   Analytics   A/B      Pattern
         Entities   Works    Creation    Scheduling   Tracking   Testing   Updates

Core Systems

SystemPurposeKey Tables
Content IntelligenceIngest, analyze, extract patternscontent_sources, raw_content, content_analysis, platform_patterns
Audience IntelligenceTrack users, segment, predictaudience_profiles, audience_events, micro_segments, wtp_scoring_rules
Generation EngineCreate content with AIvoice_profiles, content_templates, generated_content
Distribution SystemPublish across platformsplatforms, distributions, distribution_metrics
Cost OptimizationControl AI spendingmodel_config, ai_usage_tracking, fact_cache, generation_queue

Deep-Dive Documentation

DocumentPurpose
content-intelligence.mdContent ingestion, analysis, pattern extraction
audience-intelligence.mdUser profiles, events, segmentation, WTP scoring
generation-engine.mdVoice profiles, templates, AI content generation
distribution-system.mdPlatform management, scheduling, publishing
cost-optimization.mdModel routing, token tracking, budget control

Business Unit Usage

Publisher Uses

SystemHow Publisher Uses It
Content IntelligenceAnalyze competitors, extract winning patterns
Audience IntelligenceTrack reader behavior, personalize content
Generation EngineCreate SEO articles at scale
Distribution SystemPublish to WordPress, social, email
Cost OptimizationBalance quality vs. cost per article

Platform Uses

SystemHow Platform Uses It
Content IntelligenceAnalyze licensed content quality
Audience IntelligenceTrack creator earnings, platform engagement
Generation EngineProvide API access to generation
Distribution SystemTrack content distribution across licensees
Cost OptimizationBill usage accurately, enforce limits

Agency Uses

SystemHow Agency Uses It
Content IntelligenceAnalyze client industry, competitor content
Audience IntelligenceBuild client audience profiles
Generation EngineCreate client deliverables
Distribution SystemManage client publishing calendars
Cost OptimizationTrack per-client AI costs

Store Uses

SystemHow Store Uses It
Content IntelligenceMatch products to content topics
Audience IntelligenceProduct recommendations, WTP pricing
Generation EngineCreate product descriptions
Distribution System(Limited - email campaigns)
Cost Optimization(Minimal usage)

Data Flow Between Systems

┌─────────────────────────────────────────────────────────────────────────┐
│                         CROSS-SYSTEM DATA FLOW                           │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│   Content Intelligence                                                   │
│          │                                                               │
│          │ patterns, keywords, topics                                    │
│          ▼                                                               │
│   ┌──────────────┐                                                      │
│   │  Generation  │◀─── voice_profile_id, template_id                    │
│   │   Engine     │                                                      │
│   └──────┬───────┘                                                      │
│          │                                                               │
│          │ generated_content                                             │
│          ▼                                                               │
│   ┌──────────────┐                                                      │
│   │ Distribution │──── platform metrics ────▶ Content Intelligence     │
│   │   System     │                            (feedback loop)            │
│   └──────────────┘                                                      │
│                                                                          │
│   Audience Intelligence (parallel track)                                │
│          │                                                               │
│          │ segment_id, wtp_score                                         │
│          ▼                                                               │
│   ┌──────────────┐                                                      │
│   │  Generation  │ (personalization)                                    │
│   │   Engine     │                                                      │
│   └──────────────┘                                                      │
│                                                                          │
│   Cost Optimization (wraps all AI calls)                                │
│   ┌─────────────────────────────────────────────────────────────────┐   │
│   │  Every AI call → Model Router → Token Tracking → Cache Check    │   │
│   └─────────────────────────────────────────────────────────────────┘   │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

Key Tables Summary

Content Intelligence

  • content_sources - Where content comes from
  • raw_content - Ingested content before processing
  • content_analysis - Extracted keywords, entities, sentiment
  • platforms - Platform definitions (Twitter, YouTube, etc.)
  • platform_patterns - What works on each platform
  • content_platform_scores - Content scored for each platform
  • pattern_feedback - Performance data for pattern learning

Audience Intelligence

  • audience_profiles - Unified user identity
  • audience_events - User action log
  • micro_segments - Dynamic audience groups
  • segment_membership - User ↔ segment mapping
  • wtp_scoring_rules - Willingness-to-pay calculation
  • cohort_definitions - Behavioral cohorts
  • predictions - ML predictions per user

Generation Engine

  • voice_profiles - Brand voice definitions
  • content_templates - Reusable content structures
  • template_variables - Dynamic template fields
  • generated_content - AI-created content
  • generation_queue - Pending generation jobs
  • creative_components - Reusable creative elements

Distribution System

  • platforms - Platform configurations
  • distributions - Scheduled/published content
  • distribution_metrics - Performance data
  • publishing_calendar - Content schedule
  • cross_post_groups - Multi-platform posting

Cost Optimization

  • model_config - Available models with costs
  • ai_usage_tracking - Token/cost per request
  • fact_cache - Cached AI responses
  • budget_allocations - Spending limits
  • circuit_breakers - Error/cost circuit breakers

DocumentWhat It Covers
SCHEMA.mdAll table definitions
SCHEMA_CONCEPTS.mdArchitecture overview
AGENTS.mdAI agent delegation patterns
docs/publisher/OVERVIEW.mdPublisher business unit
docs/platform/OVERVIEW.mdPlatform business unit
docs/agency/OVERVIEW.mdAgency business unit
docs/store/OVERVIEW.mdStore business unit