predict

open suspend override fun predict(contextData: List<InteractionData>, instructions: List<KarlInstruction>): Prediction?

Generates predictions for user behavior and action recommendations.

Uses the trained neural network to analyze context data and produce confidence scores for next actions, timing predictions, and preference alignment.

Prediction Process:

  1. Feature extraction from most recent interaction

  2. Forward propagation through neural network

  3. Confidence score generation and tracking

  4. Result packaging with metadata

Output Interpretation:

  • next_action_confidence: Likelihood of suggested action success 0, 1

  • timing_prediction: Temporal urgency or scheduling priority 0, 1

  • preference_score: User preference alignment score 0, 1

Thread Safety: Uses mutex for concurrent prediction requests Performance: O(1) inference time with fixed network size

Return

Prediction with confidence scores, or null if engine not initialized

Parameters

contextData

Historical interaction data for pattern analysis

instructions

Additional behavioral constraints (currently unused)

See also

Neural network inference computation

Feature engineering for context