← Back to Dashboard
1. RAG Architecture in Bedrock2. Chunking, Ranking, and Freshness

Chunking, Ranking, and Freshness

📚 Knowledge Bases and RAG⏱ 11 min⭐ 80 XP⌨ Hands-on lab

Retrieval Quality Engineering

Most RAG failures come from retrieval setup, not the model. If the right passage never reaches the prompt, no model can answer correctly. Tune chunking strategy, ranking, and freshness windows as first-class engineering concerns.

Chunking Strategies in Bedrock Knowledge Bases

StrategyHow it splitsBest for
Fixed-sizeN tokens per chunk with configurable overlapUniform prose; simplest baseline
HierarchicalSmall child chunks for precise matching, larger parents returned for contextLong structured docs (runbooks, policies)
SemanticSplits at meaning boundaries using embedding similarityMixed-topic documents
NoneOne document = one chunkShort FAQs and atomic records

Failure Modes and Symptoms

  • Chunk too large → low relevance precision - retrieved text contains the answer plus three unrelated topics, diluting the prompt.
  • Chunk too small → context fragmentation - the answer spans two chunks and neither alone makes sense.
  • No overlap → sentences cut mid-thought at chunk boundaries.
  • No freshness strategy → stale operational guidance - last year's escalation phone tree, deprecated API endpoints.

Freshness Is a Pipeline Property

Define sync cadence per source (e.g. runbooks daily, policies weekly), tag chunks with ingestion timestamps, and filter or down-rank stale content at query time. An answer grounded in an outdated document is still a wrong answer - with a convincing citation.

Diagnostic discipline: evaluate retrieval separately from generation. Score "did the right chunk appear in top-k?" (recall@k) before scoring "was the final answer correct?". This tells you instantly which half of the pipeline is failing.
⌨ HANDS-ON LABInspect Knowledge Base Ingestion Job & Chunking Metrics
⭐ +150 XP

Monitor an automated Knowledge Base sync job and evaluate hierarchical chunking outputs.

1Check status of the document sync ingestion job.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 1 — type "hint" if stuck
🧪 Knowledge Check
Press 1-4 to select1 of 2
A common RAG anti-pattern is:
Testing retrieval metrics
Ignoring chunk strategy and freshness
Adding citations
Using allowlists