Every AI stack diagram lies by omission.
The field is too wide now. "AI engineer" can mean tabular modeling, GPU kernel work, RAG pipelines, robotics control, eval harnesses, fine-tuning, model routing, agent observability, or one unlucky person maintaining all of it because the org chart was designed by vibes.
So here is the useful version.
As of June 2026, modern AI and ML is not one stack. It is seven interlocking layers: data and classical ML, foundation model architecture, training systems, post-training, retrieval and memory, agent orchestration, and inference operations.
The mistake is treating these as one job. They are not. They touch, but they fail differently.
The frontier moved from "which model is smartest" to "which system can be trusted to act." The model still matters. The harness around the model now decides whether the thing survives users, permissions, latency, cost, and Tuesday.
What the First Stack Diagrams Miss
Most diagrams still stop at "model plus app." That was fine when the product was a chat box. It is wrong when the product can search private data, call tools, edit files, trigger workflows, spend money, or ask another agent to do work.
The missing layer is control.
A useful AI system now has to answer seven boring questions before the model even gets interesting: what data can it see, what action can it take, who approved the action, what state persists, what happens if it fails, how do we replay the trace, and how do we know whether the answer was any good?
That is why the stack is getting more software-shaped. Frameworks are not just prompt wrappers anymore. The serious ones are becoming runtimes with persistence, tool schemas, human interrupts, sandboxing, evals, and observability.
Classical ML Is Not Dead
Start here because everyone keeps trying to bury it.
If your data is tabular, messy, medium-sized, structured, and tied to a business process, gradient boosted trees still eat deep learning for breakfast more often than people admit. Fraud models, churn models, pricing, demand forecasts, risk scoring, lead scoring, anomaly detection, ranking features, internal decision systems. You do not need a 70B parameter model to discover that invoices paid late tend to be paid late. You need clean features and a calibrated model.
The practical frameworks are boring in the good way: scikit-learn for standard ML pipelines, XGBoost and LightGBM for high-performance gradient boosting, plus Pandas, Polars, Spark, DuckDB, and whatever warehouse your data team has not managed to set on fire this quarter.
Classical ML techniques
- Gradient boosted trees: still brutal on tabular data.
- Feature engineering: less glamorous than models, more predictive than meetings.
- Calibration: turns scores into probabilities humans can price.
- Drift monitoring: catches reality changing under the model.
Frameworks that matter
The rule is simple: if the target is structured and the stakes are operational, try the boring baseline first. If the boring baseline wins, keep it. Your users will not mourn the absence of a transformer.
The Foundation Model Layer
Deep learning's center of gravity is still the transformer. That has not changed. What changed is the amount of engineering wrapped around the transformer to make it trainable, serveable, and less financially offensive.
The 2026 architecture menu looks like this.
Transformers and attention
Still the default for language and many multimodal systems. FlashAttention-style kernels matter because attention is not just math. It is memory traffic wearing a math costume.
Mixture of experts
MoE activates only part of the model per token. More parameters, similar active compute, more routing headaches. Very useful, very easy to make unstable.
Mamba and state space models
SSMs attack the long-sequence cost of attention. They are not a clean transformer replacement everywhere, but they are real enough to keep in the map.
Diffusion, DiT, and flow
Image, video, and audio generation shifted toward transformer-backed diffusion and flow matching. The U-Net did not vanish, but DiT and flow-based systems are now the serious scaling path.
Then there are multimodal systems: CLIP-style contrastive encoders, vision-language models, speech-language models, vision-language-action models, and JEPA-style world models. This is where the field is becoming less "text model with image input" and more "general sequence and world-state modeling."
Language is still the interface. It is no longer the whole substrate.
Training Frameworks: What People Actually Use
For training and research, the core frameworks are not mysterious.
- PyTorch: the default deep learning workbench for most research and production training.
- JAX: excellent for accelerator-oriented research, composable transformations, and large-scale numerical work when the team can handle the sharp edges.
- TensorFlow and Keras: still important, especially where deployment, legacy systems, or Keras 3's multi-backend API make sense.
- Hugging Face Transformers: the practical interface to pretrained models across text, vision, audio, and multimodal tasks.
- Ray: distributed Python and AI workloads when one machine stops being enough.
- MLX: increasingly relevant for local research and inference on Apple silicon.
This is not religious. Use PyTorch when you want the broadest ecosystem. Use JAX when transformations and large-scale research are the point. Use Keras when API cleanliness and backend flexibility matter. Use Hugging Face because reimplementing every model loader is not a personality trait.
The Framework Map Is Really a Failure-Mode Map
The wrong way to choose frameworks is by popularity. The useful way is by the failure mode you are trying to reduce.
If the risk is model quality
Use PyTorch, JAX, Hugging Face, Weights & Biases, MLflow, and strong eval suites. You are in training, fine-tuning, or experiment-management land.
If the risk is retrieval quality
Use LlamaIndex, LangChain, rerankers, hybrid search, metadata filters, graph retrieval, and source-quality evals. The vector database is only plumbing.
If the risk is agent control
Use LangGraph, OpenAI Agents SDK, Google ADK, Microsoft Agent Framework, Pydantic AI, CrewAI, Mastra, or Strands. Pick by language, state model, and operational constraints.
If the risk is inference cost
Use vLLM, SGLang, TensorRT-LLM, TGI, llama.cpp, Ollama, MLX, model routing, prompt trimming, caching, and smaller specialist models.
Notice the pattern: the framework is never the point. It is the shape of the failure you are willing to own.
Post-Training Is Where Models Become Products
Pretraining teaches a model the rough structure of the world. Post-training teaches it how not to behave like a stochastic autocomplete raised in a cave.
The modern post-training stack is layered:
- Supervised fine-tuning: show the model the task format and desired behavior.
- RLHF: optimize behavior using human preference signals and a reward model.
- DPO and relatives: optimize directly on preference pairs without the full RL loop.
- GRPO-style reasoning RL: popularized by DeepSeek-R1, using group-relative rewards to train reasoning behavior.
- Constitutional and rule-based feedback: replace some human annotation with principles, critiques, and AI-generated preferences.
- Distillation: compress a stronger model's behavior into a smaller or cheaper model.
- LoRA and QLoRA: adapt models cheaply without updating every parameter.
- Quantization: reduce memory and cost, then pray the quality drop is smaller than the finance team's patience.
This is why "which base model should we use?" is an incomplete question. A mediocre base model with good data, evals, retrieval, and post-training can beat a better base model wrapped in garbage.
The model is not the product. The behavior envelope is the product.
RAG, Retrieval, and Memory
RAG became the default because models are finite, stale, and expensive. Retrieval lets you bring fresh or private context at runtime instead of trying to bake everything into weights.
The naive version is easy: chunk documents, embed chunks, store vectors, retrieve top-k, stuff context into prompt. It also fails in boring ways: bad chunking, stale documents, missing metadata, weak reranking, wrong citations, no permission model, and a prompt that says "use the context" as if the model signed a contract.
The useful version is more structured:
- Hybrid retrieval: combine vector search with keyword search, filters, and metadata.
- Reranking: retrieve broadly, then rank more precisely with a stronger model.
- Graph and structured retrieval: organize entities, relationships, documents, and time instead of treating knowledge as a bag of chunks.
- Agentic retrieval: let the agent decide when to search, what to search, and whether the result is enough.
- Memory systems: maintain durable user, task, and environment state across sessions.
Frameworks here include LangChain, LangGraph, LlamaIndex, Haystack, DSPy, and vector stores like Qdrant, Milvus, Weaviate, Chroma, FAISS, and pgvector.
The framework matters less than the discipline. Retrieval systems are data systems. Treat them that way or enjoy debugging cosine similarity like it is a moral failing.
Agents Are Mostly Systems Engineering
An agent is not a model. It is a loop around a model.
The loop has state, tools, permissions, memory, retries, planning, evals, traces, human approval gates, and failure modes that do not show up in benchmark tables. This is why most demos work and most deployed agents disappoint. The demo only has to succeed once. Production has to survive Tuesday.
The modern agent frameworks are converging around the same ideas:
- Tool calling: typed calls to external functions, APIs, code sandboxes, databases, and browsers.
- Workflow graphs: explicit state machines instead of one unbounded "agent" prompt.
- Handoffs: specialized agents for research, coding, review, execution, and user communication.
- MCP: a standard interface for connecting models to tools and data sources.
- A2A: a standard interface for agent-to-agent delegation, capability discovery, and task state.
- Tracing: every tool call, model call, input, output, token count, latency, and decision path logged.
- Guardrails: permissions, sandboxing, schema validation, prompt injection defense, and human checkpoints.
The serious frameworks now include OpenAI Agents SDK, Google ADK, LangGraph, Microsoft Agent Framework, Claude Agent SDK, Pydantic AI, CrewAI, Mastra, Strands Agents, LlamaIndex Workflows, DSPy, and smaller framework-specific runtimes around vertical products.
But the correct move is often not "add more agents." The correct move is "make the workflow explicit." Multi-agent systems are useful when the boundaries are real. Otherwise you have invented Slack for models.
The Agent Stack Is Becoming Its Own Stack
By mid-2026, agents are no longer just a prompt pattern. They are becoming an infrastructure category.
OpenAI is pushing a model-native agent harness with controlled workspaces, files, tools, and sandbox execution. Google ADK frames agent development as code-first software engineering with tools, evaluation, deployment, and A2A integration. LangGraph is betting on durable state, human interrupts, persistence, and long-running workflows. Microsoft is merging AutoGen and Semantic Kernel lineage into Agent Framework. Anthropic is exposing the Claude Code loop through Agent SDK. AWS Strands, Pydantic AI, CrewAI, Mastra, and others are all converging on the same brutal truth: an agent that cannot be traced, paused, resumed, permissioned, or evaluated is not production software.
Where Agents Go by the End of 2026
The end of 2026 will not be "fully autonomous AI employees." That phrasing belongs in vendor decks and other minor crime scenes.
The realistic end-of-2026 agent shape is narrower and more useful:
- Task-specific agents inside existing software: sales, support, finance, security, coding, research, analytics, and operations workflows get embedded agents rather than generic chatbots.
- Computer-use agents get better, but stay brittle: OSWorld showed the original gap between humans and GUI agents; newer cross-application benchmarks like WindowsWorld show why multi-app professional workflows are still hard.
- MCP becomes the tool and data connector layer: more products expose MCP servers, and more agent clients consume them. This is useful, but it also creates a new supply chain and permission surface.
- A2A becomes the coordination layer: agents need a way to advertise capabilities, receive tasks, stream updates, and return artifacts without pretending every remote agent is just another function call.
- Durable execution becomes mandatory: long-running agents need checkpoints, interrupts, replay, and idempotent side effects. Otherwise every timeout is a little murder mystery.
- Agent ops becomes a real job: traces, evals, cost controls, rollback, audit logs, identity, kill switches, and permission reviews move from "nice to have" to "why did this thing email the customer?"
This is the part builders should pay attention to. Capability is improving fast, but deployment is being gated by governance, identity, cost, and reliability. Not glamour. Plumbing. The usual villain.
Where 2027 Stands
This section is a forecast, not prophecy. The evidence points in a clear direction, but anyone giving you a precise 2027 agent timeline is either selling software or avoiding a harder question.
By 2027, agents split into two worlds.
The first world is boring and valuable. Vertical, permissioned, auditable agents that operate inside known workflows. Coding agents that can work through issue queues. Research agents that gather evidence and cite sources. Support agents that triage, retrieve, draft, and escalate. Finance agents that reconcile records but need approval before moving money. These survive because the workflow is bounded and the ROI is legible.
The second world gets humbled. Broad autonomous agents with vague goals, broad access, weak evals, and no governance will get demoted or shut down. Gartner is already projecting that governance gaps will cause many enterprises to demote or decommission autonomous agents by 2027. That is not anti-agent. That is normal software growing up and discovering compliance departments.
The durable 2027 pattern is not one agent doing everything. It is a governed mesh of small agents, tools, memories, and workflows. Each agent has a scope. Each scope has permissions. Each permission has logs. Each high-risk action has a checkpoint. Glamorous? No. Shippable? Yes.
The more autonomy you give the system, the more boring the surrounding software must become.
Inference Is the New Backend War
Once the model is good enough, the next bottleneck is serving it cheaply and reliably.
The key techniques are now standard vocabulary:
- PagedAttention: manage KV cache memory efficiently.
- Continuous batching: keep GPUs busy across many live requests.
- Prefix caching: reuse shared prompt prefixes instead of recomputing them.
- Speculative decoding: draft tokens cheaply, verify with the main model.
- Quantization: trade precision for memory and speed.
- Routing: send easy tasks to cheaper models and hard tasks to stronger ones.
- Disaggregation: split prefill, decode, routing, and multimodal stages when scale demands it.
Frameworks: vLLM, SGLang, TensorRT-LLM, Hugging Face TGI, llama.cpp, Ollama, and MLX for Apple silicon. For cloud production, inference is now its own engineering discipline. For local AI, llama.cpp and Ollama made "run the model here" normal.
Evals, Observability, and the Quality Loop
The most important framework in an AI system is often not the model framework. It is the evaluation harness.
Without evals, every prompt change is a production experiment. Every model swap is superstition. Every agent improvement is a story told by the person who made it.
Modern AI evaluation has layers:
- Unit evals: known inputs, expected outputs, exact or rubric-based checks.
- Regression evals: protect previous behavior when prompts, retrieval, or models change.
- LLM-as-judge: useful, but only when calibrated against human review.
- Task success: did the user actually accomplish the job?
- Trace analysis: inspect every model call, tool call, retrieval result, latency spike, and failure path.
- Monitoring: drift, data quality, cost, hallucination rate, citation quality, safety events.
Frameworks here include MLflow, Weights & Biases, LangSmith, Langfuse, Arize Phoenix, Evidently, promptfoo, and custom eval suites. Custom is not a sin. Unmeasured is.
Security and Governance Are Architecture Now
Classic ML governance cared about data, model behavior, fairness, drift, and auditability. Agent governance has to care about all of that plus action.
An agent can read private data, browse hostile content, call tools, write files, send messages, update records, and trigger other agents. That combination changes the threat model. The OWASP Top 10 for Agentic Applications exists because autonomous systems fail differently from chatbots. The 2025 AI Agent Index found that the agent ecosystem is powerful, fast-moving, and inconsistently documented, especially around safety, evaluations, and social impact.
The practical governance model is simple enough to fit on a whiteboard:
Agent risk = data access x tool power x autonomy x blast radius.
The security checklist is not exotic. Least privilege. Scoped tokens. Sandboxed code execution. Separate read and write permissions. Human approval for irreversible actions. Tool schemas that validate inputs and outputs. Memory poisoning defenses. Prompt injection isolation. MCP server review. A2A authentication and authorization. Logs that a human can actually read.
The weird part is not the controls. The weird part is that AI builders have to relearn enterprise security because the model can now ask for the dangerous thing in fluent English.
The Actual Decision Tree
If you are building in 2026, the practical question is not "what is the latest technique?" It is "what failure mode am I buying down?"
If your data is structured
Start with scikit-learn, XGBoost, or LightGBM. Add deep learning only when the baseline loses for a concrete reason.
If your task needs private knowledge
Build RAG with hybrid retrieval, metadata, reranking, source freshness, and permissions. The vector DB is not the whole system.
If your task needs action
Use an explicit workflow graph, typed tools, sandboxing, traces, and human checkpoints. Do not hide control flow in a paragraph.
If your model is too expensive
Try routing, caching, quantization, distillation, smaller models, vLLM/SGLang/TensorRT-LLM, and fewer unnecessary tokens.
That last one is underrated. Most AI systems waste tokens like a founder with fresh funding wastes SaaS seats. The cheapest inference optimization is often deleting prompt junk.
Where I Would Put My Attention
If you want to stay current without drowning, track these areas.
First, inference systems. Model intelligence will keep improving, but cost and latency decide what can ship. vLLM, SGLang, TensorRT-LLM, TGI, llama.cpp, Ollama, MLX, and model routing are not side quests. They are the bridge from demo to product.
Second, evals and observability. Agents make failure harder to see. Traces, regression tests, and quality metrics are the only way to prevent "the model got smarter" from becoming "the product got weirder."
Third, retrieval and memory. The next useful AI products are not generic chatbots. They are systems that know the user's world, the company's data, the current task, and what happened yesterday.
Fourth, post-training. The gap between base capability and useful behavior is still huge. DPO, GRPO, distillation, LoRA, synthetic data, and eval-driven fine-tuning are the knobs teams can actually turn.
Fifth, world models and multimodal action. This is earlier, but important. If agents are going to act reliably in physical or complex digital environments, they need to predict consequences, not just produce plausible next tokens.
The field is moving fast, but the shape is getting clearer.
Models are becoming components.
Data systems are coming back.
Evals are becoming non-negotiable.
Inference is becoming infrastructure.
And the real work is shifting from "can the model answer?" to "can the whole system behave?"
That is the stack now.
Sources
- PyTorch documentation
- JAX documentation
- Keras 3 documentation
- Hugging Face Transformers documentation
- vLLM documentation
- SGLang documentation
- NVIDIA TensorRT-LLM documentation
- Hugging Face Text Generation Inference documentation
- llama.cpp repository and Ollama documentation
- LangChain retrieval documentation and LlamaIndex RAG documentation
- OpenAI Agents SDK documentation, OpenAI's Agents SDK harness and sandbox update, and Model Context Protocol documentation
- Google Agent Development Kit documentation and Agent2Agent Protocol specification
- LangGraph overview, LangGraph persistence documentation, and LangGraph interrupts documentation
- Microsoft Agent Framework documentation, Claude Agent SDK documentation, CrewAI documentation, and Pydantic AI documentation
- Mastra framework documentation and AWS Strands Agents announcement
- Ray documentation, MLflow documentation, Weights & Biases documentation, and Evidently AI documentation
- Stanford HAI 2026 AI Index Report and Epoch AI trends
- Gartner on task-specific agents in enterprise apps, Gartner on enterprise AI coding agents, and Gartner on agent governance failures
- OWASP Top 10 for Agentic Applications 2026 and The 2025 AI Agent Index
- OSWorld and WindowsWorld computer-use agent benchmarks
- scikit-learn documentation, XGBoost documentation, and LightGBM documentation
- FlashAttention, Mamba, Switch Transformers, and Expert Choice Routing
- LoRA, QLoRA, DPO, and DeepSeek-R1
- Diffusion Transformers, Flow Matching, Rectified Flow, and CLIP
- Yann LeCun, A Path Towards Autonomous Machine Intelligence and V-JEPA 2