Programs › Study and source code

MiniAI October 2026 edition

My basic study of artificial intelligence. MiniAI reads a long text, turns it into vectors and matrices and answers questions by finding the closest sentence. Commercial AIs are trained on billions of data points, but the basic principle is the same: here you can watch it at work, step by step.

What it does

The download is the complete source code, in three equivalent versions: VB.NET, C# and JavaScript. No external libraries: from sentence splitting to embeddings, everything is written out in full and commented. The three versions give identical results and share the same .mai model format.

The programmer's manual, in five languages, explains the concepts (TF-IDF, co-occurrences, PPMI, embeddings, cosine similarity, retrieval as in RAG systems), the formulas and the structure of the code, and offers guided experiments with the Italian text of Pinocchio included in the download.

  • Reasoning traceFor every answer it shows the words recognized, the similar words added and the ranking of the sentences with their scores.
  • Eight visible stepsThe training log reports the size of every matrix and every vector.
  • Explore the memorySimilar words, similarity between two words, vocabulary with frequencies and IDF.
  • Three languages, same resultVB.NET and C# for .NET Framework 4.8, JavaScript in the browser or with Node.js.
  • No external librariesIt also compiles without Visual Studio using compila.bat; the web version opens with a double click.
  • Reusable modelsThe trained model is saved in a .mai file that opens in all three versions.

Requirements

VB.NET and C#Windows 10, Windows 11 or Windows Server 2016 and later with .NET Framework 4.8; Visual Studio optional
JavaScriptA recent browser (Edge, Chrome, Firefox) or Node.js 18 or later
TextA .txt file in Italian; the download includes Pinocchio by Carlo Collodi (public domain)
MemoryA few MB: with Pinocchio the model takes about 2.8 MB

Installation

  1. Download the zip for the language you prefer and extract it to a folder.
  2. VB.NET or C#: open MiniAI.sln in Visual Studio and press F5, or double-click compila.bat. JavaScript: open index.html.
  3. In the Addestramento (Training) tab open Pinocchio.txt and click Addestra (Train).
  4. In the Domande (Questions) tab type, for example, Chi ha costruito il burattino? (Who built the puppet?) and read the reasoning trace.

All the details are in the manual, which you can download alongside.

Good to know

  • It is a teaching tool: it answers by choosing a sentence from the text, it does not generate new text and does not “understand” like a person.
  • The program's interface and its word rules (stop words, stems) are designed for Italian texts.