🤖 AI Summary
This work addresses data staleness, tenant leakage, and combinatorial query explosion in production-grade retrieval-augmented generation (RAG) systems caused by decoupled data layers. To resolve these issues, the authors propose a unified data layer architecture built on PostgreSQL that, for the first time, integrates vector retrieval and structured filtering within a single database. By leveraging pgvector with HNSW indexing and a hybrid hierarchical design, the system eliminates cross-system synchronization overhead while guaranteeing strict tenant isolation and strong data consistency. Experimental results on a dataset of 50,000 documents demonstrate a 92% reduction in latency for date-filtered queries and a 74% reduction for tenant-scoped queries, alongside a 93% decrease in synchronization code, achieving zero data inconsistency and enabling efficient, secure RAG.
📝 Abstract
Retrieval-Augmented Generation (RAG) systems have become the standard architecture for grounding large language models in organizational knowledge. Yet production deployments consistently expose a gap between clean prototype performance and real-world reliability. This paper identifies three root causes of that gap: data staleness, tenant data leakage, and query composition explosion. All three trace back to the conventional split-system data layer. We propose and evaluate a unified data layer built on PostgreSQL with native vector search (pgvector) and HNSW indexing. Controlled benchmarks on 50,000 documents show 92% latency reduction for date-filtered queries, 74% for tenant-scoped queries, zero synchronization inconsistency, and complete elimination of cross-tenant data leakage with 93% less synchronization code. We additionally discuss a recommended hybrid tier architecture