Skip to content

AI Orchestration Configuration Reference

Last Updated: 2025-01-XX
Version: 2.0

Overview

This document provides a comprehensive reference for the two core configuration systems that control AI analysis generation and report processing in the Strategic Intelligence platform.

Architecture Overview

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   UI Selection  │ →  │   Translation   │ →  │ AI Orchestration│
│   (tierLevel)   │    │     Layer       │    │ (analysisDepth) │
└─────────────────┘    └─────────────────┘    └─────────────────┘
         │                       │                       │
         │              mapTierLevelToAnalysisDepth()   │
         │                       │                       │
         ▼                       ▼                       ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│ User Interface  │    │ Entry Point     │    │  AI Generation  │
│ - quick         │    │ AdminOrchestrator│    │ DEPTH_CONFIGS   │
│ - standard      │    │ Service.js:186  │    │     +           │
│ - comprehensive │    │                 │    │ Post-Processing │
│ - enterprise    │    │                 │    │ TIER_CONTENT_   │
└─────────────────┘    └─────────────────┘    └─────────────────┘

DEPTH_CONFIGURATIONS

Purpose: Controls AI prompt generation and workflow orchestration
File: src/config/DepthConfigurations.js
Usage: AI content generation phase

Configuration Structure

Each analysis depth contains:

javascript
{
  // Page Targeting
  targetPages: '8-12',           // Target page range for entire report
  totalPageTarget: 10,           // Specific page target for calculations
  
  // AI Generation Controls
  maxTokensPerSection: 1024,     // Token limit per AI section
  sections: ['executiveSummary', 'keyFindings', 'topRecommendations'],
  
  // Per-Section Page Allocation
  pageAllocationPerSection: {
    executiveSummary: '3-4 pages',
    keyFindings: '2-3 pages',
    topRecommendations: '3-4 pages'
  },
  
  // Content Generation Instructions
  contentVolumeInstructions: 'Generate comprehensive executive-level content...',
  wordTargetPerPage: 350,
  contentDensity: 'executive-focused',
  detailLevel: 'detailed',       // Used in AI prompts as DEPTH: ${detailLevel}
  
  // Content Guidelines
  requiredElements: ['quantified impact statements', 'specific recommendations'],
  expandContentAreas: ['strategic implications', 'competitive positioning'],
  
  // Workflow Settings
  includeCharts: true,
  includePresentation: false,
  pauseDuration: 500,
  timeEstimate: '15 minutes'
}

Analysis Depth Levels

DepthPagesSectionsMax TokensDetail LevelUse Case
quick8-1231,024detailedExecutive Brief
standard20-2541,536detailedManagement Analysis
comprehensive35-5062,560comprehensiveStrategic Study
enterprise60-8083,072enterpriseBoard Assessment

How It Works

  1. Entry Point:

    javascript
    const depthConfig = this.getDepthConfiguration(analysisDepth);
    // Returns: DEPTH_CONFIGURATIONS[analysisDepth] || DEPTH_CONFIGURATIONS.standard
  2. Prompt Generation:

    javascript
    buildFinancialAnalysisPrompt(industry, depthConfig, clientContext) {
      const pageTarget = depthConfig.pageAllocationPerSection?.financialAnalysis || '4-5 pages';
      
      return `
      🎯 PAGE TARGET: ${pageTarget}
      📊 CONTENT DENSITY: ${depthConfig.contentDensity}
      DEPTH: ${depthConfig.detailLevel}
      MAX TOKENS: ${depthConfig.maxTokensPerSection}
      
      Your response must be substantial enough to fill ${pageTarget} when formatted in professional PDF layout.
      `;
    }
  3. Dynamic Scaling:

    • Quick analysis: 3-4 pages per section, 350 words/page
    • Enterprise analysis: 10-12 pages per section, 500 words/page

TIER_CONTENT_LIMITS

Purpose: Controls post-AI content filtering and limiting
File: src/config/TierContentLimits.js
Usage: Report processing and structure enforcement

Configuration Structure

