Reading preferences
Concept

From Documents to Retrieved Passages

Trace chunking, vector search, hybrid retrieval, and reranking.

generative ai, retrieval, embeddings, search

Prepare a collection

Ingestion collects documents, extracts text, preserves source and permission metadata, and divides text into chunks. Chunk boundaries affect meaning: a table or sentence split badly may lose context. A vector store can index embeddings for similarity search; a keyword index can retain exact terms.

Find the library hours

  1. Split a library guide into passages and keep each passage's source and access rules.
  2. Search the user's question with keyword and embedding-based retrieval.
  3. Combine candidates and rerank them; return the most relevant permitted passages with their source. A missed candidate cannot be fixed by reranking.

See the reasoning

Find a permitted passage

Trace document preparation, retrieval, and reranking. This is a prepared demonstration, not live code execution.

Prepare

Library guide pipeline
  1. GuideChunks with source and permissionsCurrent focus
  2. SearchNot run
  3. CandidatesNone

Preserve source and permission metadata when chunking.

Choices and risks

Hybrid search combines lexical and vector signals, but the combination and similarity metric need evaluation. Approximate nearest-neighbour search trades some recall for speed. Apply access controls before exposing results, and update or delete stale indexed content. Embeddings can capture sensitive information and semantic similarity is not evidence that a passage is true.

Reflect on the concept

Four fixed questions to reinforce the reasoning. Answers are not saved or scored.

1. Why split a long document into chunks?
2. What can a vector store search?
3. What might hybrid retrieval combine?
4. What does reranking do?

References and further reading