Skip to main content

r-ragnar

Use when code loads or uses ragnar (library(ragnar), ragnar::), implementing RAG in R, creating vector stores, embedding documents for semantic search, or building retrieval pipelines

Ir a la instalación

Datos de origen

Repositorio
arthurgailes/r-package-skills
Última actividad en el origen
24 de abril de 2026 a las 15:12
Idioma detectado de SKILL.md
inglés
Estrellas
21
Forks
1

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Explorador de archivos
4 archivos

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
r-ragnar
description
Use when code loads or uses ragnar (library(ragnar), ragnar::), implementing RAG in R, creating vector stores, embedding documents for semantic search, or building retrieval pipelines
# ragnar: Retrieval Augmented Generation in R ## Overview **ragnar implements RAG in R.** Create vector stores, embed documents, register retrieval tools with ellmer chat sessions. LLMs search your documents before answering. **Install:** `install.packages("ragnar")` ## References Read `references/API.md` before writing code. - `references/API.md` - Complete function reference - `references/package-docs.md` - Vector store setup and usage - `references/rag.md` - RAG patterns and ellmer integration ## When to Use - LLM needs to search your documentation - Implement semantic search over documents - Create vector database from documents - RAG workflows in R ## When NOT to Use - Just need keyword search (use grep/Grep tool) - Documents fit in single prompt (<100k tokens) - Building chatbot without document search (use r-ellmer only) ## Quick Reference ```r library(ragnar) # Create store docs <- read_as_markdown("docs/") chunks <- markdown_chunk(docs) store <- ragnar_store_create("docs.duckdb") ragnar_store_insert(store, chunks) # Register with ellmer library(ellmer) chat <- chat_openai() ragnar_register_tool_retrieve(chat, store) # Now chat searches docs before answering chat$chat("What does the documentation say about...?") # Local embeddings (Ollama) store <- ragnar_store_create("local.duckdb", embed = ragnar_embed_ollama(model = "nomic-embed-text")) ``` ## Common Mistakes | Issue | Solution | |-------|----------| | Embedding mismatch | Store and retrieval must use same provider | | Store not registered | Call `ragnar_register_tool_retrieve(chat, store)` | | Ollama embeddings not working | Start `ollama serve` first | | Poor retrieval quality | Check chunking strategy, embedding model | ## Core Functions **Store Management:** - `ragnar_store_create()`: Create vector database - `ragnar_store_connect()`: Connect to existing store - `ragnar_store_insert()`: Add documents **Document Processing:** - `read_as_markdown()`: Read documents - `markdown_chunk()`: Split into chunks **Integration:** - `ragnar_register_tool_retrieve()`: Register with ellmer - `ragnar_embed_ollama()`: Local embeddings ## Advanced See `references/` for: - **API.md**: Complete function reference - **rag.md**: RAG workflow details - **Package docs**: Full package documentation ## Integration **With ellmer:** `ragnar_register_tool_retrieve(chat, store)` **With vitals (evaluation):** See r-vitals skill for RAG testing **Cross-package patterns:** See r-ai meta-skill
Ver en GitHub