langchain-rag

langchain-rag is a skill for Claude Code from Codeblockz/langchain-community-plugin. It costs 61 tokens per session (1,094 once invoked), scanned A, original, Apache-2.0.

A guide for building RAG systems with LangChain. RAG lets an AI search a document collection and use the relevant passages to answer a question.

In plain words
What is it for?
Use it to build document question-answering systems with document loaders, text splitters, embeddings, retrievers, and vector databases.
Why use it?
It explains how to load and split documents, create searchable representations, and select a suitable vector store instead of assembling the pipeline from scratch.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the langchain-community plugin — 3 skills, 5 commands, 2 agents, 1 MCP server shipped together

Good fit Use it to build document question-answering systems with document loaders, text splitters, embeddings, retrievers, and vector databases.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/codeblockz/langchain-community-plugin/langchain-rag
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Codeblockz/langchain-community-plugin --skill langchain-rag
Clone the repo
git clone --depth 1 https://github.com/Codeblockz/langchain-community-plugin

Made for: Claude Code.

Or install langchain-community, the plugin that ships this one along with the rest of its 3 skills, 5 commands, 2 agents, 1 MCP server.

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 langchain-rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/codeblockz/langchain-community-plugin/langchain-rag/github.svg)](https://agentmods.dev/skills/codeblockz/langchain-community-plugin/langchain-rag)
Your own site
<a href="https://agentmods.dev/skills/codeblockz/langchain-community-plugin/langchain-rag"><img src="https://agentmods.dev/badge/skills/codeblockz/langchain-community-plugin/langchain-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 langchain-rag

Your own site · 80×15
<a href="https://agentmods.dev/skills/codeblockz/langchain-community-plugin/langchain-rag"><img src="https://agentmods.dev/badge/skills/codeblockz/langchain-community-plugin/langchain-rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,094 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.00061 $0.01094
Opus 5.5 $0.00024 $0.00438
Sonnet 5.5 $0.00012 $0.00219
Haiku 4.5 $0.00006 $0.00109

Measured 1mo ago against content hash 0faa5bd32b0e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

langchain-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 1mo 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.

skills/langchain-rag/SKILL.md · 132 lines

How it starts

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

LangChain RAG Builder

Quick Decision: Which Vector Store?

Use Case Vector Store Notes
Quick prototyping InMemoryVectorStore No setup, data lost on restart
Local development FAISS or Chroma File-based persistence
Production (managed) Pinecone or Qdrant Fully managed, scalable
Production (self-hosted) pgvector or Weaviate Use existing Postgres or K8s

RAG Pipeline Quick Start

from langchain_community.document_loaders import WebBaseLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain_core.vectorstores import InMemoryVectorStore
from langchain_openai import OpenAIEmbeddings, ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_core.runnables import RunnablePassthrough

# 1. Load documents
loader = WebBaseLoader("https://example.com/docs")
docs = loader.load()

# 2. Split into chunks
splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000,      # Characters per chunk
    chunk_overlap=200,    # Overlap between chunks
    add_start_index=True, # Track position in original doc
)
chunks = splitter.split_documents(docs)

# 3. Create vector store with embeddings
embeddings = OpenAIEmbeddings()
vectorstore = InMemoryVectorStore.from_documents(chunks, embeddings)

# 4. Create retriever
retriever = vectorstore.as_retriever(search_kwargs={"k": 4})

# 5. Build RAG chain
prompt = ChatPromptTemplate.from_template("""
Answer based only on the context. If unsure, say "I don't know."

Context: {context}
Question: {question}
""")

def format_docs(docs):
    return "\n\n".join(doc.page_content for doc in docs)

llm = ChatOpenAI(model="gpt-4o")

rag_chain = (
    {"context": retriever | format_docs, "question": RunnablePassthrough()}
    | prompt
    | llm
    | StrOutputParser()
)

# 6. Query
answer = rag_chain.invoke("What is this document about?")

Read the full file on GitHub · 132 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 132 lines · 61 tokens per session scan A 0faa5bd32b0e

Subscribe to this mod's changes

langchain-rag is a skill published in the GitHub repository Codeblockz/langchain-community-plugin (3 stars, last pushed 9mo ago), licensed Apache-2.0. It adds 61 tokens to every session and 1,094 once invoked, about $0.0002 per session on Opus 5.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

rag-retrieval

Retrieval-Augmented Generation patterns for grounded LLM responses. Use when building RAG pipelines, embedding documents, implementing hybrid search, contextual retrieval, HyDE, agentic RAG, multimodal RAG, query decomposition, reranking, or pgvector search.

yonatangross/orchestkit · 58 tokens

langchain

Use when building LLM applications with LangChain — LCEL chains (prompt | model | parser), tool-calling agents via createagent, @tool definitions, RAG pipelines (loaders, splitters, vector stores, retrievers), short-term memory with LangGraph checkpointers, and GIS workflows such as natural-language PostGIS queries or…

znlgis/opengis-skills · 93 tokens

rag-vs-finetune-decision

The model-capability decision tree — prompt-engineering first, then RAG for missing knowledge, then fine-tuning for missing behavior/format or cost/latency, climbing only as far as needed. Covers the cost/latency/maintenance tradeoffs of each rung and when each is the wrong choice (especially the premature-fine-tune…

VandanaAjayDubey111/great-pm · 109 tokens

ai-use-case-scoping

The should-this-even-be-AI gate — decide where an LLM belongs versus deterministic rules, frame error tolerance as a product decision, and climb the capability ladder (rules → prompt → RAG → fine-tune) only as far as the problem demands. Stops the "AI everywhere" anti-pattern before it reaches the spec. Hosted by…

VandanaAjayDubey111/great-pm · 85 tokens

ai-ml

AI and machine learning workflow covering LLM application development, RAG implementation, agent architecture, ML pipelines, and AI-powered features.

ranbot-ai/awesome-skills · 30 tokens

ai-native-development

Build AI-first applications with RAG pipelines, embeddings, vector databases, agentic workflows, and LLM integration. Master prompt engineering, function calling, streaming responses, and cost optimization for 2025+ AI development.

ArieGoldkin/ai-agent-hub · 48 tokens