ragR: Retrieval-Augmented Generation and RAG Assessment in R

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Rehman, Muhammad Aimal, Lu, Zhili, Yeh, Chi-Kuang
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908993698398208
author Rehman, Muhammad Aimal
Lu, Zhili
Yeh, Chi-Kuang
author_facet Rehman, Muhammad Aimal
Lu, Zhili
Yeh, Chi-Kuang
contents 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 reference Python RAGAS workflow across multiple use cases. By integrating RAG construction and evaluation within a reproducible workflow in R, ragR provides a practical framework for research, teaching, and moderate-scale experimentation on RAG systems entirely within the R ecosystem.
format Preprint
id arxiv_https___arxiv_org_abs_2604_23515
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle ragR: Retrieval-Augmented Generation and RAG Assessment in R
Rehman, Muhammad Aimal
Lu, Zhili
Yeh, Chi-Kuang
Computation
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 reference Python RAGAS workflow across multiple use cases. By integrating RAG construction and evaluation within a reproducible workflow in R, ragR provides a practical framework for research, teaching, and moderate-scale experimentation on RAG systems entirely within the R ecosystem.
title ragR: Retrieval-Augmented Generation and RAG Assessment in R
topic Computation
url https://arxiv.org/abs/2604.23515