Package: ragR 0.1.0

Muhammad Aimal Rehman

ragR: Retrieval-Augmented Generation and RAG Evaluation Tools

Provides tools for document ingestion, embedding storage, retrieval-augmented generation (RAG), and evaluation of question-answering systems. The package includes an R-native vector store, wrappers for OpenAI embedding and chat-completion application programming interfaces (APIs), question-answering logging utilities, and large language model (LLM)-based evaluation metrics for context precision, context recall, answer relevance, and faithfulness. These metrics are based on the Retrieval-Augmented Generation Assessment (RAGAS) framework. The retrieval-augmented generation methodology is described by Lewis et al. (2020) "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks" <doi:10.48550/arXiv.2005.11401>. The evaluation metrics are based on Es et al. (2024) "RAGAS: Automated Evaluation of Retrieval Augmented Generation" <doi:10.18653/v1/2024.eacl-demo.16>.

Authors:Muhammad Aimal Rehman [aut, cre], Zhili Lu [aut], Chi-Kuang Yeh [aut]

ragR_0.1.0.tar.gz
ragR_0.1.0.tar.gz(r-4.7-any)ragR_0.1.0.tar.gz(r-4.6-any)
ragR_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION
card.svg |card.png
ragR/json (API)

# Install 'ragR' in R:
install.packages('ragR', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/aimalrehman92/ragr/issues

On CRAN:

Conda:

1.70 score 32 exports 51 dependencies

Last updated from:f01a408bd5. Checks:4 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK129
source / vignettesOK197
linux-release-x86_64OK131
wasm-releaseOK149

Exports:api_chat_handlerapi_clear_all_handlerapi_clear_handlerapi_ragas_clear_handlerapi_ragas_handlerapi_ragas_report_handlerchunk_text_sentenceclear_qa_logclear_qa_metricscompute_ragas_metricscompute_ragas_metrics_llmgenerate_openai_chatgenerate_ragas_reportgenerate_ragas_report_llmget_openai_embeddingsingest_documentsload_qa_logload_qa_metricsload_rag_configlog_rag_interactionplot_ragas_meansqa_log_emptyqa_metrics_emptyquery_ragsave_qa_logsave_qa_metricssummarize_ragasvectorstore_clear_allvectorstore_delete_collectionvectorstore_loadvectorstore_queryvectorstore_upsert

Dependencies:antiwordaskpassbitopscellrangerclicpp11crayoncurldata.tabledigestdplyrgenericsgluehmshttrhttr2jsonlitelifecyclemagrittrmimemintyndjsonopensslpdftoolspillarpkgconfigprettyunitsprogressqpdfR6RcppRCurlreadODSreadtextreadxlrematchrjsonrlangstreamRstringistringrstriprtfsystibbletidyselecttzdbutf8vctrswithrxml2zip

Readme and manuals

Help Manual

Help pageTopics
ragR: Retrieval-Augmented Generation and Evaluation ToolsragR-package ragR
API handler: chat with the RAG pipelineapi_chat_handler
API handler: clear the entire vector storeapi_clear_all_handler
API handler: clear a vector-store collectionapi_clear_handler
API handler: clear RAG evaluation filesapi_ragas_clear_handler
API handler: compute RAG evaluation metricsapi_ragas_handler
API handler: generate a RAG evaluation performance reportapi_ragas_report_handler
Chunk text into sentences (strict)chunk_text_sentence
Clear the QA log on diskclear_qa_log
Clear QA metrics on diskclear_qa_metrics
Compute RAGAS metricscompute_ragas_metrics
Compute RAGAS-style metrics (LLM scored)compute_ragas_metrics_llm
Generate a chat completion from OpenAIgenerate_openai_chat
Generate a RAG evaluation performance reportgenerate_ragas_report
Generate a RAG evaluation report using large language model scoringgenerate_ragas_report_llm
Get embeddings from OpenAIget_openai_embeddings
Ingest documents into the vector storeingest_documents
Load a QA log from diskload_qa_log
Load QA metrics from diskload_qa_metrics
Load RAG configurationload_rag_config
Append one RAG interaction to the QA loglog_rag_interaction
Plot mean RAG evaluation metrics to a PNGplot_ragas_means
Create an empty QA log tibbleqa_log_empty
Create an empty QA metrics tibbleqa_metrics_empty
Query the RAG pipelinequery_rag
Save a QA log to disksave_qa_log
Save QA metrics to disksave_qa_metrics
Summarize RAGAS metrics across QA pairssummarize_ragas
Delete all collections from the R-native vector storevectorstore_clear_all
Delete a collection from the R-native vector storevectorstore_delete_collection
Load the R-native vector storevectorstore_load
Query the R-native vector store for nearest neighborsvectorstore_query
Upsert embeddings into the R-native vector storevectorstore_upsert