From r-package-skills
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
npx claudepluginhub arthurgailes/r-package-skills --plugin r-package-skillsThis skill uses the workspace's default tool permissions.
**ragnar implements RAG in R.** Create vector stores, embed documents, register retrieval tools with ellmer chat sessions. LLMs search your documents before answering.
Builds RAG systems for LLM apps with vector databases, embeddings, semantic search, and reranking. Use for document Q&A, grounded chatbots, and reducing hallucinations.
Use when code loads ellmer, btw, mcptools, ragnar, or vitals, building LLM-powered R applications, implementing RAG workflows, or choosing between R AI packages (meta-skill for ellmer/btw/mcptools/ragnar/vitals)
Build RAG systems for LLM apps using vector databases, embeddings, and retrieval strategies. Use for document Q&A, grounded chatbots, and semantic search.
Share bugs, ideas, or general feedback.
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")
Read references/API.md before writing code.
references/API.md - Complete function referencereferences/package-docs.md - Vector store setup and usagereferences/rag.md - RAG patterns and ellmer integrationlibrary(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"))
| 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 |
Store Management:
ragnar_store_create(): Create vector databaseragnar_store_connect(): Connect to existing storeragnar_store_insert(): Add documentsDocument Processing:
read_as_markdown(): Read documentsmarkdown_chunk(): Split into chunksIntegration:
ragnar_register_tool_retrieve(): Register with ellmerragnar_embed_ollama(): Local embeddingsSee references/ for:
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