Generative AI is the branch of artificial intelligence that creates new content (text, images, code, audio or video) instead of only classifying or predicting from existing data. RAG is one of the most practical ways to put generative AI to work in a business. This lesson explains what generative AI is, how large language models fit into it, and where RAG comes in.
What you will learn
- The difference between traditional (predictive) AI and generative AI
- What foundation models and large language models are
- What generative AI is good and bad at
- How RAG makes generative AI useful for your own data
Prerequisites
None. This is a conceptual lesson for complete beginners.
Traditional AI vs generative AI
| Traditional (predictive) AI | Generative AI | |
|---|---|---|
| Output | A label, number or decision | New content: text, images, code, audio |
| Example | "Is this email spam?" → yes/no | "Write a polite reply to this email" → a new email |
| Training | Usually one task, with labelled examples | Huge general datasets, then adapted to many tasks |
| Interface | Called by code with fixed inputs | Instructed in natural language (prompts) |
Both remain useful. Fraud scoring, demand forecasting and recommendations are still mostly predictive AI. Generative AI shines where the output is language or other rich content.
Foundation models and LLMs
A foundation model is a large model trained on broad data that can be adapted to many tasks. A large language model (LLM) is a foundation model for text: it is trained to predict the next token on enormous amounts of text and code, and through that learns grammar, facts, reasoning patterns and programming. Many current LLMs are multimodal, also reading images and documents. The lesson How Large Language Models Work explains the mechanics.
What generative AI can do
- Write and rewrite: drafts, summaries, translations, tone changes.
- Answer questions and explain concepts conversationally.
- Extract structure: turn invoices, contracts or emails into JSON fields.
- Write and explain code.
- Reason over provided material: compare documents, find inconsistencies.
- Act: call tools and APIs as an agent.
Where it falls short
- No knowledge of your private data: it never saw your internal documents.
- Knowledge cutoff: it does not know recent events unless told.
- Hallucination: it can produce plausible but false statements (LLM Hallucinations).
- No built-in sources: answers from memory cannot be traced to evidence.
How RAG fits in
RAG connects a generative model to a knowledge source. The system first retrieves relevant passages from your documents, then asks the model to generate an answer from them. The generative model provides language understanding and fluency; retrieval provides current, private and verifiable facts. Together they address three of the four shortcomings above.
A tiny demonstration
The same model, without and with provided context. The helper ask() comes from rag_helpers.py.
from rag_helpers import ask
print(ask("What is the refund window at Zentrix Store?")) # a made-up company
context = "Zentrix Store policy: refunds are accepted within 21 days of delivery."
print(ask(f"{context}\n\nUsing only the text above: what is the refund window at Zentrix Store?"))
I don't have information about Zentrix Store's refund policy...
The refund window at Zentrix Store is 21 days from delivery.
Common misconceptions
- "It looks things up on the internet." A plain LLM call does not browse; it answers from its training unless your application provides tools or context.
- "It understands like a person." It is very capable at language tasks, but it does not have access to the truth of what it says. Grounding and evaluation are your responsibility.
- "Bigger models remove the need for RAG." Even the largest models do not know your private, current documents.
Key takeaways
- Generative AI creates new content; predictive AI classifies or forecasts.
- LLMs are foundation models for language, instructed with prompts.
- They lack private, current and verifiable knowledge.
- RAG supplies that knowledge by retrieving evidence before generation.
Frequently asked questions
Is ChatGPT or Claude "generative AI"?
Yes. They are chat applications built on large language models, which are generative AI models.
Do I need to train my own model to use generative AI?
No. Most applications use existing models through an API or run open-weight models locally, and add knowledge with RAG.
Practice exercises
- List three tasks in your work that are predictive and three that are generative.
- For one generative task, write down what private knowledge the model would need, and where that knowledge lives today.