AI & Machine Learning

RAG Architecture Diagramai mloffline ingestion and online retrieve-rerank-generate lanes, plus a corrective-RAG error path. ML Training Pipeline Diagramai mldata to monitoring with an evaluation gate and drift-triggered retraining, also as a UML activity diagram. Neural Network Architecture Diagramai mla CNN layer diagram with tensor shapes and parameter counts, and an MLP neuron graph. Transformer Block Diagramai mla GPT-style pre-LN block with attention internals, and the original post-LN encoder block. LLM Agent Tool-Call Sequenceai mla UML sequence diagram of the tool-use loop between user, agent, LLM, tool and memory, with a timeout path.

Sample diagrams for AI and machine-learning systems: how data reaches a model, how models are trained and kept fresh, what is inside a network, and how an LLM agent talks to its tools. Each page has one large realistic diagram, a legend, a variant, pros and cons, and the same diagram as code.


1. Which Diagrams AI Work Uses

AI systems need two kinds of picture. System diagrams show the software around a model: data pipelines, retrieval, serving, monitoring and the calls between components. Model diagrams show what is inside the model: layers, tensor shapes, attention and residual connections. Teams that only draw one kind usually discover the other the hard way, either when a shape mismatch breaks training or when nobody can explain why the chatbot cited the wrong document.

Only one sample here is strict UML. UML covers software structure and behaviour; these are the other standard notations used alongside it. The agent tool-call page uses a UML 2.5 sequence diagram, and the training pipeline page also redraws its flow as a UML activity diagram. The RAG and pipeline diagrams are architecture data-flow diagrams, and the neural network and transformer pages use the layer and block conventions found in ML papers.

Which Diagram for Which AI Question? How does data reach the model? RAG architecture (data flow) How is a model built and kept fresh? Training pipeline / activity What layers and tensor shapes? Neural network layer diagram What happens inside an LLM layer? Transformer block diagram Who calls whom, in what order? UML sequence diagram Green = UML notation; blue = the standard ML and architecture notations used alongside it.

Start from the question you need to answer, not the notation. If the question is about order and responsibility at runtime, reach for a sequence diagram. If it is about where data moves and is stored, draw a data-flow architecture. If it is about the model's maths, draw layers with shapes.

2. Question to Diagram

QuestionDiagramSample page
How do documents become grounded answers?Architecture data-flow diagramRAG Architecture
How is a model trained, gated, deployed and retrained?Pipeline diagram / UML activityML Training Pipeline
What layers does the model have, and what shapes flow between them?Layer diagram, neuron graphNeural Network Architecture
How do attention, residuals and normalisation fit together?Block diagramTransformer Block
Which component calls which, and when does the agent loop stop?UML sequence diagramLLM Agent Tool-Call Sequence

Every sample uses the same colour rules: blue for normal steps, yellow for inputs, gates and highlights, green for outputs and success, red for error paths.

3. Further Reading

UML DiagramsSectionall 14 UML diagram types Architecture Diagramsdiagramsboxes, stores and data flows Diagrams as CodediagramsMermaid, PlantUML and Graphviz LLM Engineeringllm engineeringthe topics behind these samples Machine Learningmachine learningmodels, training and MLOps