Skip to main content

6. Runtime View

Scenario 1: CRESI Calculation Flow

User Goal: Lender submits a valuation request and receives a sentiment-adjusted appraisal.

Sequence Diagram

Step-by-Step Breakdown

StepComponentActionDurationError Handling
1WebAppUser fills form, submits<1sClient-side validation
2APIGatewayJWT validation, rate limit check<50ms401 Unauthorized or 429 Too Many Requests
3SmittyRetrieve historical weights from Memory Bank<100msFallback to default weights
4CRESIParallel fetch 6 layer data sources<5sTimeout 30s, fallback to cached data
5CRESINormalize and weight layer scores<100msN/A (deterministic calculation)
6SmittyGenerate human-readable explanation<500msReturn raw scores if explanation fails
7APIGatewayAsync store valuation in Memory Bank<200msRetry queue if DB unavailable
8WebAppRender results dashboard<500msRetry button if render fails

Total Latency: 6-10 seconds (target: <10s for 95th percentile)


Scenario 2: Weight Optimization (Nightly Batch)

Goal: Smitty learns from previous day's valuation outcomes to improve future predictions.

Sequence Diagram

Weight Update Logic

# Pseudocode for weight optimization
def optimize_weights(outcomes, current_weights, learning_rate=0.01):
mape = calculate_mape(outcomes)

for layer in ['macro', 'micro', 'geo', 'capital', 'demo', 'events']:
gradient = calculate_gradient(layer, outcomes)
new_weight = current_weights[layer] - learning_rate * gradient

# Constraints
new_weight = max(0.05, new_weight) # Minimum 5% weight

# Normalize to sum to 1.0
weights = normalize_weights(new_weights)

return weights

Outcome Data Requirements:

  • Actual market outcome (sale price, lease rate, occupancy)
  • Time between valuation and outcome (typically 3-12 months)
  • Prediction confidence at time of valuation

MAPE Alert Thresholds:

  • Green: MAPE < 5% (excellent)
  • Yellow: MAPE 5-10% (acceptable)
  • Red: MAPE > 10% (investigate layer data sources)

Scenario 3: Layer Data Fetch Timeout Handling

Problem: External API (e.g., CoStar) times out during CRESI calculation.

Sequence Diagram

Fallback Strategy:

Data FreshnessConfidence ImpactAction
< 1 dayNo impact (100%)Use cached data as-is
1-7 days-10% confidenceApply staleness discount
7-30 days-25% confidenceWarn user of stale data
> 30 daysFail layerExclude layer from calculation, notify admin

Circuit Breaker:

  • After 3 consecutive timeouts: Mark API as degraded
  • Switch to cache-only mode for 15 minutes
  • Send PagerDuty alert to on-call engineer
  • Auto-recovery after successful API call

Scenario 4: Explainable AI Report Generation

Goal: Generate regulatory-compliant explanation of how sentiment score was calculated.

Data Flow

Explanation Components

1. Layer Contribution Table:

Layer                Score    Weight    Contribution    Importance
───────────────────────────────────────────────────────────────────
Macro-Economic +15 0.25 +3.75 High
Micro-Economic -5 0.30 -1.50 High
Geopolitical +2 0.10 +0.20 Low
Capital Markets +20 0.20 +4.00 High
Demographics +8 0.10 +0.80 Medium
Current Events +5 0.05 +0.25 Low
───────────────────────────────────────────────────────────────────
FINAL SCORE: +7.50 (Bullish sentiment)

2. Plain English Narrative:

"The CREstimate.ai sentiment score for this Chicago office property is +7.5 (slightly bullish). This is driven primarily by strong capital markets conditions (investor appetite for office assets remains high) and positive macro-economic trends (GDP growth, declining interest rates). However, local micro-economic factors are negative due to rising vacancy rates in the Chicago CBD submarket. The model confidence is 82%, indicating high reliability of this prediction."

3. SHAP Values Visualization:

  • Waterfall chart showing each layer's push/pull on final score
  • Feature importance ranking
  • Comparison to historical average for this asset type/location

4. Regulatory Compliance Metadata:

  • Data sources cited (with timestamps)
  • Model version and training date
  • Weight optimization history
  • Confidence interval calculation method

Performance Characteristics

Latency Targets

OperationTargetP95P99Notes
Full valuation<10s8s12sIncludes all 6 layers
Single layer fetch<2s1.5s3sIndividual API call
Weight optimization<5min3min10minNightly batch
Explanation generation<500ms400ms1sPost-calculation
Cache lookup<50ms30ms100msRedis in-memory

Throughput Targets

MetricTargetNotes
Concurrent users100Per instance
Valuations/hour500Peak load
API requests/sec50Rate limit per client
Cache hit rate>80%For layer data

Failure Modes

FailureDetectionRecoverySLA Impact
Single layer timeout30s timeoutUse cached dataNo impact if cache hit
All layers timeout3 consecutive failuresCircuit breaker, alertDegraded service
Memory Bank unavailableHealth check failureQueue valuations, retryNo immediate impact (async)
Weight optimizer crashCron job failureUse previous weightsNo immediate impact (daily batch)

For component details, see Building Block View. For deployment infrastructure, see Deployment View.