Communityコーディング&開発github.com

langchain-ai/langchain-rag

検索拡張生成(RAG)システムを構築する際に呼び出すスキル。ドキュメントローダー、RecursiveCharacterTextSplitter、埋め込み(OpenAI)、ベクトルストア(Chroma、FAISS、Pinecone)をカバーします。

langchain-rag とは?

このスキルは、LangChainを使用した検索拡張生成(RAG)システムの構築に特化しています。ドキュメントの読み込み、分割、埋め込み、ベクトルストアへの保存といったRAGパイプラインの主要コンポーネントを網羅し、OpenAIの埋め込みモデルとChroma、FAISS、Pineconeといった主要ベクトルデータベースをサポートします。開発者はこのスキルを呼び出すことで、RAGシステムの実装におけるベストプラクティスを迅速に適用でき、コードの生成や設定のアドバイスを得ることができます。Claude CodeやCursorなどのAIエージェント環境で利用可能で、SKILL.mdには具体的なコード例や設定手順が含まれているため、効率的な開発が可能です。

対応~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/langchain-ai/langchain-skills/tree/main/skills/langchain-rag

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

langchain-rag は何をしますか?

検索拡張生成(RAG)システムを構築する際は、このスキルを呼び出してください。ドキュメントローダー、RecursiveCharacterTextSplitter、埋め込み(OpenAI)、ベクトルストア(Chroma、FAISS、Pinecone)をカバーします。

概要

このスキルは、LangChainフレームワークを使用したRAGシステムの構築を支援します。以下のコンポーネントを扱います:

  • ドキュメントローダー: 様々なソースからドキュメントを読み込みます
  • テキスト分割: RecursiveCharacterTextSplitterを使用した効率的な分割
  • 埋め込み: OpenAIの埋め込みモデルを使用
  • ベクトルストア: Chroma、FAISS、Pineconeへの保存と検索

使用方法

  1. スキルを呼び出してRAGシステムの構築を開始します
  2. ドキュメントローダーを設定します(例:TextLoader, PDFLoader)
  3. テキストを分割します(RecursiveCharacterTextSplitter)
  4. 埋め込みを生成します(OpenAIEmbeddings)
  5. ベクトルストアに保存します(Chroma, FAISS, Pinecone)

コード例

from langchain_community.document_loaders import TextLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_openai import OpenAIEmbeddings
from langchain_community.vectorstores import Chroma

# ドキュメントの読み込み
loader = TextLoader("example.txt")
documents = loader.load()

# テキスト分割
text_splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000,
    chunk_overlap=200
)
splits = text_splitter.split_documents(documents)

# 埋め込みとベクトルストア
embeddings = OpenAIEmbeddings()
vectorstore = Chroma.from_documents(
    documents=splits,
    embedding=embeddings
)

サポート対象

  • ドキュメントローダー: テキスト、PDF、HTML、Markdownなど
  • テキスト分割: RecursiveCharacterTextSplitter
  • 埋め込みモデル: text-embedding-ada-002(OpenAI)
  • ベクトルストア: Chroma(ローカル)、FAISS(ローカル)、Pinecone(クラウド)

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

langchain-ai/deep-agents-core

INVOKE THIS SKILL when building ANY Deep Agents application. Covers create_deep_agent(), harness architecture, SKILL.md format, and configuration options.

langchain-ai/deep-agents-memory

INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.

langchain-ai/deep-agents-orchestration

INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents. Covers SubAgentMiddleware, TodoList for planning, and HITL interrupts.

langchain-ai/framework-selection

INVOKE THIS SKILL at the START of any LangChain/LangGraph/Deep Agents project, before writing any agent code. Determines which framework layer is right for the task: LangChain, LangGraph, Deep Agents, or a combination. Must be consulted before other agent skills.

langchain-ai/langchain-dependencies

INVOKE THIS SKILL when setting up a new project or when asked about package versions, installation, or dependency management for LangChain, LangGraph, LangSmith, or Deep Agents. Covers required packages, minimum versions, environment requirements, versioning best practices, and common community tool packages for both Python and TypeScript.

langchain-ai/langchain-fundamentals

Create LangChain agents with create_agent, define tools, and use middleware for human-in-the-loop and error handling.

langchain-ai/langchain-middleware

INVOKE THIS SKILL when you need human-in-the-loop approval, custom middleware, or structured output. Covers HumanInTheLoopMiddleware for human approval of dangerous tool calls, creating custom middleware with hooks, Command resume patterns, and structured output with Pydantic/Zod.

langchain-ai/langgraph-fundamentals

INVOKE THIS SKILL when writing ANY LangGraph code. Covers StateGraph, state schemas, nodes, edges, Command, Send, invoke, streaming, and error handling.

langchain-ai/langgraph-human-in-the-loop

INVOKE THIS SKILL when implementing human-in-the-loop patterns, pausing for approval, or handling errors in LangGraph. Covers interrupt(), Command(resume=...), approval/validation workflows, and the 4-tier error handling strategy.

langchain-ai/langgraph-persistence

INVOKE THIS SKILL when your LangGraph needs to persist state, remember conversations, travel through history, or configure subgraph checkpointer scoping. Covers checkpointers, thread_id, time travel, Store, and subgraph persistence modes.

langchain-ai/swarm

Dispatches many independent items in parallel: create a table, fan out to subagents, aggregate results. One row = one unit of work.

関連スキル