Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q21IntermediateConcept

Explain parent-child (small-to-big) retrieval and sentence-window retrieval.

30-second answerSay your answer out loud first, then reveal.
Small child chunks are searched with the query, the matching child's parent_id leads back to its parent section, and the whole parent section is sent to the LLM.

Parent-child (small-to-big)

  • Index small child chunks with a parent_id.
  • Search children; map hits to parents; deduplicate parents (several children may share one).
  • Send parents (or parent sections) to the LLM.

Sentence-window

  • Index individual sentences.
  • On a hit, return ±N sentences around it.

Benefits: precise matching and complete context; fixes "the answer chunk lacks context" problems.

Trade-offs

  • Bigger context per hit means more tokens. Limit the number of parents.
  • Extra storage and a lookup step.
  • If parents are too large, you're back to noisy context.

Related idea: multi-vector indexing. Store several representations per chunk (summary, hypothetical questions, raw text) that all point to the same source text.

Little by little, you're building something great.