[{"data":1,"prerenderedAt":135},["ShallowReactive",2],{"term-r\u002Frag":3,"related-r\u002Frag":116},{"id":4,"title":5,"acronym":6,"body":7,"category":95,"description":96,"difficulty":97,"extension":98,"letter":99,"meta":100,"navigation":101,"path":102,"related":103,"seo":109,"sitemap":110,"stem":113,"subcategory":114,"__hash__":115},"terms\u002Fterms\u002Fr\u002Frag.md","RAG","Retrieval Augmented Generation",{"type":8,"value":9,"toc":89},"minimark",[10,15,19,23,26,30,78,82,85],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"RAG is how you give an AI access to your private documents without retraining it. You store your docs as embeddings in a vector database, and when someone asks a question, you retrieve the relevant chunks and paste them into the AI's prompt. The AI reads those chunks and answers with YOUR data. It's like giving the AI a cheat sheet at exam time.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"Retrieval Augmented Generation is a pattern that combines a retrieval system (typically a vector database) with a generative LLM. At query time, relevant documents are retrieved based on semantic similarity to the query, then injected into the LLM's context as grounding. RAG reduces hallucination and enables LLMs to answer questions about private or recent information.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Simplified RAG pipeline\nquery_embedding = embed(user_query)\nrelevant_chunks = vector_db.search(query_embedding, top_k=5)\ncontext = \"\\n\".join(relevant_chunks)\nprompt = f\"Context: {context}\\n\\nQuestion: {user_query}\\nAnswer:\"\nresponse = llm.generate(prompt)\n","python","",[38,39,40,48,54,60,66,72],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"# Simplified RAG pipeline\n",[41,49,51],{"class":43,"line":50},2,[41,52,53],{},"query_embedding = embed(user_query)\n",[41,55,57],{"class":43,"line":56},3,[41,58,59],{},"relevant_chunks = vector_db.search(query_embedding, top_k=5)\n",[41,61,63],{"class":43,"line":62},4,[41,64,65],{},"context = \"\\n\".join(relevant_chunks)\n",[41,67,69],{"class":43,"line":68},5,[41,70,71],{},"prompt = f\"Context: {context}\\n\\nQuestion: {user_query}\\nAnswer:\"\n",[41,73,75],{"class":43,"line":74},6,[41,76,77],{},"response = llm.generate(prompt)\n",[11,79,81],{"id":80},"when-youll-hear-this","When You'll Hear This",[16,83,84],{},"\"Build a RAG pipeline so the AI can answer questions about our docs.\" \u002F \"RAG is better than fine-tuning for most knowledge tasks.\"",[86,87,88],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":50,"depth":50,"links":90},[91,92,93,94],{"id":13,"depth":50,"text":14},{"id":21,"depth":50,"text":22},{"id":28,"depth":50,"text":29},{"id":80,"depth":50,"text":81},"ai","RAG is how you give an AI access to your private documents without retraining it.","intermediate","md","r",{},true,"\u002Fterms\u002Fr\u002Frag",[6,104,105,106,107,108],"Vector Database","Embedding","LLM","Hallucination","Context Window",{"title":5,"description":96},{"changefreq":111,"priority":112},"weekly",0.7,"terms\u002Fr\u002Frag",null,"723H3joeli-AO30HlPF54zdITs4LigOkGtM6rHL8-Xk",[117,121,124,127,132],{"title":108,"path":118,"acronym":114,"category":119,"difficulty":97,"description":120},"\u002Fterms\u002Fc\u002Fcontext-window","vibecoding","A context window is how much text an AI can 'see' at once — its working memory.",{"title":105,"path":122,"acronym":114,"category":95,"difficulty":97,"description":123},"\u002Fterms\u002Fe\u002Fembedding","An embedding is turning words, sentences, or entire documents into lists of numbers (vectors) that capture their meaning.",{"title":107,"path":125,"acronym":114,"category":119,"difficulty":97,"description":126},"\u002Fterms\u002Fh\u002Fhallucination","When an AI confidently makes something up — like citing a library that doesn't exist or generating code that calls a function that was never written.",{"title":106,"path":128,"acronym":129,"category":95,"difficulty":130,"description":131},"\u002Fterms\u002Fl\u002Fllm","Large Language Model","beginner","An LLM is a humongous AI that read basically the entire internet and learned to predict what words come next, really really well.",{"title":104,"path":133,"acronym":114,"category":95,"difficulty":97,"description":134},"\u002Fterms\u002Fv\u002Fvector-database","A vector database is a special database built to store and search embeddings.",1776518305260]