Retrieval-Augmented Generation
RAG retrieves relevant documents first, then conditions a language model on that evidence so answers can be grounded, cited, and updated without retraining.
Definition
Retrieval-Augmented Generation (RAG) is an AI pattern that first retrieves relevant documents or memory chunks, then conditions the language model on that evidence before it answers. The goal is grounded answers with citations instead of free-floating generation.
Why it matters
Pure LLMs invent plausible facts. RAG makes the answer depend on an indexed corpus (wiki, research, desk notes), so users can audit what was used and spot missing coverage. For ZTrader Memory, RAG is the bridge between Codex knowledge and chat.
Case
Ask “what is Active Share?” Without retrieval, a model may invent a formula. With RAG, it pulls the Codex entry, answers from that text, and points to the encyclopedia page. If the corpus only has a stub line, a honest system says the definition is thin instead of fabricating a trading playbook.
How to read it
Judge RAG by evidence quality, citation fidelity, and latency — not demo fluency. If every hit is a one-line category tagline, retrieval is working and the corpus is empty. Fix content first; more prompt engineering will not invent Definition/Case that was never stored.
Ask the macro AI about this object
Opens Copilot with Codex + RAG context, or send the object into Alpha Factory intake.