RAG (Retrieval-Augmented Generation)
advancedDefinition
A way of giving an AI the right reference materials before asking it a question. The system searches a library of documents for the parts that look most relevant, hands them to the AI, and then asks the question. This way the answer is grounded in real, up-to-date information instead of the AI's general training.
In the wild
A company chatbot answers questions about their refund policy. Behind the scenes, it pulls the most relevant paragraphs from the company's actual help center articles and gives them to the AI as background. So the answer matches the real policy, not a made-up one.
More from AI & Prompt Engineering
Agentic AI
An AI that can do more than answer one question at a time. You give it a goal, and it figures out the steps, takes them, checks the results, and keeps going until the job is done: without you holding its hand at each step.
Chain of Thought
A trick where you ask the AI to think out loud, walking through its reasoning step by step, before giving a final answer. It sounds simple, but it dramatically improves accuracy on math problems, puzzles, and anything that needs careful logic.
Context Files (CLAUDE.md, AGENTS.md)
Markdown files kept at the root of a repo that describe conventions, commands, and non-negotiables for an AI coding assistant. The assistant loads them automatically, so they're where you put the rules you don't want to repeat in every prompt.
Context Window
How much text an AI can hold in its head at once: both what you send it and what it writes back. A bigger context window means it can read longer documents, remember more of a conversation, or look at more files at the same time.
Few-Shot Prompting
Showing the AI a few examples of exactly what you want before asking it to do the same for your real input. The examples teach it the pattern far more reliably than a long description ever could.
Fine-Tuning
Taking an AI that already knows a lot and giving it extra training on a smaller, more focused set of examples. So it gets really good at one specific job or style. Unlike just writing a clever prompt, fine-tuning actually changes how the AI thinks.