Skip to content
Portrait of Vasilis Katsoulis in a navy blazerVasilis Katsoulis
Menu
Explore

Active Praxis artifact

MAGPAI Stack Explorer

An accessible visual guide to the sixteen layers beneath a MAGPAI-style AI-enabled application, from business intent to models, compute, mathematics, operations, and governance.

  • Astro
  • TypeScript
  • HTML
  • CSS
  • Python
  • PyTorch
  • Streamlit
  • FastAPI
  • Jupyter
  • MkDocs Material
  • Pytest

The MAGPAI Stack Explorer is the Chapter 2 Praxis artifact for MAGPAI: AI Under the Hood. It turns the Session 01 stack source material into a readable, accessible web artifact that shows the layers beneath an AI-enabled application.

The source project is the public MAGPAI GitHub repository. The current website artifact is implemented with semantic HTML, CSS, Astro, and TypeScript data. It is based on static MAGPAI diagrams and presentation material; it does not claim that the MAGPAI repository already contains a standalone interactive stack explorer application.

MAGPAI and the Stack Explorer are educational engineering artifacts. They simplify parts of the modern AI ecosystem to make system boundaries and computational layers inspectable. They are not production reference architectures by themselves.

Read the companion Noesis article

Why the stack matters

The stack helps readers distinguish business intent, deterministic application behavior, learned model behavior, numerical computation, runtime infrastructure, and scientific or mathematical foundations.

That distinction changes how an engineer diagnoses a system. A bad answer might come from model behavior, missing context, incorrect sample data, weak application logic, or a policy boundary that was never enforced. A slow answer might come from the browser, network, retrieval path, inference runtime, chart generation, or hardware. The stack gives each problem a place to live.

Source visuals

The accessible explorer below is the primary reader-facing artifact. The static source diagrams are included as reference visuals, with adjacent text so the embedded diagram text is not the only way to understand the stack.

Sixteen-layer MAGPAI AI and machine-learning stack from computing foundation to responsible AI and governance.
The stack visual locates MAGPAI at layer 6, NLP & Language Modeling, where text becomes tokens, token IDs, vectors, tensors, and model input.
MAGPAI stack visual mapping each AI and machine-learning layer to supporting math, science, and engineering disciplines.
The stack visual shows the math, science, and engineering foundations under each layer.

Explore the layers

The explorer preserves the sixteen source layer names and order. The broader groups are website presentation aids, not replacements for the MAGPAI source terminology.

Chapter map

The approved ten-chapter series maps to the stack as follows:

  1. Introducing MAGPAI - overall project introduction and transparency rationale. Published as Chapter 1 Noesis and Chapter 1 Praxis.
  2. The AI and Machine-Learning Stack - complete stack orientation. Published as Chapter 2 Noesis and this Stack Explorer.
  3. How an AI System Sees a Sentence - tokenization. Coming next.
  4. From Tokens to Token IDs - vocabulary and token IDs. Coming soon.
  5. From Token IDs to Vectors - vectors and embedding lookup. Planned.
  6. How Embeddings Learn Meaning - learned embeddings. Planned.
  7. From Embeddings to Neural-Network Activations - neural-network layers and activations. Planned.
  8. Tensors and Prompt Representation - tensor-shaped prompt state. Planned.
  9. From Question to Business Insight - business data, calculation, and chart-backed results. Planned.
  10. From Transparent Chatbot to Agent - chatbot and agent orchestration. Planned.

Engineering observations

  • Not every problem belongs in the model.
  • Business truth should come from governed data and explicit calculations.
  • Prompts are not policy engines.
  • Application permissions must be explicit.
  • Latency and failure can originate at any layer.
  • Model interchangeability depends on well-designed boundaries.
  • Observability should span the complete request path.

Source material

Chapter 3, How an AI System Sees a Sentence, is forthcoming and is intentionally not linked until it is published.

Disclaimer

MAGPAI and the Stack Explorer are educational engineering artifacts. They simplify parts of the modern AI ecosystem to make system boundaries and computational layers inspectable. They are not production reference architectures by themselves.

