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
.maifile 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 |
|---|---|
| JavaScript | A recent browser (Edge, Chrome, Firefox) or Node.js 18 or later |
| Text | A .txt file in Italian; the download includes Pinocchio by Carlo Collodi (public domain) |
| Memory | A few MB: with Pinocchio the model takes about 2.8 MB |
Installation
- Download the zip for the language you prefer and extract it to a folder.
- VB.NET or C#: open
MiniAI.slnin Visual Studio and press F5, or double-clickcompila.bat. JavaScript: openindex.html. - In the Addestramento (Training) tab open
Pinocchio.txtand click Addestra (Train). - 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.