03. Core Components
Large Language Models (LLMs)
Large Language Models (LLMs) are the reasoning engines behind most Agentic AI systems. They turn context into plans, text, and tool calls — but they are not the agent by themselves.
What you will learn
- Define what an LLM is in plain language
- Explain the LLM’s role inside an agent loop
- List strengths and limits that drive agent design
- Place the model among prompts, memory, tools, and guardrails
- Answer interview questions with short, solid answers
Definition
A Large Language Model is a neural network trained on vast text (and often code/multimodal data) to predict the next token. From that simple objective emerge skills like answering, summarizing, coding, and following instructions.
In Agentic AI, the LLM is usually the policy brain: given a prompt and context, it produces a reply or structured tool call. Memory, retrieval, tools, orchestration, and guardrails turn that brain into a reliable agent.
Introduction
This lesson opens Module 03 (Core Components). Module 02 covered agent types and architecture. Now we zoom into the model layer every modern agent leans on.
Later lessons cover prompts, planning, memory, and tool calling — the subsystems that make LLM agents work in production.
Why LLMs matter for agents
- Flexible reasoning over messy natural-language goals
- Native fit for tool/function calling APIs
- Fast iteration via prompts instead of hand-written rules only
- Transfer across domains with the same stack pattern
How an LLM works (agent-relevant view)
You do not need transformer math to ship agents, but you do need the operational model.
- Input - tokens from system prompt, user message, memory, tool results
- Inference - model samples or greedily picks next tokens
- Output - natural language and/or structured tool-call JSON
- Stochasticity - temperature and sampling affect reproducibility
- Context window - hard limit on how much the model can see at once
Strengths and limits
Design the agent around both sides. Tools fix what text prediction cannot.
- Strong - language, code drafts, plan sketches, classifying intent
- Strong - choosing among declared tools from schemas
- Weak alone - up-to-date or private facts not in context
- Weak alone - guaranteed correctness; can hallucinate confidently
- Weak alone - executing actions; needs a tool runtime
Where the LLM sits in the agent stack
Never ship a naked chat completion as “the agent.” Surround the model with contracts.
- Prompts / context builder - what the model sees
- Orchestrator - loop, retries, routing, stop conditions
- Memory / RAG - extend beyond the raw window
- Tool runtime - execute proposed actions with authz
- Guardrails + logs - policy, budgets, evals, audit
LLM choices for agents
- Capability vs cost/latency - use stronger models for hard plans; smaller for routers
- Tool-calling quality - prefer models strong at structured function calls
- Context window - long workflows need packing or summarization
- Hosting - API vs self-host; data residency and rate limits
- Multimodal - needed only if perception includes images/audio
From GenAI chat to LLM agent
A chatbot completes one turn of text. An LLM agent repeatedly: builds context, calls the model, optionally executes tools, observes results, and continues until the goal or a stop rule.
- Same model family; different control loop
- Success measured by task completion, not only fluent text
- Must handle tool errors and partial observations
Program / implementation notes
Treat the LLM as an untrusted planner: validate tool names/args, cap tokens, and log every call.
- Use structured outputs / tool schemas instead of free-form parsing when possible
- Separate system instructions from untrusted user/tool text
- Cache stable prompt prefixes where the provider supports it
- Eval prompts and models on agent tasks, not only chat benchmarks
- Next: Prompts, System Prompts and Context Management
Advantages and limitations
- Advantage: general reasoning without hand-coding every branch
- Advantage: natural interface to goals and tool schemas
- Advantage: rapid product iteration via prompts and evals
- Limitation: hallucinations and brittle long plans
- Limitation: cost and latency in multi-step loops
- Limitation: non-determinism complicates testing
Key points
- LLMs predict tokens; agents add goals, tools, memory, and a loop.
- The model proposes actions; the runtime executes them under policy.
- Context windows and hallucinations force retrieval, tools, and checks.
- Surround the LLM with orchestrator, memory, tools, and guardrails.
- Pick models for tool-calling quality, cost, and latency — not hype alone.
- Chat completion ≠ agent; the control loop is the difference.
FAQs
Is ChatGPT an agent?
The base chat product is mainly GenAI conversation. It becomes agent-like when it can call tools in a loop toward a goal with orchestration and permissions.
Do I need the largest model for agents?
Not always. Many systems use a strong model for planning and a smaller/cheaper model for routing or simple steps.
Why do agents still fail if the LLM is smart?
Because failures often come from bad context, weak tools, missing stop rules, or no verification — not only from model IQ.
What is tool calling?
A mode where the model emits structured function calls (name + arguments) that your runtime executes, then feeds results back into the next model turn.
Interview questions
- What is a Large Language Model?
Answer A neural model trained to predict the next token on large text corpora, which enables instruction following, reasoning, coding, and dialogue.
- How do LLMs power AI agents?
Answer They act as the policy brain that interprets goals and context, then proposes replies or tool calls inside an observe–think–act loop.
- Why is an LLM not sufficient as an agent by itself?
Answer It cannot reliably access live/private data or execute side effects alone; agents need tools, memory, orchestration, and guardrails.
- What limits matter most when using LLMs in agents?
Answer Context window size, hallucinations, non-determinism, latency/cost, and weak performance without good tools and retrieval.
- Where does the LLM sit in agent architecture?
Answer Inside the reasoning/policy layer, wrapped by prompts, memory, an orchestrator, a tool runtime, and safety controls.
- Chatbot vs LLM agent?
Answer A chatbot mainly returns text for a turn. An LLM agent loops with tools and state until a goal or stop condition is met.
- How would you choose an LLM for an agent product?
Answer Score tool-calling quality, reasoning on your tasks, context needs, latency, cost, and compliance — then validate with agent evals.
Related topics
Practice task
Complete each numbered practice step in a notebook or doc before opening the next lesson.
- Write a two-sentence definition of an LLM vs an LLM agent.
- Draw context in -> LLM -> reply/tool call -> orchestrator execute.
- List three strengths and three limits that change your agent design.
- For a support agent, note which facts must come from tools/RAG, not the model alone.
- Answer interview questions 1, 3, and 6 in two sentences each.