Advanced Book RAG Chunker

•
1
•

Generates retrieval-optimized JSONL chunks from books using structure-aware splitting, late chunking, and Anthropic-style contextual prefixes.

This skill automates the complex process of segmenting long-form book content into semantic units optimized for RAG (Retrieval-Augmented Generation). It implements industry-leading techniques like structure-aware splitting on H2/H3 headings to avoid mid-paragraph breaks, late chunking to preserve anaphora across paragraphs, and Claude-powered contextual prefixes that situate each chunk within the broader narrative. By producing a canonical chunks.jsonl file, it ensures consistent search performance across pgvector, OpenAI, Gemini, and Claude, making it essential for developers building high-fidelity AI-powered book search or research tools.

주요 기능

01Automatic token calculation using tiktoken cl100k_base for exact target sizes
02Structure-aware splitting on H2/H3 headings and paragraph boundaries
03Anthropic-style contextual prefix generation for improved retrieval accuracy
04Late chunking implementation to preserve cross-paragraph context and anaphora
05Intelligent diffing to process only changed chapters and minimize API costs
061 GitHub stars

사용 사례

01Preparing large manuscript libraries for high-precision RAG applications
02Building AI research tools that require deep semantic understanding of book structures
03Migrating book content to vector databases like pgvector or OpenAI Vector Stores