Enterprise RAG Technology Stack: Open-Source vs Cloud

Choose each layer of the enterprise RAG stack, and compare open-source, cloud-managed and hybrid options.

Last Updated:

Module 22 · Lesson 4 of 7 · Advanced

Enterprise RAG Technology Stack: Open-Source vs Cloud

Choose each layer of the enterprise RAG stack, and compare open-source, cloud-managed and hybrid options.

An enterprise RAG system is assembled from many technologies: parsers, embedding models, vector stores, rerankers, LLMs, orchestration frameworks, observability tools and more. For every layer you can choose open-source software you run yourself, a managed cloud service, or a mix. This lesson walks through the stack layer by layer with typical options, then compares open-source, cloud and hybrid approaches so you can choose deliberately.

What you will learn

  • The layers of the enterprise RAG technology stack and common options for each
  • The trade-offs between open-source, cloud-managed and hybrid approaches
  • The questions to ask when choosing each component
  • How to keep the stack replaceable with thin interfaces

Prerequisites

The stack, layer by layer

The options below are examples, not endorsements; the landscape changes quickly, so verify current features, pricing and regional availability.

LayerOpen-source / self-hosted examplesManaged / cloud examples
Connectors and ingestionCustom Python connectors, Apache Airflow, framework loadersCloud data-integration services, managed RAG data sources
Document parsingPyMuPDF, Unstructured, Docling, Tesseract OCRCloud document AI services (AWS, Azure, Google)
EmbeddingsBGE, E5, GTE and other open models via sentence-transformersOpenAI, Google, Amazon, Cohere and other embedding APIs
Vector and keyword searchPostgreSQL + pgvector, Qdrant, Weaviate, Milvus, OpenSearchPinecone, Azure AI Search, managed OpenSearch/Elastic, cloud vector search
RerankingBGE rerankers, cross-encoders from Hugging FaceCohere Rerank and other reranking APIs
LLMOpen-weight models served with vLLM, Ollama or NIMAnthropic, OpenAI, Google APIs; Amazon Bedrock; Azure OpenAI
OrchestrationLangChain, LangGraph, LlamaIndex, Haystack, plain PythonManaged agent and RAG services
ServingFastAPI, Spring Boot, Docker, KubernetesServerless functions, managed containers
Observability and evaluationOpenTelemetry, Langfuse, Phoenix, RAGAS, DeepEvalLangSmith and hosted observability platforms
Identity and secretsKeycloak, HashiCorp VaultEntra ID, Okta, cloud IAM and secrets managers

Open-source vs cloud vs hybrid

FactorOpen-source, self-hostedCloud-managed
Data controlFull: data never leaves your environmentDepends on the provider's terms, region and configuration
Time to first versionSlower: you run and patch everythingFaster: provision and call an API
Operating effortHigh: upgrades, scaling, GPUs, backupsLow to medium
Cost profileFixed infrastructure and staff; cheap at high, steady volumePay per use; cheap to start, can grow with volume
Model qualityStrong open models, usually behind the best frontier modelsAccess to frontier models
CustomisationUnlimitedWithin service features
Lock-inLowHigher, especially with managed RAG services

Most enterprises end up hybrid: open-source parsing, embedding and vector search in their own cloud account (data stays close), a frontier LLM through an enterprise API or cloud platform (quality), and managed identity, secrets and monitoring.

Questions to ask for each component

  • Where is data processed and stored, and does that meet our residency and privacy rules?
  • What happens to our data: is it retained, logged or used for training?
  • Does it support our scale (documents, queries per second) and latency target?
  • How does it handle permissions and multi-tenancy?
  • What does it cost at today's volume and at ten times that?
  • How hard is it to replace? Is there an export path?
  • Who will operate it, and do we have those skills?

Keep the stack replaceable

Components will change: a better embedding model, a cheaper LLM, a different vector store. Hide each one behind a small interface that your business logic depends on:

interfaces.py
from typing import Protocol

class Embedder(Protocol):
    space_id: str
    def embed_documents(self, texts: list[str]) -> list[list[float]]: ...
    def embed_query(self, text: str) -> list[float]: ...

class SearchIndex(Protocol):
    def upsert(self, doc_id: str, chunks: list[dict]) -> None: ...
    def delete(self, doc_id: str) -> None: ...
    def search(self, query_vector: list[float], query_text: str, filters: dict, k: int) -> list[dict]: ...

class ChatModel(Protocol):
    def answer(self, system: str, prompt: str, max_tokens: int) -> str: ...

def build_stack(config: dict) -> tuple[Embedder, SearchIndex, ChatModel]:
    """Choose implementations from configuration; business code only sees the interfaces."""
    if config["embedding"] == "local-bge":
        from stack.local import BgeEmbedder as embedder_cls
    else:
        from stack.cloud import ApiEmbedder as embedder_cls
    if config["index"] == "pgvector":
        from stack.pg import PgVectorIndex as index_cls
    else:
        from stack.managed import ManagedIndex as index_cls
    from stack.llm import ProviderChatModel
    return embedder_cls(config), index_cls(config), ProviderChatModel(config)

The stack.* modules are where you put each vendor's code. Switching a component then means writing one adapter and running the evaluation suite, not editing the whole application. This mirrors the approach in Model-Agnostic RAG.

A sensible default stack

For teams starting out without strong constraints, a pragmatic default is: Python with FastAPI; PostgreSQL with pgvector and full-text search; an open embedding model or an embedding API; a cross-encoder reranker; a frontier LLM through an enterprise API; OpenTelemetry tracing plus an LLM observability tool; RAGAS or custom judges for evaluation; and your organisation's existing identity provider. It is cheap, well understood and easy to evolve.

Key takeaways

  • Choose a technology for each layer: ingestion, parsing, embeddings, search, reranking, LLM, orchestration, serving, observability, identity.
  • Open-source gives control and low lock-in; cloud gives speed and less operations; most enterprises go hybrid.
  • Evaluate components on data handling, scale, permissions, cost at scale, replaceability and skills.
  • Hide each component behind a small interface so it can be replaced.

Frequently asked questions

Should we use a managed RAG service?

It is a fast way to validate a use case. Check whether it supports your permissions model, sources and evaluation needs before committing a platform to it.

Do we need GPUs?

Only if you self-host LLMs, large embedding models or rerankers at volume. Small embedding models and rerankers run acceptably on CPUs for many workloads.

Practice exercises

  1. Fill in the stack table for your organisation, marking each choice as open-source, cloud or hybrid, and why.
  2. Write an adapter for two embedding providers behind the Embedder interface and compare them on your test set.

Related tutorials