Chapter 2 artifact

Explore the MAGPAI Stack

The source MAGPAI material defines sixteen layers. The groups below are presentation aids for the website; the numbered layer names and order preserve the Session 01 stack diagrams.

  1. Foundations

    1. 1Computing Foundationruntime infrastructure

      Supplies the software and hardware substrate that all higher AI work eventually runs on.

      Source role
      gives you the execution substrate: programming, algorithms, systems, and hardware.
      MAG question
      The question can only move through the demo because code, files, memory, and runtime processes execute reliably.
      Foundations
      Discrete math, Boolean algebra, algorithms, information theory, architecture, and semiconductor physics.
    2. 2Mathematics Foundationscientific or mathematical foundation

      Provides the mathematical language used to represent vectors, tensors, probabilities, and optimization.

      Source role
      gives you the language of learning: linear algebra, calculus, probability, statistics, and optimization.
      MAG question
      The sentence eventually becomes numeric state, so the explanation depends on linear algebra and probability even when the demo stays small.
      Foundations
      Linear algebra, calculus, probability, statistics, optimization, and numerical analysis.

      Chapter map: Chapter 5: From Token IDs to Vectors (Coming soon), Chapter 6: How Embeddings Learn Meaning (Planned), Chapter 8: Tensors and Prompt Representation (Planned)

    3. 3Data Foundationdeterministic application logic

      Defines the governed source material that a system can retrieve, measure, clean, or label.

      Source role
      gives you the raw material: collection, cleaning, pipelines, quality, and labeling.
      MAG question
      The Chicago sales answer should come from sample MAG data and explicit calculations, not from invented model memory.
      Foundations
      Measurement theory, sampling, experimental design, statistics, database theory, and signal processing.

      Chapter map: Chapter 9: From Question to Business Insight (Planned)

  2. Model and Machine Learning

    1. 4Classical Machine Learninglearned model behavior

      Introduces structured prediction and pattern recognition before deep neural representations.

      Source role
      gives you prediction from structured patterns: regression, classification, and clustering.
      MAG question
      A small classifier-like step can structure the business intent without pretending it is a full production LLM.
      Foundations
      Statistics, probability, optimization, decision theory, geometry, and Bayesian inference.
    2. 5Deep Learninglearned model behavior

      Uses neural networks to learn representations instead of relying only on hand-written features.

      Source role
      gives you representation learning through neural networks.
      MAG question
      Later MAGPAI chapters use small neural-network examples to show learned parameters, activations, and training behavior.
      Foundations
      Linear algebra, multivariable calculus, optimization, graph theory, and dynamical systems.

      Chapter map: Chapter 6: How Embeddings Learn Meaning (Planned), Chapter 7: From Embeddings to Neural-Network Activations (Planned)

    3. 6NLP & Language Modelinglearned model behavior

      Turns language into model-facing representations that software can inspect and transform.

      Source role
      gives machines language input processing: text, tokens, token IDs, embeddings, vectors, tensors, and model input.
      MAG question
      This is the Session 01 entry point: "Are MAG sales up in Chicago?" becomes normalized text, tokens, token IDs, vectors, tensors, and model input.
      Foundations
      Linguistics, formal language theory, probability, information theory, and vector-space geometry.

      Chapter map: Chapter 3: How an AI System Sees a Sentence, Chapter 4: From Tokens to Token IDs (Coming next), Chapter 5: From Token IDs to Vectors (Coming soon), Chapter 8: Tensors and Prompt Representation (Planned)

    4. 7Transformerslearned model behavior

      Processes token sequences with attention-based neural-network layers that can build contextual representations.

      Source role
      give scalable attention over sequences and contextual understanding.
      MAG question
      The stack shows where attention and transformer layers belong, while Chapter 2 does not publish a separate transformer implementation.
      Foundations
      Tensor algebra, linear algebra, optimization, graph theory, signal processing, and information theory.

      Chapter map: Chapter 7: From Embeddings to Neural-Network Activations (Planned)

    5. 8Large Language Modelslearned model behavior

      Places scaled language models above tokenization, embeddings, neural layers, and training foundations.

      Source role
      give language reasoning, understanding, and generation at scale.
      MAG question
      MAGPAI explains the path beneath a fluent answer without claiming that its tiny teaching system is a production LLM.
      Foundations
      Statistical learning theory, probability, optimization, high-dimensional geometry, and cognitive science.
  3. Application Knowledge and Tools

    1. 9Embeddings & Vector Searchnumerical computation

      Uses vector spaces to compare meaning and retrieve similar material.

      Source role
      give semantic meaning and fast similarity retrieval.
      MAG question
      The recurring question lets readers see why token IDs must lead to vectors before semantic comparisons become possible.
      Foundations
      Vector spaces, metric geometry, topology, nearest-neighbor search, and information retrieval.

      Chapter map: Chapter 5: From Token IDs to Vectors (Coming soon), Chapter 6: How Embeddings Learn Meaning (Planned)

    2. 10RAG (Retrieval-Augmented Generation)deterministic application logic

      Separates model generation from external knowledge retrieval and grounding.

      Source role
      grounds answers in external knowledge with citations and context.
      MAG question
      The stack clarifies why governed business data should be retrieved explicitly instead of being improvised by a language model.
      Foundations
      Information retrieval, ranking theory, graph theory, knowledge representation, and statistics.

      Chapter map: Chapter 9: From Question to Business Insight (Planned)

    3. 11Multimodal AIlearned model behavior

      Extends AI systems beyond text into multiple input and output modalities.

      Source role
      combines text, images, audio, video, tables, and code in shared reasoning workflows.
      MAG question
      MAGPAI currently uses text, charts, diagrams, and demo visuals as educational artifacts, not as a production multimodal system.
      Foundations
      Signal processing, computer vision, acoustics, geometry, statistics, and human perception science.
    4. 12Tools & Integrationsdeterministic application logic

      Connects model-facing interpretation to explicit tools, APIs, databases, and deterministic services.

      Source role
      connect AI models to external systems, APIs, databases, and the real world.
      MAG question
      The chart-backed answer uses code and sample data as tools; the reliable sales value comes from data access and calculation.
      Foundations
      Systems engineering, control theory, database theory, network science, and reliability engineering.

      Chapter map: Chapter 9: From Question to Business Insight (Planned), Chapter 10: From Transparent Chatbot to Agent (Planned)

  4. AI Application Systems

    1. 13AI Agentsdeterministic application logic

      Coordinates goals, state, planning, tool use, and multi-step behavior under explicit boundaries.

      Source role
      give models goals, memory, planning, tool use, and multi-step action.
      MAG question
      The MAGPAI agent material is a demonstration of bounded action and visible tool use, not autonomous enterprise authority.
      Foundations
      Decision theory, reinforcement learning, planning, game theory, control theory, and cognitive science.

      Chapter map: Chapter 10: From Transparent Chatbot to Agent (Planned)

    2. 14AI Application Architecturebusiness-facing

      Assembles user experience, application logic, model boundaries, data contracts, tools, observability, and failure handling.

      Source role
      turns models, data, tools, and workflows into reliable AI applications.
      MAG question
      This is where the MAG question becomes an end-to-end application flow with visible inputs, transformations, outputs, and evidence.
      Foundations
      Software engineering, distributed systems, queueing theory, security, and human-computer interaction.

      Chapter map: Chapter 1: Introducing MAGPAI: A Tiny Transparent AI System, Chapter 2: The AI and Machine-Learning Stack, Chapter 10: From Transparent Chatbot to Agent (Planned)

  5. Operations and Governance

    1. 15MLOps / LLMOps / GenAIOpsruntime infrastructure

      Keeps AI behavior observable, evaluated, deployable, monitored, and governable over time.

      Source role
      gives operational excellence: deploy, monitor, evaluate, iterate, and govern.
      MAG question
      A real deployment would need monitoring, evaluation, traces, costs, and release discipline around the same request path.
      Foundations
      Statistics, experimental design, reliability engineering, observability, and operations research.
    2. 16Responsible AI & Governancebusiness-facing

      Defines the safety, policy, legal, security, and governance boundaries around AI-enabled behavior.

      Source role
      builds trustworthy, safe, fair, secure, and compliant AI systems at scale.
      MAG question
      The sample answer must stay educational, traceable, and bounded; application permissions and business claims cannot inherit authority from generated text.
      Foundations
      Ethics, law, risk science, causal inference, statistics, security science, and sociology.