javascript
{
  // Content Item Limits
  recommendations: 8,        // Total recommendations in final report
  quickWins: 3,             // Quick win recommendations (0-90 days)
  strategicInitiatives: 3,   // Strategic initiatives (3-12 months)
  longTermGoals: 2,         // Long-term goals (12+ months)
  keyPoints: 4,             // Key points per section
  insights: 2,              // Key insights extracted
  phases: 2,                // Implementation phases
  objectives: 3             // Objectives per implementation phase
}

Content Limits by Analysis Depth

Content TypeQuickStandardComprehensiveEnterprise
Total Recommendations8152540
Quick Wins35812
Strategic Initiatives361218
Long Term Goals24510
Key Points (per section)461015
Insights2358
Implementation Phases2346
Objectives (per phase)3468

How It Works

  1. Function Interface:

    javascript
    getTierLimit(contentType, analysisDepth, fallbackDepth = 'standard')
    
    // Examples:
    getTierLimit('quickWins', 'comprehensive')      // Returns: 8
    getTierLimit('recommendations', 'enterprise')   // Returns: 40
    getTierLimit('keyPoints', 'quick')             // Returns: 4
  2. Usage in Report Processing:

    javascript
    // After AI generates content, apply limits
    const recommendations = this.extractRecommendationsFromContent(rawOutput, analysisDepth);
    const quickWins = recommendations
      .filter(r => r.priority === 'high' || r.timeline.includes('immediate'))
      .slice(0, getTierLimit('quickWins', analysisDepth));  // Limit to 3-12 items
    
    const keyPoints = this.extractKeyPoints(content, analysisDepth);
    return keyPoints.slice(0, getTierLimit('keyPoints', analysisDepth)); // Limit to 4-15 items
  3. Slicing Behavior:

    javascript
    // Safe slicing - no data loss when AI underperforms
    ['item1', 'item2'].slice(0, 8)           // Returns: ['item1', 'item2'] ✅
    ['item1'...'item15'].slice(0, 8)         // Returns: ['item1'...'item8'] ✅

Configuration Alignment

Page Target Consistency

Both configurations reference identical page targets:

Analysis DepthDEPTH_CONFIGURATIONSTIER_CONTENT_LIMITS
quicktargetPages: '8-12'// Quick Tier: 8-12 pages
standardtargetPages: '20-25'// Standard Tier: 20-25 pages
comprehensivetargetPages: '35-50'// Comprehensive Tier: 35-50 pages
enterprisetargetPages: '60-80'// Enterprise Tier: 60-80 pages

Mathematical Validation

Standard Analysis (20-25 pages):

  • Per-section allocation: 3-4 + 5-6 + 5-6 + 6-7 = 19-23 pages
  • Content limits: 15 recommendations, 6 key points per section = Appropriate density

Enterprise Analysis (60-80 pages):

  • Per-section allocation: 5-6 + 10-12 + 10-12 + 12-14 + 8-10 + 8-10 + 6-8 + 6-8 = 65-80 pages
  • Content limits: 40 recommendations, 15 key points per section = Rich content density

Workflow Integration

Complete Flow

mermaid
graph TD
    A[UI Selection: tierLevel] --> B[mapTierLevelToAnalysisDepth]
    B --> C[getDepthConfiguration]
    C --> D[DEPTH_CONFIGURATIONS]
    D --> E[AI Prompt Generation]
    E --> F[AI Content Generation]
    F --> G[Report Processing]
    G --> H[getTierLimit]
    H --> I[TIER_CONTENT_LIMITS]
    I --> J[Content Slicing & Filtering]
    J --> K[Final Report]

