All Lessons

A pharmaceutical company is building a clinical trial assistant that must answer researcher questions from a corpus of 50,000 clinical study PDFs (approximately 10M tokens total). The 200K-token context window cannot accommodate all documents. The team evaluates two architectures: embedding all documents and retrieving relevant chunks per query versus crafting a massive system prompt containing all document summaries. An architect explains that one of these approaches has a specific name and is the established pattern for this problem. Which architectural pattern is the architect recommending, and what does RAG stand for?

1 / 3
advanced 30 min

Retrieval-Augmented Generation

Loading lesson content...

An enterprise search startup is building a RAG system for internal company wikis. Their current system chunks documents into fixed 256-character blocks, but retrieval often returns incomplete sentences and broken code snippets that confuse the model. The team is evaluating chunking strategies: 100-character fixed chunks, semantic paragraph-based chunks, whole-document chunks, or even character-by-character indexing. Their wiki content includes markdown documents with code blocks, tables, and nested bullet lists. Which chunking strategy produces the most useful chunks for generation quality?

1 / 1

A RAG system retrieves relevant context but the model sometimes uses its training knowledge instead of the retrieved facts. How to fix?

1 / 2