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.The Trending Engine Pipeline
All shared infrastructure follows this master flow:Core Systems
| System | Purpose | Key Tables |
|---|---|---|
| Content Intelligence | Ingest, analyze, extract patterns | content_sources, raw_content, content_analysis, platform_patterns |
| Audience Intelligence | Track users, segment, predict | audience_profiles, audience_events, micro_segments, wtp_scoring_rules |
| Generation Engine | Create content with AI | voice_profiles, content_templates, generated_content |
| Distribution System | Publish across platforms | platforms, distributions, distribution_metrics |
| Cost Optimization | Control AI spending | model_config, ai_usage_tracking, fact_cache, generation_queue |
Deep-Dive Documentation
| Document | Purpose |
|---|---|
| content-intelligence.md | Content ingestion, analysis, pattern extraction |
| audience-intelligence.md | User profiles, events, segmentation, WTP scoring |
| generation-engine.md | Voice profiles, templates, AI content generation |
| distribution-system.md | Platform management, scheduling, publishing |
| cost-optimization.md | Model routing, token tracking, budget control |
Business Unit Usage
Publisher Uses
| System | How Publisher Uses It |
|---|---|
| Content Intelligence | Analyze competitors, extract winning patterns |
| Audience Intelligence | Track reader behavior, personalize content |
| Generation Engine | Create SEO articles at scale |
| Distribution System | Publish to WordPress, social, email |
| Cost Optimization | Balance quality vs. cost per article |
Platform Uses
| System | How Platform Uses It |
|---|---|
| Content Intelligence | Analyze licensed content quality |
| Audience Intelligence | Track creator earnings, platform engagement |
| Generation Engine | Provide API access to generation |
| Distribution System | Track content distribution across licensees |
| Cost Optimization | Bill usage accurately, enforce limits |
Agency Uses
| System | How Agency Uses It |
|---|---|
| Content Intelligence | Analyze client industry, competitor content |
| Audience Intelligence | Build client audience profiles |
| Generation Engine | Create client deliverables |
| Distribution System | Manage client publishing calendars |
| Cost Optimization | Track per-client AI costs |
Store Uses
| System | How Store Uses It |
|---|---|
| Content Intelligence | Match products to content topics |
| Audience Intelligence | Product recommendations, WTP pricing |
| Generation Engine | Create product descriptions |
| Distribution System | (Limited - email campaigns) |
| Cost Optimization | (Minimal usage) |
Data Flow Between Systems
Key Tables Summary
Content Intelligence
content_sources- Where content comes fromraw_content- Ingested content before processingcontent_analysis- Extracted keywords, entities, sentimentplatforms- Platform definitions (Twitter, YouTube, etc.)platform_patterns- What works on each platformcontent_platform_scores- Content scored for each platformpattern_feedback- Performance data for pattern learning
Audience Intelligence
audience_profiles- Unified user identityaudience_events- User action logmicro_segments- Dynamic audience groupssegment_membership- User ↔ segment mappingwtp_scoring_rules- Willingness-to-pay calculationcohort_definitions- Behavioral cohortspredictions- ML predictions per user
Generation Engine
voice_profiles- Brand voice definitionscontent_templates- Reusable content structurestemplate_variables- Dynamic template fieldsgenerated_content- AI-created contentgeneration_queue- Pending generation jobscreative_components- Reusable creative elements
Distribution System
platforms- Platform configurationsdistributions- Scheduled/published contentdistribution_metrics- Performance datapublishing_calendar- Content schedulecross_post_groups- Multi-platform posting
Cost Optimization
model_config- Available models with costsai_usage_tracking- Token/cost per requestfact_cache- Cached AI responsesbudget_allocations- Spending limitscircuit_breakers- Error/cost circuit breakers
Related Documentation
| Document | What It Covers |
|---|---|
| SCHEMA.md | All table definitions |
| SCHEMA_CONCEPTS.md | Architecture overview |
| AGENTS.md | AI agent delegation patterns |
| docs/publisher/OVERVIEW.md | Publisher business unit |
| docs/platform/OVERVIEW.md | Platform business unit |
| docs/agency/OVERVIEW.md | Agency business unit |
| docs/store/OVERVIEW.md | Store business unit |