withLearningEngine
Configures the learning engine implementation that will power the AI capabilities.
The learning engine is the core AI component responsible for:
Processing incoming interaction data and extracting meaningful features
Training machine learning models incrementally as new data arrives
Generating predictions and recommendations based on learned patterns
Managing model state serialization for persistence across sessions
Adapting to user behavior changes over time through continuous learning
Common implementations:
KLDLLearningEngine: Uses KotlinDL for deep learning capabilities
SimpleMLEngine: Basic statistical learning for lightweight scenarios
CustomEngine: Application-specific implementations for specialized domains
Engine selection considerations:
Model complexity: Choose based on available computational resources
Data volume: Consider memory and processing requirements
Prediction latency: Balance accuracy with response time requirements
Privacy requirements: Ensure all processing remains local and secure
Integration patterns:
val engine = KLDLLearningEngine.builder()
.withHiddenLayers(64, 32)
.withLearningRate(0.001f)
.withBatchSize(32)
.build()
builder.withLearningEngine(engine)Return
This builder instance for method chaining.
Parameters
A fully configured LearningEngine instance that implements the required training and inference capabilities. The engine must be thread-safe and capable of incremental learning from streaming data.
See also
for detailed interface documentation
for KotlinDL-based implementation
Throws
if engine is null or not properly configured