一键导入
hierarchical-chunking
Chunk nested documents into parent-child levels so retrieval can move from broad sections to fine-grained passages.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Chunk nested documents into parent-child levels so retrieval can move from broad sections to fine-grained passages.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | hierarchical-chunking |
| title | Hierarchical Chunking |
| description | Chunk nested documents into parent-child levels so retrieval can move from broad sections to fine-grained passages. |
| allowed-tools | ["Read","Grep","Glob","Bash"] |
| category | chunking |
| tags | ["nested","multi-level","document-structure","parent-child"] |
Hierarchical chunking creates multi-level chunk structures that preserve document hierarchies (chapters, sections, subsections). This enables both broad-overview retrieval (high-level chunks) and detailed retrieval (low-level chunks) with parent-child relationships for context propagation.
Flat chunking strategies lose the structural relationships within documents:
Extract the hierarchical structure of your documents.
Why: Proper parsing is foundational - you can't create a hierarchy without understanding the structure.
Generate chunks at multiple levels from the parsed hierarchy.
Why: Multiple chunk levels allow different retrieval strategies - summary chunks for broad questions, detailed chunks for specifics.
Persist hierarchy information for retrieval-time context propagation.
Why: Metadata enables filtering and hierarchical queries (e.g., "retrieve from level 2 or deeper").
Retrieve chunks with optional parent context.
Why: Hierarchical retrieval allows users to "zoom in" from broad topics to specific details, just like browsing a table of contents.
For implementation details, see the LlamaIndex HierarchicalNodeParser, LangChain RecursiveCharacterTextSplitter, Haystack HierarchicalDocumentSplitter, and LlamaIndex Recursive Retriever + Node References.
Use this skill when building, debugging, or improving Retrieval-Augmented Generation systems, including chunking, vector database selection, hybrid search, reranking, multimodal RAG, code documentation RAG, retrieval latency, and production RAG architecture.
Use semantic boundaries and embedding similarity to chunk text for higher-relevance retrieval.
Route RAG chunking decisions across semantic, hierarchical, sliding-window, contextual-header, and framework-selection strategies.
Use overlapping windows to preserve context across chunk boundaries while controlling retrieval size.
Reduce retrieval latency with caching, batching, and index-level optimization.
Route RAG performance work for latency, caching, indexing, filtering, batching, and query optimization.