contextual-retrieval

Locate precise text chunks with hierarchical parent context in documents.

3|2|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/zilliztech/milvus-marketplace --skill contextual-retrieval
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contextual-retrieval
Source: https://github.com/zilliztech/milvus-marketplace/tree/main/plugins/retrieval-system/skills/contextual-retrieval
Command: npx skills add https://github.com/zilliztech/milvus-marketplace --skill contextual-retrieval

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Contextual retrieval locates precise, small chunks while supplying relevant parent context to preserve meaning and improve comprehension.

Core Features & Use Cases

  • Hierarchical chunking to associate child matches with their parent sections
  • Context-window expansion to retrieve surrounding sections for richer answers
  • Markdown-aware chunking for documents with headings, code blocks, and tables
  • Use cases include long contracts, technical docs, legal memos, and research papers

Quick Start

Install and configure Milvus, index documents with hierarchical chunks, and run contextual search against queries.

Frequently Asked Questions about contextual-retrieval

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I retrieve small text chunks with surrounding context from long documents?

Contextual retrieval locates precise chunks while automatically supplying parent context—surrounding sections that preserve meaning. This technique works by indexing documents hierarchically, then returning child matches paired with their parent sections, making it ideal for contracts, technical manuals, and research papers where exact answers need framing.

What's the best way to chunk long documents for vector search?

Hierarchical chunking associates small text segments with their parent sections, enabling precise matches without losing context. Markdown-aware chunking preserves document structure—headings, code blocks, tables—so child chunks can be retrieved together with parent context, improving both retrieval accuracy and comprehension.

Can I use contextual retrieval with Milvus?

Yes. Contextual retrieval is built to work with Milvus as the vector database. Index your documents with hierarchical chunks in Milvus, then query against it to retrieve child matches combined with parent context in a single end-to-end workflow.

How do I expand search results with surrounding context?

Context-window expansion retrieves not only matching chunks but also adjacent sections from the parent document. This enriches search results by providing background information, so answers are grounded in their full context rather than isolated snippets.

When should I use contextual retrieval instead of flat chunking?

Use contextual retrieval when exact answers must be understood within their document structure—legal contracts, technical specifications, research papers. Flat chunking loses hierarchy; contextual retrieval preserves parent-child relationships so readers get both precision and surrounding context.