rag

rag is a skill for Claude Code from bethanychamberlain/claude-skills-librechat. It costs 63 tokens per session (2,035 once invoked), scanned A, original, MIT.

A guide for setting up LibreChat's document question-and-answer system, often called retrieval-augmented generation (RAG), which finds relevant passages in uploaded files before generating a response.

In plain words
What is it for?
Use it to configure embeddings providers, agent file search, PostgreSQL with PGVector for vector storage, document indexing, and document retrieval.
Why use it?
It connects document ingestion, text representations, search storage, and retrieval so users can chat with their files. It also helps diagnose indexing and search problems.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the librechat-data plugin — 2 skills shipped together

Good fit Use it to configure embeddings providers, agent file search, PostgreSQL with PGVector for vector storage, document indexing, and document retrieval.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add bethanychamberlain/claude-skills-librechat
Claude Code
/plugin install librechat-data

Made for: Claude Code.

Or install librechat-data, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/bethanychamberlain/claude-skills-librechat/rag/github.svg)](https://agentmods.dev/skills/bethanychamberlain/claude-skills-librechat/rag)
Your own site
<a href="https://agentmods.dev/skills/bethanychamberlain/claude-skills-librechat/rag"><img src="https://agentmods.dev/badge/skills/bethanychamberlain/claude-skills-librechat/rag/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rag

Your own site · 80×15
<a href="https://agentmods.dev/skills/bethanychamberlain/claude-skills-librechat/rag"><img src="https://agentmods.dev/badge/skills/bethanychamberlain/claude-skills-librechat/rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,035 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.02035
Opus 5 $0.00032 $0.01018
Sonnet 5 $0.00013 $0.00407
Haiku 4.5 $0.00006 $0.00203

Measured 10d ago against content hash 9e3ceaf18989, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

rag scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

librechat-data/skills/rag/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LibreChat RAG

You are an expert in LibreChat's RAG pipeline. Your goal is to help configure document ingestion, embedding, storage, and retrieval so users can effectively chat with their documents.

Before Starting

Check for context first: If librechat-context.md exists in the current working directory, read it before asking questions. Use that context and only ask for information not already covered or specific to this task.

If librechat-context.md does not exist, ask the user:

  1. What LibreChat version are you running?
  2. How is it deployed? (Docker local / Docker remote / cloud / Kubernetes)
  3. What model providers are configured?

Then offer: "Would you like me to save this as librechat-context.md so you don't have to answer these again?" If they say yes, also remind them to add librechat-context.md to .gitignore.

How This Skill Works

Mode 1: Set Up RAG from Scratch

When no RAG pipeline exists yet.

  1. Ask which embeddings provider they want — load ${CLAUDE_PLUGIN_ROOT}/references/rag-embeddings.md for provider comparison
  2. Load ${CLAUDE_PLUGIN_ROOT}/references/rag-docker.md for Docker Compose setup
  3. Walk through step by step: a. Add RAG API + PGVector services to Docker Compose b. Configure .env variables for chosen embeddings provider c. Set RAG_API_URL in .env d. Restart LibreChat
  4. Verify: test file upload in a conversation
  5. Enable file search on agents — load ${CLAUDE_PLUGIN_ROOT}/references/rag-agent-config.md

Mode 2: Switch Embeddings Provider

When RAG works but the user wants to change providers (e.g., OpenAI → Ollama).

  1. Load ${CLAUDE_PLUGIN_ROOT}/references/rag-embeddings.md for provider comparison
  2. Identify current provider from .env
  3. Update .env variables for new provider
  4. If switching to/from local embeddings: swap Docker image (lite ↔ full)
  5. Critical warning: switching providers invalidates existing vectors — all files must be re-indexed
  6. Restart RAG API and test

Mode 3: Debug RAG Issues

When file search or document indexing is not working.

  1. Check RAG API is running: docker compose ps — look for rag_api container
  2. Check RAG API logs: docker compose logs rag_api --tail 30
  3. Verify .env: RAG_API_URL set? Embeddings API key valid?
  4. Check connectivity: can LibreChat reach RAG API?
  5. Load ${CLAUDE_PLUGIN_ROOT}/references/rag-architecture.md for pipeline understanding
  6. Common issues:
    • 401 on embeddings → wrong API key or provider mismatch
    • File upload fails → RAG_API_URL not configured or unreachable
    • Poor retrieval quality → chunk size/overlap tuning, or try different embeddings model
    • Missing file types → check fileConfig supportedMimeTypes

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 154 lines · 63 tokens per session scan A 9e3ceaf18989

Subscribe to this mod's changes

rag is a skill published in the GitHub repository bethanychamberlain/claude-skills-librechat (3 stars, last pushed 5mo ago), licensed MIT. It adds 63 tokens to every session and 2,035 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories