AI Engineering
Learn LLMs, RAG, agents, secure tools, and production AI through practical insurance examples.
RAG: three levels of understanding
RAG stands for retrieval-augmented generation. It retrieves relevant external information and provides that information to a model before asking for an answer. It connects language generation to a changing knowledge source without retraining the model.
Document ingestion, PDF processing, and parsing
Ingestion is the pipeline that turns approved source files into searchable records. Parsing extracts text and structure; PDFs may contain actual text, scanned images, tables, or all three. OCR, optical character recognition, converts image-based letters into…
Chunking, chunk size, overlap, and metadata
Chunking divides documents into retrieval-sized pieces. Chunk size controls how much content each piece contains; overlap repeats a small amount at boundaries. Metadata identifies the piece's source, permissions, version, and other useful attributes.
Retrieval, context construction, and prompt construction
Retrieval selects candidate evidence. Context construction chooses which evidence and conversation details the model sees. Prompt construction combines trusted instructions, the user's question, and clearly labeled untrusted source material.
Citations and source attribution
A citation points to evidence supporting a statement. Source attribution identifies the original document, location, and version. The model can suggest references, but the application must ensure they map to actual retrieved sources.
Query rewriting, multi-query retrieval, and query decomposition
Query rewriting restates a request for search, often resolving references from conversation. Multi-query retrieval searches alternative formulations. Query decomposition splits a compound question into smaller questions that may require separate evidence.
Hybrid RAG, reranking, and parent-child retrieval
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.
Multi-hop RAG and agentic RAG
Multi-hop RAG retrieves information in dependent steps: one finding determines the next search. Agentic RAG lets a bounded agent choose retrieval tools or decide whether another search is needed. A fixed two-step retrieval workflow can be multi-hop without…
Corrective RAG, self-reflective RAG, and context compression
Corrective RAG detects inadequate retrieval and applies a correction, such as reformulating search. Self-reflective RAG checks whether evidence or an answer is sufficient and supported. Context compression reduces retrieved text to the parts useful for the…
Graph RAG
Graph RAG retrieves through entities and relationships, such as customer → policy → endorsement → covered asset. It can combine graph traversal, document retrieval, and generated summaries. A graph represents connected facts; it is separate from LangGraph's…
RAG evaluation and comparison with alternatives
RAG evaluation measures retrieval quality and answer quality independently and together. Fine-tuning changes model behavior through training; long context supplies a large body of content directly; traditional search returns evidence without generating an…
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.