ragR: Retrieval-Augmented Generation and RAG Assessment in R
Muhammad Aimal Rehman, Zhili Lu, and Chi-Kuang Yeh

TL;DR
ragR is an R package that integrates document retrieval, generation, and evaluation for RAG systems, enabling comprehensive R-based workflows for research and teaching.
Contribution
It introduces a unified R-native framework for building and evaluating RAG systems, filling a gap left by Python-centric tools.
Findings
ragR captures similar metric behavior to Python RAGAS across multiple use cases.
Validation experiments confirm ragR's effectiveness in RAG system evaluation.
Provides a practical, reproducible workflow for RAG research within R.
Abstract
Retrieval-augmented generation (RAG) combines document retrieval with large language models to produce responses grounded in external evidence. While several R packages support core components of RAG workflows, integrated evaluation of RAG systems in R remains limited and is often conducted through Python-based tools, most notably the RAG assessment (RAGAS) framework. To address this gap, we introduce ragR, an R package that unifies document ingestion, embedding and vector storage, similarity-based retrieval, grounded generation, structured question-answer logging, and RAGAS-style evaluation within a single R-native workflow. The current implementation provides LLM-based scoring for four core RAGAS metrics: context precision, context recall, faithfulness, and answer relevance. Validation experiments under controlled settings show that ragR captures similar metric behavior to the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