Recurring question

Follow the MAG Question Through the Stack

Are MAG sales up in Chicago?

  1. Business intent

    A user asks whether the fictitious company MAG has improving sales in Chicago.

    Stack layers: 14. AI Application Architecture

  2. Text prompt

    The sentence is normalized and treated as language input rather than business truth.

    Stack layers: 6. NLP & Language Modeling

  3. Tokens and token IDs

    The prompt is split into visible tokens and mapped to vocabulary identifiers.

    Stack layers: 6. NLP & Language Modeling

  4. Vectors and tensors

    Token IDs select vectors, and the vector rows become tensor-shaped model input.

    Stack layers: 2. Mathematics Foundation; 6. NLP & Language Modeling; 9. Embeddings & Vector Search

  5. Interpretation boundary

    Model-like behavior may help structure intent, but it should not invent sales values.

    Stack layers: 4. Classical Machine Learning; 5. Deep Learning; 7. Transformers; 8. Large Language Models

  6. Data retrieval and calculation

    Sample MAG sales data is retrieved and compared with deterministic application logic.

    Stack layers: 3. Data Foundation; 10. RAG (Retrieval-Augmented Generation); 12. Tools & Integrations

  7. Chart and explanation

    The answer is composed from the calculated trend, generated chart, and visible trace.

    Stack layers: 12. Tools & Integrations; 14. AI Application Architecture

  8. Governed decision

    In production, monitoring, policy, permissions, and human accountability would wrap the flow.

    Stack layers: 15. MLOps / LLMOps / GenAIOps; 16. Responsible AI & Governance

