---
id: "prereq-rag-understanding"
type: "prereq"
source_timestamps: ["00:03:13"]
tags: ["machine-learning"]
related: []
reason: "Required to understand why AI agents need a 'context layer' to access external memory."
sources: ["s11-wiki-vs-open-brain"]
sourceVaultSlug: "s11-wiki-vs-open-brain"
originDay: 11
---
# Retrieval-Augmented Generation (RAG)

# Prerequisite: Retrieval-Augmented Generation (RAG)

**Reason needed:** Required to understand why AI agents need a *context layer* to access external memory.

## What You Need to Know

The video assumes the viewer understands the basic mechanics of how LLMs interact with external documents — Retrieval-Augmented Generation (RAG):

1. The LLM has a fixed context window and finite trained knowledge.
2. RAG inserts retrieved external documents into the prompt at runtime.
3. The quality of retrieval — what is retrieved, how it is structured, and when synthesis happens — determines output quality.

## Why It's Required

The entire debate between [[concept-ai-wiki]] and [[concept-openbrain-architecture]] is fundamentally a debate about **how to structure the retrieval and generation pipeline** for an LLM:

- The Wiki shifts retrieval cost into ingest time ([[concept-write-time-synthesis]]).
- The Database keeps retrieval cheap structurally and shifts synthesis to query time ([[concept-query-time-synthesis]]).

## Adjacent Literature (from enrichment)

Advanced RAG literature now discusses *hybrid vector + SQL stores* to balance speed and accuracy — directly extending this video's debate.
