A solid bridge from web developer to artificial intelligence
The generative AI revolution is in full swing, opening thousands of new career openings for programmers. But the barrier of complex mathematics, and the difference in technology stack (from JavaScript to Python/ML), puts a lot of web developers off before they start.
This roadmap is built specifically for you — someone who already has basic programming knowledge (JavaScript) but no experience at all with AI or machine learning. We will build the foundation together from zero: shifting your programming mindset to Python, doing algebra and calculus through code, writing and training a neural network with PyTorch by hand, mastering prompting and function calling, building semantic retrieval (RAG) systems, and finishing by designing AI agents capable of reasoning and complex collaboration, running entirely offline on your own computer.
Every lesson's code is identical in both languages — code is language-neutral here, and all comments are written in English throughout, so the code blocks and downloadable files are the same files in both versions.
Placing yourself: your role in the AI world
The world of artificial intelligence is vast, and full of job titles that are easy for a newcomer to confuse. To pick the right learning target — and the right jobs to apply for — you need to tell the main roles apart:
| Role | What the job focuses on | Main tools & skills | How this roadmap relates |
|---|---|---|---|
| AI Engineer | Applying existing AI models (LLMs) to build applications, integrating RAG, and developing autonomous AI agents that solve real problems. | LLM APIs (OpenAI, Gemini), local LLMs (Ollama), frameworks (LangGraph), vector DBs, RAG pipelines, Python/JS. | 🎯 The core target (100%): Lessons 11 to 20 train every skill you need to hold this role. |
| Machine Learning Engineer | Building, training and optimising specialised neural network architectures (CNN, RNN, Transformer) from raw datasets. | PyTorch, TensorFlow, calculus, linear algebra, model architecture design. | 🧠 Foundational knowledge (Lessons 1–10): gives you the mathematics and the raw-neural-network training mindset you need to understand how an LLM works inside. |
| Data Scientist | Analysing data, finding trends, and building statistical forecasting models (regression, clustering) to support business decisions. | SQL, Pandas, NumPy, Scikit-Learn, probability and statistics, data visualisation. | 📊 Partial support: Lesson 3 (Pandas/NumPy) provides extremely useful groundwork in data handling. |
| MLOps Engineer | Setting up serving infrastructure, optimising model inference speed, automating training pipelines, and monitoring real-world performance. | vLLM, Docker, Kubernetes, Prometheus, Grafana, tracing tools (Phoenix), CI/CD. | 🚀 Extension (Lesson 20): the final lesson introduces the basics of MLOps (vLLM serving, tracing, Ragas evaluation) to prepare you for production. |
| Research Scientist | Academic research: inventing new AI algorithms or the next generation of foundation model architectures (as the authors of the Transformer did). | Advanced mathematics, writing scientific papers, deep research programming at large labs (OpenAI, DeepMind). | ❌ Out of scope: this roadmap targets the practising applied engineer, not theoretical mathematical research. |
The AI skills universe (interactive career roadmap)
Artificial intelligence is a whole "universe" with many different career orbits. Hover over or click the orbital branches and the star nodes on the galaxy map below to see each career direction and the lessons in this roadmap that correspond to it:
🌌 The AI orbit: the practising engineer
Click a star branch, or move your mouse across the map, to start finding your bearings in AI study and work.
- Understand the mathematics and the Transformer architecture running underneath, so you never treat AI as a mysterious "black box".
- Pull down and fine-tune open-source models running locally, entirely free.
- Build enterprise-grade RAG solutions and chains of agents that automate a company's complex tasks.
Hands-on locally, and visualised
Every article in the series comes with complete, runnable code examples that work 100% free and offline on your own machine, using small local language models through Ollama. The series also includes interactive simulators:
- Interactive RAG & 3D vector space laboratory (in Vietnamese)
- Agentic state-graph & ReAct loop simulator (in Vietnamese)
Before you start
Official documentation worth reading: the official PyTorch documentation, the Ollama site and API docs, the LangGraph agent-building guide.
Core glossary
A quick reference for the main concepts that come up again and again across the roadmap:
| Term | Short explanation |
|---|---|
| Tensor | Deep learning's central data structure: an n-dimensional array of numbers that can move freely between CPU and GPU. |
| Autograd | PyTorch's mechanism for tracking operations and computing their gradients (derivatives) automatically, for training. |
| MLP (Multi-Layer Perceptron) | The most basic neural network architecture: an input layer, fully connected hidden layers, and an output layer. |
| Backpropagation | The algorithm that propagates the error backwards from the output to earlier layers, to compute gradients and update the weights. |
| Word embedding | A way of encoding text as dense vectors of real numbers that preserves the semantic relationships between words. |
| Attention mechanism | A learned mechanism that lets a model concentrate its computation on the most important parts of a sequence. |
| Transformer | A model architecture built entirely on self-attention — the foundation of GPT's and Gemini's success. |
| RAG (Retrieval-Augmented Generation) | Searching external documents to add context to an LLM's answer, which is what removes hallucination. |
| Vector database | A system for storing and indexing vectors so that semantic similarity search runs extremely fast. |
| AI agent | A system that uses an LLM as its reasoning brain alongside external tools, to plan and act on its own. |
| Fine-tuning | Additional training of an already-trained large model on a small dataset, to tune its style or a specialised skill. |
| MLOps | The practice of packaging, monitoring, tracing and evaluating the quality of an AI system in production. |
The 20 hands-on lessons
Lesson 1: Shifting your programming mindset — from JS to Python for AI
Getting comfortable in Python through a JavaScript lens. Basic syntax, managing libraries (pip vs npm), virtual environments (venv vs node_modules), memory reference semantics and asynchronous programming (asyncio). Hands-on: write your first data normalisation script.
Lesson 2: Linear Algebra & Derivatives from the command line
The geometric meaning of vectors, matrices and matrix multiplication. The dot product, and how it makes the shape rule something you can derive. What a derivative and a loss function really are. Write the Gradient Descent optimiser yourself in pure Python, with no external libraries.
Lesson 3: Working with large data — NumPy & Pandas in depth
Why Python for loops are so slow, down to the hardware. NumPy's vectorization and broadcasting to speed up large-data processing by tens of times. Pandas for messy real tables: DataFrames, loc and iloc, missing cells and groupby. Hands-on: preprocess a batch of images with both libraries.
Lesson 4: PyTorch basics — Tensor & Autograd in depth
The Tensor data structure and its GPU/NPU acceleration. Reshaping tensors (.view vs .reshape), and the dynamic computation graph behind Autograd that computes full derivatives for you.
Lesson 5: Simple neural networks (Perceptron & MLP)
Building an artificial neuron, and why a non-linear activation function (ReLU, Sigmoid) is what lets a network solve non-linear problems. Assembling a multi-layer MLP, and strategies for initialising the weights randomly.
Lesson 6: Training a network — Loss & Backpropagation
Measuring prediction error with MSE and cross-entropy loss. Writing your first complete training loop, using backpropagation and the Adam optimiser.
Lesson 7: Computer vision basics — convolutional networks (CNN)
How a kernel scans an image (the convolution operation), how pooling layers reduce spatial dimensions, and how image features get extracted. Train your first CNN to recognise handwritten digits on a local copy of MNIST.
Lesson 8: Text processing & word embeddings
Turning words into numbers (tokenization: word vs subword/BPE). Building semantic word vectors with the nn.Embedding layer, and the cosine similarity maths that lets you match words with related meanings.
Lesson 9: Recurrent networks (RNN) and the rise of attention
How RNNs and LSTMs remember a sequence over time. The vanishing gradient limit that hurts recurrent networks on long sentences, and the first idea that let a decoder focus its attention on the important words of the source.
Lesson 10: The Transformer architecture under the microscope
Dissecting multi-head self-attention, the positional encoding mechanism, and assembling a complete original Transformer block in PyTorch.
Lesson 11: Prompt programming & mastering the LLM API
Structured communication with a model through its API: the system, user and assistant roles. Mastering the temperature and top-p controls, and strategies for trimming context so you don't overflow the token context window.
Lesson 12: Structured Outputs & Function Calling
Forcing an LLM to reply with JSON that matches a predefined schema, and why the guarantee holds: the grammar mask that makes an invalid token impossible rather than unlikely. Then the full four-step function calling cycle, with a test that proves the pipeline really read its input.
Lesson 13: Running an LLM offline with Ollama
Download and run large open-weight models (Llama, Qwen, Gemma) fully offline on your own machine. Measure your machine's real memory footprint and tokens per second, then call the local localhost:11434 endpoint from Python using only the standard library.
Lesson 14: Basic RAG — question answering over your own documents
Build the five-stage RAG pipeline with hand-written TF-IDF and cosine similarity, then measure the two places it breaks: keyword retrieval scoring an out-of-scope question higher than an on-topic one, and chunking that severs a condition from the rule it governs.
Lesson 15: Chunking strategies & vector databases in depth
Measure which chunking strategy wins on which kind of text, implement an HNSW-family approximate search graph and measure the real recall-versus-speed curve, then build hybrid search with RRF over a corpus where each retriever alone fails somewhere.
Lesson 16: Advanced RAG — query rewriting & cross-encoder reranking
Measure what query rewriting really buys (3.5x for keyword search, 1.8x for embeddings), implement cross-encoder reranking with a real language model and measure both its discriminating power and its cost, then separate what you search from what you read with parent-child indexing.
Lesson 17: AI agents & the ReAct loop
Write a complete ReAct loop in plain Python with no framework, record the agent's history with proper message roles, and replace eval() with an AST-based calculator after measuring exactly where a character filter leaks.
Lesson 18: Stateful agents with LangGraph
Reimplement LangGraph's three core ideas in plain Python: state merged through per-field reducers, conditional edges that make the graph cyclic, and a human-in-the-loop interrupt that returns a resumable checkpoint instead of blocking on input().
Lesson 19: Fine-tuning an LLM with LoRA
Tell RAG and fine-tuning apart, then implement LoRA from scratch in NumPy and check all four of its claims with assertions — including an experiment showing how leaving alpha/r uncontrolled inverts the conclusion about rank entirely.
Lesson 20: MLOps — serving, tracing & automated evaluation
Serve with vLLM and PagedAttention, implement the Ragas metrics both by keyword overlap and semantically, and discover that the Jaccard relevance metric scores a deliberately wrong answer twice as high as the correct one — because an untested evaluator is worse than none.
Comments