AI EngineeringInterview preparation
Intermediate·Concept·2 min read

Hybrid RAG, reranking, and parent-child retrieval

Practice this question

Overview

  • Hybrid RAG uses lexical and semantic retrieval together.
  • Reranking carefully orders the retrieved candidates.
  • Parent-child retrieval searches smaller child chunks but supplies a larger parent section when the child is selected.

Why this matters

Search benefits from precise units, while answering often requires surrounding qualifications.

An everyday example

Find the right paragraph through an index, then read its whole section before explaining it.

A technical example

Retrieve a child containing “theft” and expand to its parent section including exclusions and required police-report conditions.

How it works

  1. Index parent/child relationships
  2. Hybrid retrieve children
  3. Rerank
  4. Load authorized parent sections
  5. Deduplicate
  6. Budget context.

Architecture and flow

Hybrid child retrieval → rerank → parent expansion → grounded answer.

The insurance assistant example

A short hit about vehicle damage should bring in the adjacent exception that changes coverage.

When to use it

Structured manuals and policies with conditions distributed around matching phrases.

When to avoid it

Avoid parent expansion when parents are huge, irrelevant, or have different access permissions.

Interview answer

“I search precise chunks and expand only to the supporting section when the answer needs surrounding context.”

Benefits, trade-offs, and production considerations

  • Parent expansion raises token usage.
  • Preserve child source coordinates, apply ACLs at every loaded level, and evaluate whether expansion improves correctness rather than only making answers longer.
Adapted from 13_AI.MD · “Hybrid RAG, reranking, and parent-child retrieval”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.