Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/langchain-data-handling

@0d57af8
Run it yourself

Load and chunk documents for LangChain 1.0 RAG pipelines correctly — language-aware splitters, table-safe PDF loaders, Cloudflare-compatible web loaders, chunk-boundary strategies that survive real-world structure. Use when building a RAG pipeline, diagnosing why retrieval misquotes a table, or debugging a crawler returning blank content. Trigger with "langchain document loader", "text splitter", "chunking strategy", "pdf loader", "markdown splitter", "webbaseloader".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/langchain-data-handling

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesone-pager.md

≈856 tokens on demand. Your agent reads this file only when SKILL.md points to it.

langchain-data-handling — One-Pager

Load and chunk documents for LangChain 1.0 RAG pipelines correctly — language-aware splitters, table-safe PDF loaders, Cloudflare-compatible web loaders, chunk-boundary strategies that survive real-world document structure.

The Problem

RecursiveCharacterTextSplitter with default separators ["\n\n", "\n", " ", ""] splits on any blank line — including inside triple-backtick code fences in Markdown. A RAG system over a Python docs site retrieves the first half of a function (signature + one line) in one chunk and the body in another, then the LLM hallucinates what the function does. PyPDFLoader splits documents page-by-page, tearing multi-row tables in half so RAG answers misquote numeric rows. WebBaseLoader's default User-Agent looks like a bot; Cloudflare-protected sites return a 403 interstitial HTML blob instead of real content, and the crawler indexes the challenge page. All three failures are silent — no exceptions, just bad retrieval.

The Solution

This skill gives you a loader-selection matrix (PDF / web / Markdown / code / corpus) mapped to the right LangChain 1.0 loader with strengths, gotchas, and cost notes; a splitter decision tree that routes Markdown to Language.MARKDOWN, Python to Language.PYTHON, and long HTML to HTMLHeaderTextSplitter; chunk-size and overlap presets (1000/100 for prose, 1500/150 for code, 500/50 for FAQs) calibrated against retrieval eval sets; a table-preservation pattern that detects tables in PDFs and indexes them as separate structured records; and a crawler-hygiene reference covering User-Agent headers, robots.txt, rate limiting, and Cloudflare-friendly patterns. Pinned to LangChain 1.0.x with four deep references.

Who / What / When

Aspect Details
Who Python engineers and researchers ingesting documents for RAG pipelines — PDFs, Markdown docs sites, web pages, code repos — using LangChain 1.0
What Loader-selection matrix, splitter decision tree, chunk-size presets, table-detection and indexing pattern, crawler-hygiene guide, 4 references (loader-selection-matrix, language-aware-splitters, table-preservation, crawler-hygiene)
When When building a RAG pipeline, diagnosing why retrieval misquotes a table, debugging a web crawler that returns blank content, or tuning chunk boundaries for a documentation site with mixed prose and code

Key Features

  1. Language-aware splitting that respects code fences — RecursiveCharacterTextSplitter.from_language(Language.MARKDOWN) keeps triple-backtick fences intact, so function signatures and bodies stay in the same chunk; Language.PYTHON splits at class/def boundaries instead of blank lines
  2. Table-safe PDF loading with separate structured indexing — PyMuPDFLoader / UnstructuredPDFLoader detect table structure and emit them as distinct elements; tables are indexed as structured records (one record per row with column metadata), so numeric answers don't span chunk boundaries
  3. Crawler hygiene for Cloudflare-protected sites — header_template={"User-Agent": "Mozilla/5.0 ..."} plus robots.txt respect and per-host rate limiting (default 1 req/sec) prevents 403 interstitials and courteous crawler behavior; RSS/sitemap loaders preferred when available

Quick Start

See SKILL.md for full instructions.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides comprehensive guides and code for LangChain RAG pipelines, covering table-aware PDF loading, language-specific text splitting, and crawler best practices. It correctly addresses common RAG challenges such as broken code blocks and Cloudflare bot detection. A low-risk surface for indirect prompt injection is present due to the nature of RAG pipelines ingesting untrusted external data into LLM prompts.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
What it can do
Reads files Edits files Runs commands
version
2.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
compatibility
Designed for Claude Code
All 5 allowed tools
ReadWriteEditBash(python:*)Bash(pip:*)
Other metadata
tags
[
  "saas",
  "langchain",
  "langgraph",
  "python",
  "langchain-1.0",
  "document-loaders",
  "text-splitters",
  "rag"
]

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/langchain-data-handling