The Enterprise AI Stack: Reference Architecture

The layers of an enterprise AI platform — infrastructure, models, AI gateway, data and knowledge, orchestration and agents, applications, LLMOps, security and governance — with a reference architecture, request flow and platform-team operating model.

On this page

Simple definition#

The enterprise AI stack is the set of shared layers an organisation builds so that many teams can ship AI features safely and cheaply: access to models, a gateway to control that access, pipelines that turn company data into retrievable knowledge, frameworks for chains and agents, and the operations, security and governance around all of it.

The problem it solves#

Without a platform, every team picks its own model, stores its own API keys, builds its own vector store, logs prompts (with customer data) in different places, and nobody knows the total cost or which apps send personal data to which vendor. That is “shadow AI”: fast at first, ungovernable at scale.

The layered architecture#

This is the destination. To see how a team grows into it one component at a time — context, guardrails, router and gateway, caches, write actions — see AI engineering architecture.

Enterprise AI reference stack
flowchart TB
    subgraph L7["7 · Experiences"]
        A1["Copilots & chat"]
        A2["AI features in business apps"]
        A3["Autonomous agents & batch AI"]
    end
    subgraph L6["6 · Orchestration & agents"]
        O1["Chains & workflows"]
        O2["Agent runtime<br/>planning, memory, HITL"]
        O3["Tool & MCP registry"]
    end
    subgraph L5["5 · Knowledge & data"]
        K1["Ingestion & ETL<br/>parse, chunk, embed"]
        K2["Vector / hybrid search"]
        K3["Knowledge graph"]
        K4["Operational data via APIs"]
    end
    subgraph L4["4 · AI gateway"]
        G1["Auth, quotas, routing, fallback,<br/>caching, guardrails, cost, logging"]
    end
    subgraph L3["3 · Models"]
        M1["Proprietary APIs"]
        M2["Cloud-managed models"]
        M3["Self-hosted open-weight<br/>+ fine-tuned"]
        M4["Embeddings & rerankers"]
    end
    subgraph L2["2 · Infrastructure"]
        I1["GPUs / accelerators, Kubernetes,<br/>networking, storage"]
    end
    X1["LLMOps & observability<br/>tracing, evaluation, cost"]
    X2["Security & governance<br/>identity, data protection, policy, audit"]
    L7 --> L6 --> L5
    L6 --> L4
    L5 --> L4
    L4 --> L3 --> L2
    X1 -.- L7
    X1 -.- L4
    X2 -.- L7
    X2 -.- L4
Layer Responsibility Typical technologies
1–2 Infrastructure Compute, GPUs, networking, storage Kubernetes, GPU node pools, vLLM/TGI, object storage
3 Models Generation, embeddings, reranking, speech/vision Provider APIs, AWS Bedrock, Azure AI Foundry, Google Vertex AI, open-weight models
4 AI gateway Single controlled entry point to all models LiteLLM, Kong AI Gateway, Azure APIM, Envoy AI Gateway, Portkey, Cloudflare AI Gateway
5 Knowledge Turn enterprise data into context ETL, Apache Tika/parsers, pgvector, OpenSearch, Elasticsearch, Pinecone, Neo4j
6 Orchestration Chains, RAG flows, agents, tool access Spring AI, LangChain/LangGraph, LlamaIndex, Semantic Kernel, MCP servers
7 Experiences What users touch Web/mobile apps, chat in Teams/Slack, IDE plugins, back-office automations
Cross-cutting: LLMOps Traces, evals, prompt versions, cost OpenTelemetry, Langfuse, LangSmith, Arize Phoenix, MLflow
Cross-cutting: Governance Policy, risk, audit, compliance AI inventory, model cards, DLP, IAM, policy engines

AI gateway#

The AI gateway (LLM gateway) is the most important platform component for control. Every model call in the company goes through it.

What the AI gateway does on every request
flowchart LR
    APP["App / agent<br/>OpenAI-compatible or provider API"] --> AUTH["1 · Authenticate app & user<br/>virtual API keys"]
    AUTH --> QUOTA["2 · Quotas & rate limits<br/>per team, per user"]
    QUOTA --> IN["3 · Input guardrails<br/>PII masking, injection checks, policy"]
    IN --> CACHE{"4 · Cache hit?<br/>exact or semantic"}
    CACHE -->|"hit"| RESP["Response"]
    CACHE -->|"miss"| ROUTE["5 · Route & fallback<br/>model choice, provider failover"]
    ROUTE --> LLM(("Model provider"))
    LLM --> OUTG["6 · Output guardrails<br/>toxicity, PII, schema"]
    OUTG --> LOG["7 · Log, trace, meter cost<br/>chargeback per team"]
    LOG --> RESP

