TArtificialIntelligenceHandler is the central AI class in Ascoos OS, designed to provide native intelligence without relying on external APIs or cloud services. It includes over 120 methods covering machine learning, neural networks, transformers, reinforcement learning, genetic algorithms, explainability, and more.
It is fully integrated into the Web5 Kernel and compatible with the Macro Engine, DSL scripting, and semantic modules. This documentation provides a full overview of its capabilities, method categories, and usage patterns.

The methods of TArtificialIntelligenceHandler are grouped into functional categories. Each category represents a distinct AI paradigm or utility:
Each method is designed to be composable and interpretable, allowing developers to build complex AI workflows with minimal overhead.
Below are simplified examples of how to use TArtificialIntelligenceHandler in real scenarios:
$ai = new TArtificialIntelligenceHandler();
$ai->addLayer('dense', ['units' => 64, 'activation' => 'relu']);
$ai->addLayer('dense', ['units' => 10, 'activation' => 'softmax']);
$ai->compile(['optimizer' => 'adam', 'loss' => 'categoricalCrossEntropy']);
$ai->fit($trainingData, $trainingLabels, ['epochs' => 10, 'batchSize' => 32]);
$nlp = new TLanguageProcessingAIHandler();
$result = $nlp->analyzeSentiment("I love the new Ascoos OS AI features!");
echo $result['score']; // e.g., 0.92
$macroAI = new TArtificialIntelligenceHandler();
$macroAI->loadMacroHistory($macroData);
$prediction = $macroAI->predictNextMacro(['context' => 'userIntent']);
executeMacro($prediction);
TArtificialIntelligenceHandler is designed to operate seamlessly within the Web5 Kernel, offering full compatibility with Ascoos OS modules and execution layers.
This integration ensures that AI is not just a feature β itβs a native capability. Applications built on Ascoos OS can reason, adapt, and evolve without relying on external services.
βοΈ Written by Christos Drogkidis β Developer, thinker, and advocate of logic-driven software design.