Book a free call

The 7-Layer AI Tech Stack, Explained Layer by Layer

The 7-layer AI tech stack runs from infrastructure and data up through models, orchestration, apps, observability and governance. Here is what each layer does.

Hertiv engineering teamReviewed by a senior engineer
8 min read
The 7-Layer AI Tech Stack, Explained Layer by Layer
On this page

Short answer

The 7-layer AI tech stack is a way of organising the technology behind an AI product into seven layers: infrastructure, data, foundation models, orchestration, applications, observability and governance. Each layer has its own tools and decisions, and a weakness in a lower layer limits everything above it.

What is the 7-layer AI tech stack?

The 7-layer AI tech stack is a way of organising the technology behind an AI product into seven layers, from the hardware at the bottom to the rules and controls at the top. It helps teams see what they have, what is missing, and where a failure in one part will hurt the rest.

The seven layers are infrastructure, data, foundation models, orchestration, applications, observability and governance. A team building a support agent, for example, needs compute to run the model, clean documents to retrieve from, a model that fits the task, code that connects the pieces, an interface users can reach, logs that show what happened, and rules that keep the system safe.

LayerWhat it doesTypical tools
1. InfrastructureCompute, storage and networkingCloud GPUs, containers, queues
2. DataCollect, clean and store dataPipelines, vector stores, catalogues
3. Foundation modelsGenerate, classify and embedHosted APIs, open-weight models
4. OrchestrationConnect models, tools and dataFrameworks, agents, RAG code
5. ApplicationsWhat users actually touchChat, search, copilots, APIs
6. ObservabilitySee what the system doesLogs, traces, evaluation sets
7. GovernanceRules, access and safetyPolicies, guardrails, audits

Layers are not bought in order. Most teams start with a model and an application, then add the data, observability and governance layers once the first version is working. The stack is a map for planning, not a shopping list.

Layers 1 and 2: infrastructure and data

Infrastructure and data are the bottom two layers, and they decide what the rest of the stack can do. Infrastructure is the compute, storage and networking that runs everything, while data is the content the models learn from and retrieve.

Infrastructure choices start with where the model runs. A hosted API needs almost no infrastructure of its own, while a self-hosted open-weight model needs GPUs, containers and a way to scale them. Teams that need low latency or strict data control usually host the model themselves, and pay for that control in operations work. Queues and caching sit here too, since they keep costs down when traffic spikes.

The data layer collects, cleans and stores the content the system uses. For retrieval systems this means chunking documents, creating embeddings and storing them in a vector store with metadata such as source, date and owner. Data quality matters more than volume: a thousand clean, current documents beat ten thousand stale ones, because the model can only retrieve what is there.

The two layers are linked. If the data pipeline is slow or unreliable, the application answers with old information no matter how good the model is. Fix the data layer before tuning the model.

Layer 3: foundation models

The foundation model layer is the model itself: the large language model, embedding model or specialised model that generates text, classifies content or turns text into vectors. Choosing the model is the most visible decision in the stack, and often the least important one to get perfect on day one.

Teams choose between hosted models reached through an API and open-weight models run on their own infrastructure. Hosted models are faster to start with and are updated by the provider, but they send data outside the team's systems and their behaviour can change without warning. Open-weight models give control over data and versioning, but need GPU capacity and someone to operate them.

Most products use more than one model. A common pattern is a large model for hard reasoning, a smaller model for routine classification or summarising, and an embedding model for search. This keeps costs down, since the expensive model only runs where it earns its keep.

Model choice should follow an evaluation set, not a benchmark chart. Twenty real cases from the team's own work, with known good answers, will show which model fits better than any public leaderboard.

Layer 4: orchestration and agents

Orchestration is the code that connects the model to data, tools and users. It turns a model that can answer a question into a system that can look up a record, call an API, remember context and hand off to a human when needed.

The most common orchestration pattern is retrieval-augmented generation, where the system searches the data layer for relevant documents and passes them to the model with the question. This grounds answers in the team's own content and makes it possible to show sources, which is how users learn to trust the output.

Agents extend orchestration by letting the system take several steps: check stock, draft a quote and create a ticket, for example. Each step is a tool call with defined inputs and outputs, and the agent decides the order. Agents need tighter controls than single-step assistants, because one bad step can propagate through the rest.

Frameworks help here, but they are not the stack. A framework that hides the prompts, the retrieval and the tool calls makes debugging harder. Keep the orchestration code readable, log every step, and make it easy to swap one model for another without rewriting the whole layer.

Layer 5: applications and interfaces

The application layer is what users actually touch: the chat window, the search box, the copilot inside an existing tool, or the API that another system calls. It is the only layer most users ever see, so it carries the whole reputation of the product.

Good application design starts with the workflow, not the model. A support copilot that sits inside the ticketing tool and drafts replies gets used, while a separate chat window that staff must remember to open usually does not. The interface should show sources, make it easy to correct a bad answer, and make the handoff to a human obvious.