Benefits: one place for provider keys and contracts, central cost visibility and chargeback, consistent safety policies, provider failover, and a single audit trail.

A request flowing through the stack#

Employee asks the HR copilot a question
sequenceDiagram
    actor U as Employee
    participant App as HR Copilot (Spring Boot)
    participant IdP as Identity provider
    participant Ret as Retrieval service
    participant VDB as Vector store
    participant GW as AI gateway
    participant LLM as LLM provider
    participant Obs as Tracing & evals
    U->>App: "How many days of parental leave do I get in Germany?"
    App->>IdP: validate token, get groups, country
    App->>Ret: search(query, filters: country=DE, groups)
    Ret->>GW: embed(query)
    GW->>LLM: embedding model
    Ret->>VDB: hybrid search + ACL filter
    VDB-->>Ret: top 20 chunks
    Ret->>GW: rerank → top 5
    Ret-->>App: 5 chunks with sources
    App->>GW: chat(system prompt + chunks + question)
    GW->>GW: guardrails, routing, cost metering
    GW->>LLM: generate
    LLM-->>GW: answer with citations
    GW-->>App: answer
    App-->>U: answer + source links
    App-)Obs: trace: retrieval, prompt version, tokens, latency

Build vs buy at each layer#

Layer Usually buy / use managed Usually build
Models Yes (APIs, cloud-managed) Fine-tuned adapters for narrow tasks
Gateway Product or open source, configured centrally Custom policies, chargeback integration
Vector store Managed DB or extension (pgvector, OpenSearch) —
Ingestion pipelines Connectors where available Parsing, chunking and metadata for your documents
Orchestration Framework (Spring AI, LangGraph) Business workflows, tools, prompts
Evaluation Tooling Golden datasets and domain metrics — only you can build these

Operating model: the AI platform team#

Hub-and-spoke AI operating model
flowchart TB
    subgraph Hub["AI platform team + AI governance board"]
        H1["Gateway, model catalogue, vector platform"]
        H2["Reusable components: RAG starter, guardrails,<br/>eval harness, MCP servers"]
        H3["Standards, risk review, AI inventory"]
    end
    Hub --> S1["Product team: customer service"]
    Hub --> S2["Product team: underwriting"]
    Hub --> S3["Product team: engineering productivity"]
    S1 -.->|"feedback, reusable tools"| Hub
    S2 -.-> Hub
    S3 -.-> Hub

The platform team provides paved roads; product teams own use cases, prompts, evaluation sets and outcomes. A governance board (risk, legal, security, data protection) approves use cases by risk tier. See AI governance.

Use-case prioritisation#

A strategic AI architect also decides what to build. Score candidate use cases on:

  • Value — revenue, cost saving, risk reduction, customer experience.
  • Feasibility — data availability and quality, task suits current models, integration effort.
  • Risk — regulatory tier, harm if wrong, need for human oversight.

Start with high-value, high-feasibility, lower-risk internal use cases (knowledge assistants, document processing, developer productivity), build the platform through them, then move to customer-facing and agentic use cases.

Common mistakes#

Review questions#

Describe an enterprise AI reference architecture. Infrastructure and models at the bottom (provider APIs, cloud-managed and self-hosted models, embeddings and rerankers); an AI gateway as the single controlled entry point; a knowledge layer for ingestion, vector and hybrid search and knowledge graphs; an orchestration layer for chains, RAG and agents with a tool/MCP registry; applications on top; and cross-cutting LLMOps (tracing, evaluation, cost) and governance (identity, data protection, policy, audit).

What does an AI gateway do and why do you need one? Authenticates apps, enforces quotas, applies input and output guardrails, caches, routes to models with fallback, and logs and meters every call for cost and audit. It centralises control, security and cost visibility and avoids lock-in.

How do you organise teams for enterprise AI? A central platform team builds paved roads (gateway, RAG components, eval tooling, guardrails), a governance board sets policy and reviews risk, and product teams own use cases, prompts, evaluation data and outcomes.

How do you decide which AI use cases to do first? Score on value, feasibility (data, model fit, integration) and risk. Start with internal, high-value, lower-risk use cases to build the platform and capability, then expand.

Summary#

  • The stack: infrastructure → models → AI gateway → knowledge → orchestration/agents → experiences, with LLMOps and governance across all layers.
  • The AI gateway is the control point for cost, security, routing and audit.
  • Buy commodity layers; build ingestion, business logic and evaluation data.
  • A platform team with governance and product teams on top scales AI safely.

References#