RAG & AI AgentsAdvanced20 min read5 questions

RAG Architecture: Chunking, Vector Search & Hybrid Retrieval

RAG is the most-built AI system in industry and the most-failed. Learn the design decisions that actually determine whether it works: chunking, hybrid retrieval and index choice.

Covers: RAG pipeline design, chunking strategies, vector databases and ANN indexes, hybrid search, metadata filtering

Every company building on LLMs builds a RAG system, and most of them underperform. The reason is almost never the language model — it is retrieval. If the right chunk is not in the top-k, no amount of prompt engineering will save the answer.

Filter
0/5 mastered
Advancedragarchitecturesystem-designAsked at Glean, Notion

30-second answer

Ingestion (parse, clean, chunk, enrich with metadata, embed, index), retrieval (hybrid dense + sparse, metadata filtering, rerank), and generation (assemble context, prompt with citation requirements, verify). Critically, add an evaluation layer that measures retrieval recall and generation faithfulness separately, plus access control enforced at query time — not after retrieval.

AdvancedchunkingragretrievalAsked at LlamaIndex, Pinecone

30-second answer

Chunks too small lose the context needed to be understood or matched; chunks too large dilute the embedding so the relevant sentence is averaged away with irrelevant text, and they waste context budget. 300–600 tokens with 10–20% overlap is a reasonable default, but structure-aware splitting beats fixed windows, and small-to-big retrieval (embed small, return the parent) resolves the trade-off directly.

Expertvector-databaseannhnswAsked at Pinecone, Qdrant

30-second answer

HNSW is a navigable small-world graph: excellent recall/latency, but memory-heavy and slow to build. IVF partitions into clusters and searches only the nearest few — much cheaper memory, tunable via nprobe, but recall degrades near cluster boundaries. Product quantisation compresses vectors 8–64× by splitting into subvectors and quantising each, trading accuracy for memory. At 100M vectors I would use IVF-PQ or HNSW-PQ, because raw HNSW would need hundreds of gigabytes of RAM.

Advancedhybrid-searchbm25rerankingAsked at Cohere, Elastic

30-second answer

Dense embeddings capture semantics but are weak on exact tokens — product codes, error numbers, names, rare acronyms — because those get averaged into a general-topic vector. BM25 handles exact terms perfectly but misses paraphrase. Hybrid search fuses both (usually with reciprocal rank fusion). Reranking then applies a cross-encoder that reads query and document jointly, which is far more accurate than any bi-encoder similarity and typically the single biggest quality win in a RAG system.

Advancedrag-evaluationfaithfulnessragasAsked at Anthropic, Glean

30-second answer

Evaluate retrieval and generation separately, because they fail differently. For retrieval: recall@k, precision@k and NDCG against a gold set of query→relevant-chunk pairs. For generation: faithfulness (is every claim supported by the retrieved context?), answer relevance, and citation accuracy. Then build a failure taxonomy from real bad answers so you know which stage to fix — most 'wrong answers' turn out to be retrieval misses, not model failures.

Showing 5 of 5 questions for rag-architecture-interview-questions.

Check your understanding

5 questions · no sign-up, nothing stored

0/5 answered
Question 1

1.Access control in a RAG system should be enforced:

Question 2

2.Chunks of 2000 tokens typically hurt retrieval because:

Question 3

3.For 100M vectors at 768 dimensions, plain HNSW is usually impractical because:

Question 4

4.Hybrid search improves recall, while reranking improves:

Question 5

5.A RAG gold evaluation set should include unanswerable questions because:

Hands-on challenge

Build it — this is what you talk about in a deep-dive round.

Build and evaluate a complete RAG pipeline

Take any document corpus and build a RAG system where every design decision is justified by a measurement.

Requirements

  • Structure-aware chunker that never splits tables or code blocks, with configurable size and overlap.
  • Hybrid retrieval (dense + BM25) fused with RRF, plus a cross-encoder reranker and a relevance threshold.
  • A gold set of 100+ queries with labelled relevant chunks, including ≥15% unanswerable.
  • An evaluation harness reporting recall@k, NDCG@k, faithfulness, citation accuracy and refusal rate.

Stretch goals

  • Implement small-to-big retrieval and quantify the recall and faithfulness improvement.
  • Sweep chunk size × overlap × strategy and produce a table showing which combination wins on your data.