saveInteractionData

abstract suspend fun saveInteractionData(interactionData: InteractionDataEntity)(source)

Persists a single user interaction data entry to the database.

This method stores individual interaction events that contribute to the KARL learning process. Each interaction represents a discrete user behavior or system response that can be analyzed for pattern recognition and adaptive behavior modeling.

Data Structure:

  • Automatic timestamp assignment for temporal analysis

  • User partitioning enables efficient multi-user data management

  • Structured interaction data supports complex behavioral analytics

Performance Optimization:

  • Batch-friendly design allows for efficient bulk operations

  • Minimal table locking during high-frequency interaction logging

  • Asynchronous operation prevents UI blocking during data persistence

Analytics Integration:

  • Standardized data format supports machine learning pipeline integration

  • Temporal ordering enables sequence analysis and pattern detection

  • User segmentation capabilities for personalized learning models

Parameters

interactionData

Complete interaction event data including user context, system state, and behavioral metadata

See also

Structure and validation requirements for interaction data

Method for retrieving recent interactions

Throws

SQLException

If database insertion fails due to constraints or connectivity

ValidationException

If interaction data fails schema validation