RAG-Stack: Co-Optimizing RAG Quality and Performance From the Vector Database Perspective

πŸ“… 2025-10-23
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
To address the challenge of coupled algorithmic (model/database) and systems-level (software/hardware) design in retrieval-augmented generation (RAG), which hinders joint optimization of quality and performance, this paper proposes RAG-Stack. Our framework introduces three novel pillars: (1) RAG-IRβ€”a middleware abstraction layer based on intermediate representations that decouples algorithmic logic from system implementation; (2) RAG-CMβ€”a fine-grained, end-to-end cost model unifying vector retrieval and LLM inference; and (3) RAG-PEβ€”an efficient configuration exploration algorithm leveraging query plan search. RAG-Stack is the first framework to enable cross-layer co-optimization across the entire RAG pipeline. It achieves significant improvements in throughput and latency while preserving generation quality, and supports scalable, configurable production deployment.

Technology Category

Application Category

πŸ“ Abstract
Retrieval-augmented generation (RAG) has emerged as one of the most prominent applications of vector databases. By integrating documents retrieved from a database into the prompt of a large language model (LLM), RAG enables more reliable and informative content generation. While there has been extensive research on vector databases, many open research problems remain once they are considered in the wider context of end-to-end RAG pipelines. One practical yet challenging problem is how to jointly optimize both system performance and generation quality in RAG, which is significantly more complex than it appears due to the numerous knobs on both the algorithmic side (spanning models and databases) and the systems side (from software to hardware). In this paper, we present RAG-Stack, a three-pillar blueprint for quality-performance co-optimization in RAG systems. RAG-Stack comprises: (1) RAG-IR, an intermediate representation that serves as an abstraction layer to decouple quality and performance aspects; (2) RAG-CM, a cost model for estimating system performance given an RAG-IR; and (3) RAG-PE, a plan exploration algorithm that searches for high-quality, high-performance RAG configurations. We believe this three-pillar blueprint will become the de facto paradigm for RAG quality-performance co-optimization in the years to come.
Problem

Research questions and friction points this paper is trying to address.

Jointly optimizing RAG system performance and generation quality
Addressing complexity from algorithmic and systems configuration knobs
Developing a blueprint for quality-performance co-optimization in RAG systems
Innovation

Methods, ideas, or system contributions that make the work stand out.

Intermediate representation decouples quality and performance
Cost model estimates system performance for configurations
Plan exploration algorithm searches optimal RAG configurations
πŸ”Ž Similar Papers
No similar papers found.