Designing Retrieval-Augmented Generation(RAG) Pipelines in Microservice Architectures

Retrieval-Augmented Generation (RAG) is increasingly adopted to ground large language model (LLM) responses in enterprise knowledge; however, production RAG backends often fail to meet stringent latency, reliability, and cost constraints under multi-tenant workloads. This paper presents a scalable, cost-efficient RAG reference architecture for enterprise backend systems, combining tiered retrieval, adaptive caching, and policy-driven guardrails. The approach decomposes RAG into microservices for ingestion, indexing, query orchestration, and evaluation, enabling independent scaling and fault isolation. To reduce spend and tail latency, we introduce (i) semantic and document-level caches with TTL and invalidation policies, (ii) dynamic routing across model tiers and retrieval depths based on SLO budgets, and (iii) hybrid search with metadata filters to constrain candidate sets prior to re-ranking. The design integrates observability using distributed tracing and cost telemetry to attribute token usage and retrieval overhead per request and tenant. We further outline governance controls for prompt injection resilience, data access enforcement, and auditability. Experimental evaluation on representative enterprise workloads demonstrates improved p95 latency and reduced token consumption while preserving answer faithfulness, indicating that SLO-driven orchestration is essential for reliable, economical RAG in production backends.

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2025-10-12
DOI
https://doi.org/10.5281/zenodo.17948224
Primary Topic
Software System Performance and Reliability
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Designing Retrieval-Augmented Generation(RAG) Pipelines in Microservice Architectures

Zenodo (CERN European Organization for Nuclear Research)
Software System Performance and Reliability
article

Designing Retrieval-Augmented Generation(RAG) Pipelines in Microservice Architectures

article en

Abstract

Retrieval-Augmented Generation (RAG) is increasingly adopted to ground large language model (LLM) responses in enterprise knowledge; however, production RAG backends often fail to meet stringent latency, reliability, and cost constraints under multi-tenant workloads. This paper presents a scalable, cost-efficient RAG reference architecture for enterprise backend systems, combining tiered retrieval, adaptive caching, and policy-driven guardrails. The approach decomposes RAG into microservices for ingestion, indexing, query orchestration, and evaluation, enabling independent scaling and fault isolation. To reduce spend and tail latency, we introduce (i) semantic and document-level caches with TTL and invalidation policies, (ii) dynamic routing across model tiers and retrieval depths based on SLO budgets, and (iii) hybrid search with metadata filters to constrain candidate sets prior to re-ranking. The design integrates observability using distributed tracing and cost telemetry to attribute token usage and retrieval overhead per request and tenant. We further outline governance controls for prompt injection resilience, data access enforcement, and auditability. Experimental evaluation on representative enterprise workloads demonstrates improved p95 latency and reduced token consumption while preserving answer faithfulness, indicating that SLO-driven orchestration is essential for reliable, economical RAG in production backends.

Zenodo (CERN European Organization for Nuclear Research)
Industry, innovation and infrastructure
Openalex Percentile: Top 36%
Software System Performance and Reliability
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.