Decision Core

architecture

Decision Core

Definition

The Decision Core is Prismatic Platform's closed-loop decision infrastructure that transforms unstructured decision problems into traceable, deterministic outcomes with measurable calibration. Unlike black-box AI systems, every step in the Decision Core pipeline is explicit, inspectable, and reproducible.

The pipeline follows a strict sequence: INPUT -> HYPOTHESIS -> EVALUATION -> DECISION -> OUTCOME -> CALIBRATION.

Technical Deep Dive

Pipeline Architecture

The Decision Core operates as a six-stage pipeline:

StageModulePurpose
InputPrismaticDd.Core.DecisionInputCaptures problem statement, context, structured data, constraints
HypothesisPrismaticDd.Core.HypothesisGeneratorGenerates 3-5 competing interpretations deterministically
EvaluationPrismaticDd.Core.ScorerComputes confidence, uncertainty, and risk scores per hypothesis
DecisionPrismaticDd.Decisions.select_decision/4Deterministic selection with explicit tie-breakers
OutcomePrismaticDd.Core.OutcomeRecords real-world result after decision execution
CalibrationPrismaticDd.Core.CalibratorComputes prediction-vs-reality delta, adjusts future scoring

Scoring Model

The Decision Core uses an explicit, inspectable scoring formula:

# Confidence computation
confidence = base_support - contradiction_penalty - missing_data_penalty + calibration_adjustment

# Uncertainty computation
uncertainty = ambiguity + incompleteness + signal_conflict

# Risk computation
risk = base_risk + constraint_risk

# Final decision score
decision_score = confidence - (risk * risk_penalty) - (uncertainty * uncertainty_penalty)

All scoring weights are configurable via weight profiles (default, finance, hiring, technical, investment).

Deterministic Fingerprinting

Every decision includes a SHA-256 fingerprint derived from the normalized input, engine version, and scoring profile. Re-running identical inputs with the same calibration state always produces the same decision.

Calibration Loop

The calibration system uses bucket-based correction:

  • Confidence scores are bucketed into 10 bins [0.0-0.1), [0.1-0.2), ..., [0.9-1.0]
  • Each bucket tracks the average delta between predicted confidence and observed success
  • Future confidence scores are adjusted by their bucket's mean delta
  • Adjustments are bounded to [-0.15, +0.15] to prevent runaway correction

Decision Stability Analysis

Each decision includes stability metrics computed via Gaussian CDF approximation:

  • Margin: Distance from decision threshold
  • Flip probability: Likelihood the decision would change under noise
  • Stability level: very_stable, stable, marginal, unstable

Implementation in Prismatic Platform

The Decision Core is implemented in the prismatic_dd app under PrismaticDd.Core.* namespace:

  • 6 Ecto schemas persisting all pipeline artifacts to PostgreSQL
  • 3 pure functional modules (HypothesisGenerator, Scorer, Calibrator) with zero side effects
  • 1 context module (PrismaticDd.Decisions) orchestrating the full pipeline
  • REST API at /api/v1/decisions with OpenAPI specification
  • LiveView UI at /hub/decision-core with 4 views (list, new, trace, calibration)
  • 7 reusable Phoenix components in DecisionCoreComponents

Usage Example

# Run full pipeline
{:ok, trace} = PrismaticDd.Decisions.run_pipeline(
  %{
    title: "Should we invest in Acme Corp?",
    problem_statement: "Evaluate M&A opportunity given financials",
    structured_data: %{"revenue" => 5_000_000, "employees" => 120}
  },
  profile: "finance"
)

# Later, record what actually happened
{:ok, result} = PrismaticDd.Decisions.attach_outcome(trace.decision.id, %{
  outcome_label: "success",
  success_score: 0.85,
  measured_at: DateTime.utc_now()
})
# Calibration event automatically computed and stored

Best Practices

  1. Always provide structured_data - More data fields produce more nuanced hypotheses
  2. Use domain-specific profiles - Finance decisions need different risk weighting than hiring decisions
  3. Record outcomes consistently - The calibration loop only improves with real-world feedback
  4. Monitor calibration health - Use Calibrator.health_check/1 to detect systematic bias
  5. Trust the stability metrics - If flip_probability > 0.3, the decision is marginal and needs more data

Connect & Contribute

Created by Tomas Korcak (korczis) | Open Source under GHL