ragnar
An R package for building retrieval-augmented generation pipelines, with sensible defaults for chunking, embedding, and storage while keeping every step inspectable.
ragnar is an R package for implementing retrieval-augmented generation workflows. Rather than fully automating the process as a black box, it is designed so a knowledgeable user can inspect intermediate outputs and adjust each step precisely.
Documents in a wide range of formats are converted to Markdown using MarkItDown, then divided into chunks by a full-featured chunker that looks for semantic boundaries and automatically associates each chunk with the headings in scope for it, so retrieved text keeps its surrounding context. Embeddings can be computed through Ollama, OpenAI, Amazon Bedrock, Databricks, or Google Vertex AI, and are normally generated automatically when a store is created or when text is inserted or retrieved. Processed chunks and their embeddings are stored in DuckDB for efficient search, with the storage layer open to other backends. ragnar installs from CRAN or from the development version on GitHub.