
The New AI Application Stack: What Comes After the LLM
'Application plus LLM' was never the architecture, it was the demo. Here's the eight-layer stack a real AI system actually needs, and a map to every layer.
For a while, "add AI to the product" meant adding one box: a call from the application straight to a model. That mental model was never wrong exactly, it was just describing a demo, not a system. A real AI application running in production today has grown a genuine architecture, eight distinct layers, each with its own failure modes, its own vendors, and its own reasons to page someone at 2 AM.
The one sentence to remember
"Application plus LLM" describes what a user sees. It has never described what actually has to work correctly underneath that for the system to be trustworthy, affordable, and reliable at real scale.
This is a full map of that stack, top to bottom, what each layer's actual job is, and where to go for the deep dive on any one of them. Think of this as the reference architecture the rest of this site's engineering coverage sits underneath.
The Stack
A demo only ever exercises two of these eight layers
A working demo proves the Application layer and the Model layer function together. It says nothing about the other six, which is exactly why the gap between a great demo and a working production system is so large, and exactly the subject of From Prototype to Production.
Application
The layer users actually see: the interface, the business logic wrapping around the AI functionality, the parts of the product that would exist in some form even if the AI component were swapped out entirely. One genuine inversion worth naming: in a lot of modern AI products, this is now the smallest layer by engineering effort, not the largest. The interesting work moved down the stack.
Agent / Workflow
The orchestration layer deciding what happens next: a fixed sequence of steps for predictable tasks, or a genuine agent loop, reason, act, observe, reason again, for tasks that need real flexibility. This is the layer that turns a single model call into a system capable of multi-step tasks, and it's covered in full architectural depth in AI Agents Are Not Chatbots, with the specific question of when this layer should fan out into several coordinating agents instead of one covered in Multi-Agent AI Systems, and a hands-on build of one concrete shape of that pattern, a Planner, a Worker, and an independent Reviewer, in Build a Multi-Agent System.
Model Router / LLMs
No single model is simultaneously the fastest, cheapest, most capable, and most specialized option for every request a real application makes. This layer's job is deciding, per request, which model actually fits, fast and cheap for simple requests, capable and slow for the ones that need it, specialized entirely for vision or code where a generalist underperforms. The full case for why this has become its own architectural layer, not just a model-selection afterthought, is in Why Companies Are Moving From Single-Model AI to Multi-Model AI Architectures.
RAG / Memory / Knowledge Graph
Three related but genuinely distinct components, often bundled together, that together determine what a model actually knows beyond whatever it learned during training.
| Component | What it actually provides |
|---|---|
| RAG (Retrieval-Augmented Generation) | Grounds a response in specific, current documents retrieved at request time, rather than relying purely on the model's memorized training data |
| Memory | Persists information across sessions, the distinction between working context and genuine long-term memory covered in AI Agents Are Not Chatbots |
| Knowledge Graph | Structured, explicit relationships between entities, useful precisely where free-text retrieval is too loose to reliably answer a question that depends on how things connect, not just what they say |
These three fail differently, so they need to be diagnosed differently
A wrong answer traced back to this layer could be a retrieval failure (the right document was never found), a memory failure (relevant context from an earlier session never made it into this one), or a knowledge-graph gap (the relationship the answer depended on was never modeled). Treating all three as one generic "context" problem makes debugging any of them harder than it needs to be.
Tools / MCP / APIs
How the system reaches past the model into the real world: databases, internal systems, external APIs, code execution. The standardized protocol increasingly used for this connection, and the architectural reasoning behind treating it as infrastructure rather than one-off integration code, is covered in MCP Explained.
Security / Guardrails / IAM
Three closely related concerns that belong in one layer because they answer one question together: what is this system, and whoever or whatever is currently acting through it, actually allowed to do. This spans identity and authorization for the agent itself, covered in AI Agent Identity, with the hands-on version of scoping that authority down to a real API, one tool per capability, tiered by blast radius, in How to Give AI Agents Access to APIs Without Giving Them Too Much Power; the full threat surface an agent introduces, covered in AI Agent Security and, for the specific mechanics of prompt injection, in Prompt Injection and Agent Hijacking; and the risk sitting even further upstream, in the models and dependencies the whole system was built on, covered in AI Supply Chain Security.
Evaluation / Observability
How anyone actually knows whether the seven layers above are working, before a user has to report that they aren't. Evaluation answers whether a specific change made the system better or worse, measured against a real baseline, covered in LLM Evaluation. Observability answers what actually happened inside any single request, which is what makes a specific wrong answer debuggable instead of a mystery, covered in AI Observability.
Inference Infrastructure
The compute foundation everything above actually runs on, and the layer where cost and latency get decided in practice, not in theory. GPU utilization, batching, caching, and the real economics of running models at scale are covered in The AI Inference Revolution.
Why the Mental Model Matters More Than the Diagram
Most AI project failure is a missing-layer problem, not a bad-model problem
Trace almost any production AI failure back far enough and it lands on a layer that simply wasn't built yet, not a model that wasn't capable enough. Hallucinations traced to a missing or weak retrieval layer. Runaway cost traced to a missing router. A security incident traced to a guardrails layer that was assumed rather than actually implemented. An unexplainable wrong answer traced to an observability layer that never existed. The model is very rarely the layer that was actually missing.
Once "AI system" means eight layers instead of one box, a lot of decisions that used to feel like technology choices become architecture choices: not "which model," but "which layers does this specific product actually need, and in what order should we build them."
A Map, Not a Checklist
| Layer | The question it answers |
|---|---|
| Application | What does the user actually see and do? |
| Agent / Workflow | What happens after the request comes in? |
| Model Router / LLMs | Which model handles this specific request? |
| RAG / Memory / Knowledge Graph | What does the model actually know here? |
| Tools / MCP / APIs | What can the system actually reach and do? |
| Security / Guardrails / IAM | What is it allowed to do, and by whom? |
| Evaluation / Observability | How do we know any of this is working? |
| Inference Infrastructure | What does all of this actually run on, and what does that cost? |
Not every product needs every layer built out fully on day one. A simple internal tool might genuinely be fine without a model router or a knowledge graph. But knowing which layers you're deliberately deferring is a very different position from not knowing they exist at all, and that difference is usually the one separating a system that scales from one that quietly breaks the first time it's actually tested.
The Bottom Line
The model was never the whole system. It was always the layer that got the headlines, sitting in the middle of a stack that, in any real production deployment, has seven other layers doing just as much work to keep it useful, safe, affordable, and debuggable. Treating "application plus LLM" as the architecture is how a team ends up building layer six for the first time during an incident, instead of before one.
The exercise worth doing with this diagram
Take your own AI system and mark which of these eight layers are actually built, not assumed, not "we'll add that later," actually built and tested. The gap between what's marked and what's not is the most honest roadmap you'll get for what to build next.
The LLM was the beginning of this stack, not the whole of it. Everything else in this series is the rest of the diagram.
Written by
Chetan Yamger
Cloud Engineer · AI Automation Architect · Modern Workplace Consultant
Cloud Engineer, AI Automation Architect, and Modern Workplace Consultant based in Amsterdam, Netherlands. Specializing in scalable, secure enterprise solutions with Microsoft Azure, Intune, PowerShell, and AI-driven automation using ChatGPT, Gemini, and modern LLM technologies.
Stay in the loop.
New articles, straight to you.
Deep-dive technical articles on Intune, PowerShell, and AI — no noise, no spam.
Discussion
Share your thoughts — your email stays private
Leave a comment