langchain-rag

Build retrieval-augmented generation pipelines with LangChain document loaders, text splitters, embeddings, and vector stores.

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/agnivon/viral_thread_generator --skill langchain-rag-agnivon
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: langchain-rag
Source: https://github.com/agnivon/viral_thread_generator/tree/main/.agents/skills/langchain-rag
Command: npx skills add https://github.com/agnivon/viral_thread_generator --skill langchain-rag-agnivon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building a RAG system requires correctly wiring together document loading, chunking, embedding, vector storage, and retrieval, and small mistakes like mismatched embedding models or bad chunk sizes silently degrade answer quality. ## Core Features & Use Cases - Complete RAG Pipeline: Load documents, split them with RecursiveCharacterTextSplitter, embed with OpenAI, store in a vector database, and retrieve context for LLM generation in Python or TypeScript. - Vector Store Guidance: Compare InMemory, FAISS, Chroma, and Pinecone with persistence and production trade-offs, plus similarity, MMR, and metadata-filtered search. - Common Pitfall Fixes: Correct patterns for chunk size and overlap, persistent storage, consistent embedding models, FAISS deserialization, and dimension mismatches. - Use Case: Build a documentation Q&A agent that loads PDF and web pages, indexes them in Chroma, and answers user questions through a LangChain agent with a retrieval tool. ## Quick Start Use the langchain-rag skill to build a RAG pipeline that loads my PDF documents, stores embeddings in Chroma, and answers questions about them.

Frequently Asked Questions about langchain-rag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a RAG pipeline with LangChain?▼

Load documents with a document loader, split them with RecursiveCharacterTextSplitter, embed them with OpenAIEmbeddings, and store them in a vector store like Chroma or FAISS. Then create a retriever and pass the retrieved context to a chat model along with the user query.

What chunk size should I use for text splitting in RAG?▼

A chunk size between 500 and 1500 characters works well for most RAG systems. Use RecursiveCharacterTextSplitter with chunk_size around 1000 and chunk_overlap of 10-20 percent to preserve context across chunk boundaries.

Chroma vs FAISS vs Pinecone for vector storage?▼

Chroma suits development with disk persistence, FAISS offers high-performance local search with disk saving, and Pinecone is a managed cloud option for production. InMemory stores are only appropriate for testing since data is lost on restart.

Why does FAISS load_local raise a deserialization error?▼

FAISS requires explicitly passing allow_dangerous_deserialization=True when calling load_local because loading pickled indexes can execute arbitrary code. Only enable this for indexes you created and trust.

Can I use different embedding models for indexing and querying?▼

No, you must use the same embedding model for both indexing and querying, since vectors from different models are incompatible. Mixing models or mismatched dimensions causes retrieval failures or dimension mismatch errors.