Tooluck logoTooluck
SKILL.md

langchain-rag

Agent skill fromlangchain-ai/langchain-skills

INVOKE THIS SKILL when building ANY retrieval-augmented generation (RAG) system. Covers document loaders, RecursiveCharacterTextSplitter, embeddings (OpenAI), and vector stores (Chroma, FAISS, Pinecone).

How to install langchain-rag

install langchain-rag
# install the langchain-skills pack with the skills CLI
npx skills add langchain-ai/langchain-skills

# or add only this skill to Claude Code: copy the folder

config/skills/langchain-rag/

# into

~/.claude/skills/langchain-rag/ (all projects)

.claude/skills/langchain-rag/ (one project)

config/skills/langchain-rag/SKILL.md

MITFull file
1<overview>
2Retrieval Augmented Generation (RAG) enhances LLM responses by fetching relevant context from external knowledge sources.
3
4**Pipeline:**
51. **Index**: Load → Split → Embed → Store
62. **Retrieve**: Query → Embed → Search → Return docs
73. **Generate**: Docs + Query → LLM → Response
8
9**Key Components:**
10- **Document Loaders**: Ingest data from files, web, databases
11- **Text Splitters**: Break documents into chunks
12- **Embeddings**: Convert text to vectors
13- **Vector Stores**: Store and search embeddings
14</overview>
15
16<vectorstore-selection>
17
18| Vector Store | Use Case | Persistence |
19|--------------|----------|-------------|
20| **InMemory** | Testing | Memory only |
21| **FAISS** | Local, high performance | Disk |
22| **Chroma** | Development | Disk |
23| **Pinecone** | Production, managed | Cloud |
24
25</vectorstore-selection>
26
27---
28
29## Complete RAG Pipeline
30
31<ex-basic-rag-setup>
32<python>
33End-to-end RAG pipeline: load documents, split into chunks, embed, store, retrieve, and generate a response.
34
35```python
36from langchain_openai import ChatOpenAI, OpenAIEmbeddings
37from langchain_community.vectorstores import InMemoryVectorStore
38from langchain_text_splitters import RecursiveCharacterTextSplitter
39from langchain_core.documents import Document
40
41# 1. Load documents
42docs = [
43 Document(page_content="LangChain is a framework for LLM apps.", metadata={}),
44 Document(page_content="RAG = Retrieval Augmented Generation.", metadata={}),
45]
46
47# 2. Split documents
48…

Excerpt shown under the repository's MIT license.

More skills in langchain-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates