We present a lightweight RAG architecture built entirely on PostgreSQL with pgvector and serverless edge functions. Our system implements and evaluates four retrieval strategies: hybrid search with Reciprocal Rank Fusion (RRF), Hypothetical Document Embeddings (HyDE), multi-query expansion, and graph-based retrieval over an automatically constructed knowledge graph. Evaluation on a 427-document Spanish-language corpus with 22 ground-truth pairs shows HyDE achieves the best performance (P@5: 0.595, MRR: 0.838, Hit Rate: 1.0), while graph-based retrieval excels on relational queries. We demonstrate that production-grade RAG systems can operate effectively on commodity serverless infrastructure.
Karl J. Mollan Neyra (Fri,) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: