01. Introduction to Agentic AI
What is Generative AI?
Generative AI (GenAI) creates new content — text, code, images, audio, or plans — from a prompt or context, instead of only classifying or scoring existing inputs.
What you will learn
- Define Generative AI in one clear sentence with an example
- Explain prompt → model → generated output at a high level
- Contrast discriminative AI with generative AI
- Name major modalities: text, code, image, audio, multimodal
- Explain how GenAI relates to Agentic AI without mixing them up
- Answer common interview questions with short, solid answers
Definition
Generative AI is a class of AI systems that produce new content. Given a prompt, context, or partial input, the model generates text, code, images, audio, video frames, or structured drafts that did not exist before as a simple lookup.
This is different from classic discriminative models that mainly decide among labels — spam vs not spam, cat vs dog, approve vs reject. Generative models learn a distribution over possible outputs and sample or decode from it.
In products, Generative AI often means large language models (LLMs) for text/code, diffusion or similar models for images, and multimodal models that mix text with vision or audio.
Introduction
This lesson (#2 in Introduction to Agentic AI) sits between “What is AI?” and “What is Agentic AI?” Generative models are the engine behind many chatbots and coding assistants — and they become the “brain” inside many agents.
If AI is the broad field, Generative AI is the create-content slice. Agentic AI is the pursue-goals-with-tools slice that often wraps a generative model with planning, memory, and actions.
A useful habit: for any GenAI feature, ask — What is the prompt? What modality is generated? How do we check quality? What happens when the model is wrong?
A short history (enough for interviews)
Generative ideas are older than today’s chatbots: Markov text, early language models, GANs for images, and variational autoencoders. The recent wave came from better deep learning, huge datasets, and transformer architectures.
Large language models made text and code generation mainstream. Diffusion models made high-quality image generation common. Multimodal models now accept or produce more than one media type.
You do not need every paper name. Remember the arc: research prototypes → powerful pretrained models → APIs and products → agents that call tools around those models.
- Earlier generative methods — statistical text, GANs, VAEs
- Transformers + scale — strong LLMs for language and code
- Diffusion / related image models — text-to-image products
- Product era — chat UIs, copilots, then agent frameworks on top
Why is it required?
GenAI changed how software is built and used: drafts, explanations, code suggestions, and creative assets can be produced in seconds. Teams that cannot explain GenAI will mis-design products and fail interviews.
- Shared vocabulary for LLMs, prompts, hallucinations, and copilots
- Clear line between classifying data and creating content
- Foundation for Agentic AI — most agents reason with a generative model
- Ability to discuss risk: wrong answers, IP, privacy, and over-trust
- Practical skill: write prompts and evaluate outputs, not only call an API
Architecture / mental model
At product level, GenAI looks simple: Prompt (+ context) → Generative model → Output. Under the hood, text models usually predict the next token again and again; image models often iteratively denoise toward a picture that matches the prompt.
Context may include a system message, chat history, retrieved documents (RAG), or tool results. Decoding settings (temperature, max tokens) change how random or long the output is.
- Prompt — user ask, instructions, examples, constraints
- Context — history, docs, images, structured data
- Model — LLM, diffusion, multimodal generator
- Decode / sample — turn model scores into concrete text or pixels
- Post-check — filters, tests, human review, citations
How does it work?
Training teaches the model patterns of language, code, or images from large datasets (and often later fine-tuning or preference tuning). You usually consume a pretrained model via API or local weights.
At inference time the system formats your prompt, runs the model, and returns generated content. For chat, each reply is generation conditioned on the conversation so far.
- Pretrain (or reuse) a model on large corpora
- Optionally fine-tune or add instructions/preferences for your domain
- At runtime: build prompt + context
- Model generates tokens or image steps until a stop condition
- App displays output, may call tools, or ask the user to confirm
- Evaluate quality; log failures; improve prompts, data, or guardrails
Discriminative AI vs Generative AI
Discriminative models learn boundaries between classes or predict a score. Generative models learn how to produce samples that look like the training domain — a paragraph, a function, a picture.
Both are AI. A spam filter is usually discriminative. A chatbot that writes an email draft is generative. Many products combine them: generate a draft, then classify toxicity or run unit tests.
- Discriminative — label, rank, detect, score existing inputs
- Generative — create new text, code, media, or structured drafts
- Hybrid — generate candidate → validate with rules, tests, or classifiers
Types and modalities
“Generative AI” is a family, not one model. Group products by what they create. The same product may be multimodal (for example, chat that also understands screenshots).
- Text — chat, summarize, translate, rewrite, answer questions
- Code — complete, refactor, explain, generate tests
- Image — text-to-image, edit, style transfer
- Audio — speech synthesis, music; use voice features ethically
- Multimodal — mix text, images, and sometimes audio in one system
Prompts, context, and control
A prompt is the instruction and input you give the model. Good prompts are clear about role, task, format, constraints, and examples. Bad prompts are vague (“make it better”) and invite random output.
You steer GenAI with system instructions, few-shot examples, retrieved facts (RAG), structured output schemas, and decoding parameters. You do not “program” every token — you constrain the generation.
- State the goal and audience explicitly
- Specify format (bullets, JSON, table, max length)
- Provide must-include / must-avoid rules
- Ground answers with retrieved docs when facts matter
- Lower temperature for precise tasks; review high-creativity outputs
Generative AI vs Agentic AI
Generative AI focuses on creating a good response. Agentic AI focuses on finishing a goal: plan steps, call tools (search, code, APIs), observe results, and continue until done or stopped.
Most agents still use a generative model for reasoning and wording. GenAI is often the brain; agent design adds the hands (tools), memory, and loop.
- GenAI chat — prompt in, content out, user drives next step
- Agent — goal in, multi-step plan + tool use, system drives progress
- Overlap — coding copilots may start generative and grow agentic features
What GenAI can and cannot do
Generative models are strong at drafting, transforming, and exploring ideas. They are not reliable sources of truth by themselves. Fluent text can still be wrong, outdated, biased, or unsafe.
- Can: draft emails, summarize, explain code, brainstorm, translate style
- Can: speed up first versions when a human reviews
- Cannot reliably: guarantee facts without grounding or tools
- Cannot: replace evaluation — tests, citations, and domain checks still matter
- Should not: auto-send irreversible actions without confirmation and permissions
Real-world examples
Map each example to Prompt → Model → Output → Check.
- Chat assistants — answer questions and draft messages
- Coding copilots — suggest functions, tests, and refactors in the IDE
- Customer support drafts — propose replies that agents edit and send
- Marketing / design — generate copy variants or concept images
- Education — explain topics at different levels (with teacher review)
- Research helpers — summarize papers; still verify against sources
Program / implementation notes
Most teams start with a hosted model API, wrap it in a UI or service, and add logging plus safety filters. As needs grow, add retrieval, tools, evaluation sets, and eventually agent loops.
Treat the model as an untrusted generator: validate JSON schemas, run tests on generated code, and never put secrets in prompts that get logged carelessly.
- Define input/output contract and failure behavior first
- Version prompts like code; keep an eval set of example cases
- Add RAG when answers must match your docs
- Log prompts/outputs with privacy rules for debugging
- Graduate to tools + agents only after single-turn GenAI is solid
Advantages and limitations
- Advantage: fast drafts and explanations across languages and formats
- Advantage: lowers the cost of first versions for writing and coding
- Advantage: flexible interface — natural language instead of only forms
- Limitation: hallucinations and inconsistent answers
- Limitation: context window and cost limits for long tasks
- Limitation: IP, privacy, and policy risks if data or outputs are mishandled
- Limitation: users may over-trust fluent but wrong results
Key points
- Generative AI creates new content from prompts/context — it does not only classify.
- Core flow: Prompt → Generative model → Output → Check.
- LLMs dominate text/code; diffusion-style models dominate many image tools.
- Discriminative = label/score; Generative = create; hybrids are common.
- Agentic AI often uses GenAI inside a plan–tool–observe loop.
- Always design for verification: facts, tests, permissions, and human review.
FAQs
Is ChatGPT Generative AI?
Yes. It generates text (and related content) from prompts. That is Generative AI. If a product also plans and calls tools to finish goals, it is moving toward Agentic AI.
Is Generative AI the same as Machine Learning?
No. Generative AI is usually built with ML (often deep learning), but ML also includes non-generative tasks like classification and ranking.
Do I need to train my own LLM to use GenAI?
Usually no. Most apps call a pretrained model API, then add prompts, retrieval, UI, and evaluation. Training from scratch is rare and expensive.
Why do models hallucinate?
They generate plausible continuations from patterns, not a guaranteed database lookup. Without grounding and checks, fluent answers can still be false.
Interview questions
- What is Generative AI?
Answer Generative AI creates new content — text, code, images, or audio — from a prompt or context, instead of only classifying existing inputs.
- How is Generative AI different from discriminative AI?
Answer Discriminative models label or score inputs. Generative models produce new samples or sequences. Many products use both together.
- How does a text LLM generate an answer at a high level?
Answer It conditions on the prompt and context, then repeatedly predicts the next token until it stops — forming the reply you see.
- Give two real-world Generative AI examples.
Answer A chatbot that drafts an email, and an IDE copilot that suggests code from comments or partial functions.
- How is Generative AI different from Agentic AI?
Answer GenAI focuses on creating a response. Agentic AI pursues a goal with planning, tools, and feedback loops — often using a generative model inside.
- What is a hallucination and how do you reduce it?
Answer A hallucination is confident but wrong content. Reduce it with clearer prompts, retrieved docs, tool lookups, tests, and human review for high-risk answers.
- What should you put in a good prompt?
Answer Goal, audience, constraints, desired format, and examples when helpful — plus what to avoid. Vague prompts produce vague outputs.
Related topics
Practice task
Complete each numbered practice step in a notebook or doc before opening the next lesson.
- Write a one-sentence definition of Generative AI, then add one text example and one image example.
- Sketch Prompt → Model → Output → Check for a coding copilot.
- List three discriminative vs three generative product features you use.
- Write two prompts for the same task: one vague and one well-specified; note the difference you expect.
- Answer interview questions 1, 5, and 6 in two sentences each (90 seconds each).