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.
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:
- Introducing MAGPAI - overall project introduction and transparency rationale. Published as Chapter 1 Noesis and Chapter 1 Praxis.
- The AI and Machine-Learning Stack - complete stack orientation. Published as Chapter 2 Noesis and this Stack Explorer.
- How an AI System Sees a Sentence - tokenization. Coming next.
- From Tokens to Token IDs - vocabulary and token IDs. Coming soon.
- From Token IDs to Vectors - vectors and embedding lookup. Planned.
- How Embeddings Learn Meaning - learned embeddings. Planned.
- From Embeddings to Neural-Network Activations - neural-network layers and activations. Planned.
- Tensors and Prompt Representation - tensor-shaped prompt state. Planned.
- From Question to Business Insight - business data, calculation, and chart-backed results. Planned.
- 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
- Open the public MAGPAI GitHub repository
- Read Chapter 1: Why Build a Tiny Transparent AI System?
- Open Chapter 1 Praxis: Introducing MAGPAI
- Read Chapter 2 Noesis: The AI and Machine-Learning Stack
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.
Foundations
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.
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)
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)
Model and Machine Learning
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.
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)
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)
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)
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.
Application Knowledge and Tools
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)
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)
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.
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)
AI Application Systems
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)
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)
Operations and Governance
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.
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?
Business intent
A user asks whether the fictitious company MAG has improving sales in Chicago.
Stack layers: 14. AI Application Architecture
Text prompt
The sentence is normalized and treated as language input rather than business truth.
Stack layers: 6. NLP & Language Modeling
Tokens and token IDs
The prompt is split into visible tokens and mapped to vocabulary identifiers.
Stack layers: 6. NLP & Language Modeling
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
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
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
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
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
Introducing MAGPAI: A Tiny Transparent AI System
Available nowConnects the current Noesis article and Praxis project page to the repository structure, sample business scenario, and demonstration laboratory.
- 2
The AI and Machine-Learning Stack
Available nowPresents an accessible stack explorer based on the verified MAGPAI Session 01 stack material.
- 3
How an AI System Sees a Sentence
Available nowDocuments the Tokenizer Lab using the verified ManualTokenizer output for the recurring question: Are MAG sales up in Chicago?
- 4
From Tokens to Token IDs
Coming nextPreviews vocabulary and token-ID inspection, including vocabulary-training demonstrations where supported.
- 5
From Token IDs to Vectors
Coming soonPreviews an Embedding Lab that shows token IDs and their corresponding numerical vectors.
- 6
How Embeddings Learn Meaning
PlannedPreviews vocabulary or embedding training views that compare vector behavior before and after training.
- 7
From Embeddings to Neural-Network Activations
PlannedPreviews existing neural-network visualizations with inspectable activations and parameter changes where available.
- 8
Tensors and Prompt Representation
PlannedPreviews a prompt-tensor inspector for the recurring MAG business question.
- 9
From Question to Business Insight
PlannedPreviews the chart-backed answer flow for Are MAG sales up in Chicago?
- 10
From Transparent Chatbot to Agent
PlannedPreviews the chatbot, trace mode, and agent demonstrations with clear separation between educational behavior and implemented capability.