Applications also set the feedback loop. Every correction, thumbs-down and handoff is data for the evaluation set, which feeds back into the observability layer. Teams that capture this feedback improve faster than teams that only watch usage numbers.

One application often serves several user groups. A support agent, an internal search tool and a sales copilot may share the same model and data layers but present different interfaces. Sharing the lower layers keeps costs down, while separate interfaces keep each workflow simple.

Layers 6 and 7: observability and governance

Observability and governance are the top two layers, and they are the ones teams most often skip. Observability shows what the system actually did, and governance sets the rules for what it is allowed to do.

Observability means logging every prompt, retrieval result, tool call and answer, plus the cost and latency of each step. With those logs, a team can replay a bad answer, find which source or step caused it, and fix the right thing. Without them, quality debates are guesswork. An evaluation set of real cases with known good answers belongs here too, so each change can be scored before it ships.

Governance covers access, safety and accountability. It decides who can use the system, what data it may touch, which topics need a human review, and how long logs are kept. Guardrails sit here: filters for disallowed content, checks that block actions above a risk threshold, and approval gates for irreversible steps such as payments or messages to customers.

The two layers reinforce each other. Governance rules are only as good as the logs that prove they were followed, and observability is only useful if someone reviews what it shows. Assign an owner for each layer, and review both on a regular schedule rather than after an incident.

Example (hypothetical): a support team maps its stack

Example (hypothetical): a support team of six agents handles 300 tickets a week. Each agent spends about 8 minutes searching the help centre per ticket, which is 300 times 8 minutes, or 2,400 minutes, about 40 hours a week across the team. The team decides to map its stack before buying anything.

They find the layers are thin. Infrastructure is a single shared server. The data layer is a help centre with duplicate and outdated articles. There is no model layer yet, no orchestration, and no logs beyond ticket counts. Governance is a verbal rule that agents check billing questions with a supervisor.

The team starts small. They clean the help centre down to one current version of each article, store embeddings in a vector store, and build a retrieval step that passes the best five articles to a hosted model. The agent drafts a reply with citations, and a human sends it.

After a month, searching takes about 2 minutes per ticket instead of 8, which is 300 times 2 minutes, or 600 minutes, about 10 hours a week. The team saves about 30 hours a week, and the saved time goes to the tickets that need a human. The mapping exercise mattered more than any single tool choice, because it showed the data layer was the bottleneck.

What are the common mistakes?

The most common mistakes are starting with the model, skipping the data layer, and treating observability and governance as work for later.

  • Picking the model first. Teams compare models before they have clean data or an evaluation set, then discover the model was never the bottleneck.
  • Skipping data quality. Retrieval over stale or duplicated documents produces confident wrong answers, and no model fixes that.
  • Overbuilding orchestration. Multi-step agents before a single-step assistant works just multiply failure modes.
  • No evaluation set. Without real cases and known good answers, every change is a guess and regressions go unnoticed.
  • Governance as an afterthought. Adding access rules and guardrails after launch is harder than building them in, and incidents force the issue anyway.
  • One layer doing everything. When the application layer also handles retrieval, logging and safety, it becomes fragile and hard to change.

If your stack is generative-AI-specific, the generative AI tech stack goes deeper on model and retrieval choices.

For the build itself, LLM development covers the model layer.

And MLOps consulting covers the observability layer.

Key takeaways

  • The stack has seven layers: infrastructure, data, models, orchestration, applications, observability and governance
  • A weakness in a lower layer limits everything above it, especially data quality
  • Most products use several models, with the expensive one reserved for hard cases
  • Observability and governance are the layers teams skip most, and miss most
  • Map your stack before buying: one page with the gaps marked guides spending

Frequently asked questions

Do I need all seven layers to start?

No. Most teams start with a model, a simple application and a small set of clean data, then add orchestration, observability and governance as the system grows. The layers are a map for planning, not a list of purchases you must make on day one.

Is the 7-layer stack only for generative AI?

It is most often used for generative AI products, but the same layers apply to any AI system: something must run it, feed it data, do the work, connect it to users, show what happened and set the rules. The model layer just looks different for other kinds of AI.

What is the difference between orchestration and the application layer?

Orchestration is the code that connects the model to data and tools, such as retrieval and agent steps. The application layer is what users touch, such as a chat window or a copilot inside another tool. One application can sit on top of shared orchestration.

Which layer should I fix first?

Fix the data layer first if answers are wrong or out of date, and the observability layer first if you cannot tell why answers are wrong. Model choice comes after both, because a better model cannot fix bad data or invisible failures.

How does governance differ from guardrails?

Governance is the whole set of rules: who can use the system, what data it may touch, and who is accountable. Guardrails are one part of governance, the technical checks that block or flag risky outputs and actions at run time.

Can small teams run a 7-layer stack?

Yes, because the layers can be thin. A small team might use a hosted API for models, a managed vector store for data, a simple retrieval script for orchestration, and a spreadsheet for its evaluation set. The layers describe responsibilities, not team size.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning an AI product and unsure which layers you are missing?

A senior engineer replies within one business day. Or see our LLM Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call