一键导入
sliding-window-chunking
Use overlapping windows to preserve context across chunk boundaries while controlling retrieval size.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use overlapping windows to preserve context across chunk boundaries while controlling retrieval size.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
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.
Chunk nested documents into parent-child levels so retrieval can move from broad sections to fine-grained passages.
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.
Reduce retrieval latency with caching, batching, and index-level optimization.
Route RAG performance work for latency, caching, indexing, filtering, batching, and query optimization.
| name | sliding-window-chunking |
| title | Sliding Window Chunking |
| description | Use overlapping windows to preserve context across chunk boundaries while controlling retrieval size. |
| allowed-tools | ["Read","Grep","Glob","Bash"] |
| category | chunking |
| tags | ["overlap","context-preservation","window","boundary"] |
Sliding window chunking creates overlapping chunks where each chunk shares content with adjacent chunks. This preserves context at chunk boundaries, ensuring that information split across chunks remains accessible through multiple retrieval paths.
Non-overlapping chunking creates hard boundaries that can break important context:
Calculate appropriate overlap based on your use case and chunk size.
Why: The overlap ratio determines how much context is preserved - too little loses context, too much creates redundancy.
Create chunks with configurable overlap.
Why: Boundary adjustment prevents chunks from ending mid-sentence while maintaining the sliding window pattern.
Track overlap information for retrieval-time decisions.
Why: Metadata allows retrieval systems to identify and deduplicate overlapping content.
Handle overlapping results intelligently.
Why: Smart retrieval prevents redundant information while preserving the benefits of overlapping chunks.
Implement sliding window based on tokens rather than characters.
Why: Token-aware chunking is more accurate for LLMs and respects their actual token limits.
Useful implementations include LangChain RecursiveCharacterTextSplitter, the OpenAI tiktoken cookbook, tiktoken, and Sentence Transformers rerankers.