MAGPAI publication roadmap

Publication Roadmap: Ten Chapters

MAGPAI: AI Under the Hood will be published incrementally as a ten-chapter series. Each chapter connects a technical concept to source code, diagrams or an executable demonstration in the MAGPAI engineering laboratory.

  1. 1

    Introducing MAGPAI: A Tiny Transparent AI System

    Available now

    Connects the current Noesis article and Praxis project page to the repository structure, sample business scenario, and demonstration laboratory.

  2. 2

    The AI and Machine-Learning Stack

    Available now

    Presents an accessible stack explorer based on the verified MAGPAI Session 01 stack material.

  3. 3

    How an AI System Sees a Sentence

    Available now

    Documents the Tokenizer Lab using the verified ManualTokenizer output for the recurring question: Are MAG sales up in Chicago?

  4. 4

    From Tokens to Token IDs

    Coming next

    Previews vocabulary and token-ID inspection, including vocabulary-training demonstrations where supported.

  5. 5

    From Token IDs to Vectors

    Coming soon

    Previews an Embedding Lab that shows token IDs and their corresponding numerical vectors.

  6. 6

    How Embeddings Learn Meaning

    Planned

    Previews vocabulary or embedding training views that compare vector behavior before and after training.

  7. 7

    From Embeddings to Neural-Network Activations

    Planned

    Previews existing neural-network visualizations with inspectable activations and parameter changes where available.

  8. 8

    Tensors and Prompt Representation

    Planned

    Previews a prompt-tensor inspector for the recurring MAG business question.

  9. 9

    From Question to Business Insight

    Planned

    Previews the chart-backed answer flow for Are MAG sales up in Chicago?

  10. 10

    From Transparent Chatbot to Agent

    Planned

    Previews the chatbot, trace mode, and agent demonstrations with clear separation between educational behavior and implemented capability.

Read the companion Noesis article