Phase Breakdown

  1. Configuration Phase:

    javascript
    // AdminOrchestratorService.js:186
    const analysisDepth = this.mapTierLevelToAnalysisDepth(profileResult.tier_level || 'standard');
    const depthConfig = this.getDepthConfiguration(analysisDepth);
  2. AI Generation Phase:

    javascript
    // AnalysisService.js - Uses DEPTH_CONFIGURATIONS
    prompt: this.buildFinancialAnalysisPrompt(industry, depthConfig, clientContext)
    // Tells AI: "Fill 7-8 pages with comprehensive financial analysis"
  3. Post-Processing Phase:

    javascript
    // ReportProcessor.ts - Uses TIER_CONTENT_LIMITS  
    quickWins.slice(0, getTierLimit('quickWins', analysisDepth))
    // Ensures: Only 8 quick wins for comprehensive (not 50)

Common Patterns

Adding New Content Types

  1. Add to TIER_CONTENT_LIMITS:

    javascript
    // In each depth level
    newContentType: 5,  // Standard limit
  2. Use in processing:

    javascript
    return items.slice(0, getTierLimit('newContentType', analysisDepth));

Adding New Analysis Depths

  1. Add to DEPTH_CONFIGURATIONS:

    javascript
    premium: {
      targetPages: '100-120',
      totalPageTarget: 110,
      maxTokensPerSection: 4096,
      // ... complete configuration
    }
  2. Add to TIER_CONTENT_LIMITS:

    javascript
    premium: {
      recommendations: 60,
      quickWins: 20,
      // ... complete limits
    }

Debugging Configuration Issues

  1. Check alignment:

    javascript
    // Verify page targets match
    console.log('DEPTH target:', DEPTH_CONFIGURATIONS.comprehensive.targetPages);
    // Should match comment in TIER_CONTENT_LIMITS
  2. Validate limits:

    javascript
    // Test slicing behavior
    const testArray = ['item1', 'item2'];
    console.log('Slice result:', testArray.slice(0, getTierLimit('quickWins', 'quick')));

Best Practices

Configuration Management

  1. Keep configurations synchronized - Page targets must match between both files
  2. Update comments - TIER_CONTENT_LIMITS comments should reflect DEPTH_CONFIGURATIONS values
  3. Test edge cases - Verify behavior when AI underperforms prompt expectations
  4. Document changes - Update this reference when modifying configurations

Content Scaling

  1. Linear scaling - Higher depths should have proportionally more content
  2. Balanced distribution - Don't put all limits in one content type
  3. Page density - Ensure total items can reasonably fit in target pages
  4. User expectations - Enterprise users expect significantly more content than quick users

Performance Considerations

  1. Token limits - Higher maxTokensPerSection = longer AI generation times
  2. Section counts - More sections = more AI calls = longer processing
  3. Content extraction - More complex parsing for higher content limits

Troubleshooting

Common Issues

IssueCauseSolution
Reports too thinTIER_CONTENT_LIMITS too restrictiveIncrease content limits for affected depth
AI timeoutsmaxTokensPerSection too highReduce token limits or add retry logic
Page targets missedPer-section allocations don't sum correctlyRecalculate pageAllocationPerSection
Content imbalanceUneven TIER_CONTENT_LIMITS distributionRebalance limits across content types

Validation Queries

javascript
// Check configuration consistency
const validateConfig = (depth) => {
  const depthConfig = DEPTH_CONFIGURATIONS[depth];
  const tierLimits = TIER_CONTENT_LIMITS[depth];
  
  console.log(`${depth} analysis:`);
  console.log(`- Target pages: ${depthConfig.targetPages}`);
  console.log(`- Total recommendations limit: ${tierLimits.recommendations}`);
  console.log(`- Sections: ${depthConfig.sections.length}`);
};

References

  • Source Files:
    • src/config/DepthConfigurations.js - AI generation controls
    • src/config/TierContentLimits.js - Post-processing limits
  • Key Integration Points:
    • src/services/AnalysisService.js:129 - getDepthConfiguration()
    • src/handlers/admin/services/AdminOrchestratorService.js:186 - tier mapping
    • src/reportProcessing/ReportProcessor.ts - content limiting usage
    • src/reportProcessing/OrchestratorTransformer.ts - content limiting usage

This document serves as the definitive reference for understanding and maintaining the AI orchestration configuration system. Keep it updated as configurations evolve.

Strategic Intelligence Hub Documentation