In the previous modules, you learned the foundational building blocks of modern AI applications:
Module 1 introduced you to Large Language Models (LLMs)—powerful AI systems capable of understanding and generating human language. LLMs excel at reasoning, summarizing, answering questions, and more, but they operate within certain boundaries: they have no persistent memory, cannot access external tools or data, and do not act autonomously.
Module 2 explored the art and science of prompt engineering—the practice of crafting clear, effective instructions to get the best results from LLMs. With strong prompt engineering, you can build surprisingly capable applications using just an LLM, without any additional complexity.
This module builds on your understanding of LLMs and prompt engineering, showing you how to design and build agents that can remember, reason, use tools, and act autonomously—unlocking a new level of capability for your AI applications.
Hands-On Lab: Launch the companion lab notebook
to practice building agentic LLM application. In the lab , you'll build a Personal Assistant ChatBot Agent for the course website that can search course content, generate thoughtful follow-up questions, remember conversation history, and make intelligent decisions about when to use which capabilities.
What You'll Learn
Agent Fundamentals: The key characteristics that define agents
When to use Agents: What makes agents different from Workflow-Based LLM applications
Memory: Types of memory and how agents use them
Tools: How agents use external tools to extend their capabilities — including MCP
Decision Loop: How agents observe, plan, and act in iterative loops
Agent Patterns: Different agent patterns and production considerations
💡Tip: No matter if you're building a simple LLM-powered app or a sophisticated agent system, every successful AI solution depends on clear, well-crafted prompts - even the most advanced agents rely on clear, well-structured prompts to guide the LLM's reasoning and actions.
What is an Agent?
An agent is a system that perceives its environment, reasons about what to do next, and takes actions to achieve a goal. For LLM-powered agents, this translates to:
Perceives → Text inputs, tool results, API responses, memory retrievals
Reasons → LLM decides what to do next based on context and goal
Acts → Tool calls, API requests, generating responses, updating memory
Agency exists on a spectrum — from a simple chatbot that responds to a single message, to a fully autonomous coding agent that opens files, runs tests, debugs errors, and submits a pull request without any human input. Most production agents sit somewhere in the middle, with humans in the loop for key decisions.
Real examples you may already use: Claude Code (autonomous coding agent), GitHub Copilot Agent Mode, Amazon Q Developer, Cursor — these are all agentic LLM applications operating on your codebase.
From LLMs to Agents: Why Go Further?
While LLMs are incredibly versatile, many real-world applications require more than just language understanding. This is where LLM-powered agents come in.
🤖 Agentic LLM application — a software system that wraps an LLM in a decision loop: it observes its environment, uses the LLM's reasoning to decide what to do next, takes an action, and repeats until the goal is achieved. Throughout this module, "agent" refers to this kind of application.
LLM-powered agents extend base LLMs with three capabilities:
Tool Use: Agents can interact with the world by calling external tools, APIs, and services — retrieving information or performing actions beyond text generation.
Persistent Memory: Agents can remember past interactions, user preferences, or facts across sessions — going beyond the context window of a single call.
Decision Loop: The core of every agent — code that runs the LLM in a loop, deciding what to do next at each step, until the goal is reached.
Figure: Core components of an LLM-powered agent. The decision loop is the core; tools and persistent memory extend its capabilities.
What makes an application agentic is the decision loop — the LLM deciding the control flow, not the developer. Tools and persistent memory add capability based on the complexity and use case. Most production agents combine all three, but understanding what the core is helps you start simple and add complexity only when your use case demands it.
The Engineering Challenge: From Prompts to the Decision Loop
While prompt engineering remains important, building agents means you also need to engineer the decision loop itself:
Decision Logic: When should the agent call external tools versus respond using the LLM's training knowledge? How does it choose between multiple tools for the same task?
Error Handling: What happens when a tool call fails or returns unexpected results? How should the agent recover and continue?
Memory Operations: What information should be stored after each interaction? When should past information be retrieved?
Loop Termination: How does the agent know when the task is complete? What prevents infinite loops?
The decision loop design varies dramatically by use case — a research agent needs different patterns than a customer service agent or a coding agent. The engineering complexity lies here, not just in crafting prompts.
Agentic LLM Applications: When Are They Needed?
Not every application needs the complexity of an agent. Many tasks that can be completed in a single step or predefined workflows— like summarization, classification, or Q&A—can be solved with just prompt engineering and a workflow-based approach.
However, agents become essential when achieving your goals requires handling multi-step complex tasks and the workflow cannot be fully specified in advance—demanding adaptive, dynamic decision-making.
Guiding Principles for Using Agents:
Don't Build Agents for Everything: Use agents only for complex, ambiguous, high-value tasks; prefer non-agentic workflows for simple cases.
Keep It Simple: Start with a minimal architecture (environment, tools, prompt); iterate before adding complexity.
The following table compares traditional workflows, LLM workflows, and agentic LLM Workflow based applications to help clarify when each approach is most appropriate.
Dimension
Traditional Workflows
LLM Workflow
Agentic LLM App
Visual
Description
Software systems with predefined logic and workflows
Applications that use LLMs in one or more fixed, code-defined steps—each step may involve an LLM call or tool, but the workflow is predetermined and not dynamically chosen by the LLM.
Systems operating in a loop—observing its environment, using the LLM's reasoning to decide what to do next, and taking actions to achieve its goals
Implementation Complexity
Medium-High (requires specific logic for each task)
Low-Medium (prompt engineering plus predefined integrations)
High (requires orchestration, tool integration, memory systems)
Applications & Examples
Well-defined processes: order processing, data validation, reporting
Tasks solved by running the LLM in one or more fixed, code-defined steps—such as content creation, simple chatbots, text-to-SQL, or multi-step data processing—where the workflow and tool use are predetermined and not dynamically chosen by the LLM.
Complex tasks requiring multiple steps reasoning, external data, or persistent context. Customer service agents, research assistants, automated analysts
Autonomy: Developer vs LLM
The developer is fully responsible for all logic, control flow, and decision-making. The system follows code paths exactly as written.
The developer still defines the overall workflow and control flow, but the LLM may be used for reasoning or generation within those steps. The LLM does not decide what step comes next.
The LLM (within the agent) participates in or even drives the control flow, making decisions about which tools to use, when to use them, and how to proceed, based on the current context and goal. The developer provides the environment, tools, and guardrails, but the LLM has autonomy within those constraints.
Reactivity
Responds to specific triggers and data changes
Responds to user prompts with enhanced context
Responds to environmental changes and adapts strategy accordingly
Pro-activeness
Follows predetermined paths without initiative
Reactive within single interactions, no cross-session initiative
Takes initiative to pursue goals across multiple steps and sessions
Social Ability
Structured interactions with predefined interfaces
Natural language conversation with enhanced responses
Multi-turn dialogue with context awareness and goal persistence
Tool Integration
Pre-programmed connections to specific systems
Predefined tool usage (RAG integrations, LLM output as tool input)
LLM decides which tools to use; orchestrated tool selection with feedback loops
Memory Management
Database-driven with explicit schema design
Context window concatenation (limited to context window size)
Persistent across sessions with both short and long-term storage
Reasoning Process
Linear, rule-based or algorithmic
Single-step or multi-step reasoning per interaction (may use CoT, ToT, ReAct within prompts)
Multi-step reasoning across interactions with planning and feedback loops
Example: Document Extraction
Traditional Workflow: Extracts fixed fields from one type of document that always follows the same structure (e.g., always pulls "Name" and "Date" from a standard lease form).
LLM Workflow: Can flexibly extract different fields based on the prompt, but still processes one document at a time and does not adapt its process or use external tools.
Agentic Workflow: Can interact with tools to translate documents, convert between different document types, and extract relevant fields—even adapting its approach based on the document's structure or missing information.
LLM Workflow (Single-Step)
This code sends a prompt to a language model to extract specific fields from a lease document in a single step. It highlights how prompt engineering alone enables flexible information extraction without any additional logic or memory.
import boto3
import json
# Set up Bedrock client
bedrock = boto3.client("bedrock-runtime", region_name="us-east-1")
def extract_fields(document):
prompt = (
"Extract the following fields from this lease document: Tenant Name, Lease Start Date, Rent Amount.\n\n"
f"Document:\n{document}\n\nFields:"
)
body = json.dumps({
"prompt": prompt,
"max_tokens_to_sample": 200,
"temperature": 0
})
response = bedrock.invoke_model(
modelId="us.amazon.nova-pro-v1:0",
body=body
)
result = json.loads(response["body"].read())
return result["completion"].strip()
# Example document
doc = "This lease is made between John Doe and ACME Corp. Lease starts on 2024-07-01. Monthly rent is $2,500."
# Run the extraction
result = extract_fields(doc)
print(result)
Agentic LLM Application
This code first checks if a lease document is in English or Spanish, then uses a single prompt to instruct the language model to translate to English if needed and extract key fields. It illustrates how an agent can handle multilingual input and autonomously solve a multi-step task by leveraging LLM reasoning and prompt design.
import boto3
import json
# Define your tools
def translate_to_english(text):
# Dummy translation for demo; in real use, call an API or LLM
if "Este contrato" in text:
return "This lease is made between John Doe and ACME Corp. Lease starts on 2024-07-01. Monthly rent is $2,500."
return text
def extract_fields(text):
# Dummy extraction for demo; in real use, call an LLM
if "John Doe" in text:
return "Tenant: John Doe, Start Date: 2024-07-01, Rent: $2,500"
return "Fields not found"
# Build prompt for Claude
# Tool registry
TOOLS = {
"translate_to_english": translate_to_english,
"extract_fields": extract_fields,
}
# Bedrock client
bedrock = boto3.client("bedrock-runtime", region_name="us-east-1")
def call_claude(prompt):
body = json.dumps({
"prompt": prompt,
"max_tokens_to_sample": 200,
"temperature": 0
})
response = bedrock.invoke_model(
modelId="us.amazon.nova-pro-v1:0",
body=body
)
result = json.loads(response["body"].read())
return result['content'][0]['text'].strip()
def agent_decision_loop(document):
history = []
while True:
#Build prompt for Claude
prompt = (
"Your goal: Extract the tenant name, lease start date, and rent amount from the provided lease document. "
"If the document is not in English, translate it to English first.\n\n"
"You are an agent that can use the following tools:\n"
"- translate_to_english(text): Translates text to English if needed.\n"
"- extract_fields(text): Extracts tenant name, lease start date, and rent amount from an English lease document.\n\n"
f"Document: {document}\n"
f"History: {history}\n"
"What should you do next? Reply with:\n"
"Action: '<'tool_name'>'\n"
"Action Input: '<'input'>'\n"
"or\n"
"Final Answer: \n"
)
output = call_claude(prompt)
print("Claude Output:", output)
if output.startswith("Final Answer:"):
return output[len("Final Answer:"):].strip()
elif output.startswith("Action:"):
lines = output.splitlines()
action = lines[0].split(":", 1)[1].strip()
action_input = lines[1].split(":", 1)[1].strip()
result = TOOLS[action](action_input)
history.append({"action": action, "input": action_input, "result": result})
document = result # For this simple example, update document for next step
else:
return "Agent did not understand what to do."
# Example usage
spanish_doc = "Este contrato de arrendamiento es entre John Doe y ACME Corp. Comienza el 1 de julio de 2024. La renta mensual es de $2,500."
print(agent_decision_loop(spanish_doc))
Memory: Retaining and Utilizing Information
What is Memory in AI Agents?
Memory enables an agent to remember, reason, and act based on past interactions, knowledge, and goals. For chatbots and digital agents, memory is essential for holding context, learning from conversations, and improving over time.
Analogy: Just as people remember recent conversations, facts, and how to perform tasks, agents use different types of memory to be helpful and context-aware.
Memory Types in Language Agents
1. Working Memory: What the agent is thinking about right now
Definition: Working memory is the agent's "active desk"—it holds all the information the agent needs right now to make decisions and respond. This includes:
Note: Working memory may include all or just some of these components, depending on the agent and the task.
Working memory = the context window. When you send a request to an LLM, everything in the context window is the agent's working memory for that cycle — the system prompt, conversation history, retrieved facts, tool results. The orchestration layer decides what to pack into the context window each turn; that collection is what the LLM "sees" and reasons over. Understanding this helps you think about memory as a resource to manage, not an unlimited scratchpad.
Key Points:
Working memory is refreshed every iteration of the decision loop (e.g., each time the agent responds)
It is the main input to the LLM for generating a response
After the LLM responds, new information (actions, decisions, updated goals) is stored back in working memory for the next cycle
Analogy: Like having all the notes and materials you need on your desk while working on a task — everything you need right now is in front of you. The desk has limited space, so you choose carefully what to keep out.
2. Long-Term Memory: What the agent has experienced before and knows as facts
Long-term memory is where the agent stores information it may need in the future, even after the current conversation or task is over. It has two main types:
Type
Description
What it Stores
Example in Chatbots/Agents
Episodic
Recall what happened in previous chats or tasks
Specific experiences and events
Past conversations, user preferences, previous actions taken
Semantic
Lookup facts or knowledge to answer questions or make decisions
General knowledge and facts
Company policies, product info, FAQs, world knowledge
Tip: Vector databases—such as Pinecone, FAISS, Amazon Kendra and PostgreSQL with pgvector—are commonly used to implement long-term or semantic memory in modern AI agents, enabling fast retrieval of relevant information based on meaning. For more on choosing a vector database for AI use cases, see the AWS Prescriptive Guidance on vector databases.
Analogy: Episodic memory is like your chat history or diary; semantic memory is like your personal wiki or knowledge base.
3. Procedural Memory: How the agent knows what to do and how to do it
Procedural memory is how the agent knows what to do and how to do it.
Implicit procedural memory: The skills and reasoning built into the LLM itself, encoded in the model's weights.
Explicit procedural memory: The agent's code, prompt templates, and programmed workflows (e.g., how to escalate a support ticket, how to call an API).
Key Points:
Procedural memory is set up by the agent designer (the developer).
It can be updated, but changes must be made carefully to avoid bugs or unintended behavior.
Analogy: Implicit is like knowing how to ride a bike; explicit is like following a recipe or checklist.
How These Memories Work Together
Working memory is the "hub" for each decision: it brings in the current message, retrieves relevant info from long-term memory, and uses procedural memory to decide what to do.
Episodic and semantic memory are "archives" the agent can search for relevant past events or facts.
Procedural memory is the "how-to manual" and skillset the agent uses to act.
Memory Architecture Visualization
This diagram shows how working memory, long-term memory (episodic and semantic), and procedural memory interact in a language agent. Working memory is the central workspace, connecting the agent's reasoning, actions, and memory systems.
User: "Last time I chatted, you gave me a troubleshooting tip. What was it?"
Agent's working memory: Holds the current question and user ID.
Agent's episodic memory: Retrieves the specific advice or troubleshooting tip given in the previous conversation with this user.
Agent's semantic memory: Knows general troubleshooting procedures and device information.
Agent's procedural memory: Uses a programmed workflow to guide the user through troubleshooting steps.
Memory Type Breakdown:
Episodic memory: "In your last chat, I suggested you restart your router."
Semantic memory: "Restarting the router is a common fix for connectivity issues."
Procedural memory: The step-by-step process the agent uses to walk the user through restarting the router.
Tools: Extending the Agent's Capabilities
2.1 Tools: Extending the Agent's Capabilities
What Are Tools in the Context of AI Agents?
Tools are specialized functions that enable AI agents to perform specific tasks beyond text generation, connecting them to external systems and capabilities. They serve as the interface between an agent's decision-making capabilities and the real world.
Key Analogy: An LLM is like a brain, and tools are its limbs and senses - they allow the agent to interact with and perceive the world around it.
Why Tools Are Essential for Agent Capabilities
LLMs have four key limitations that tools help overcome:
Knowledge Cutoff: LLMs only know information they were trained on
Data Manipulation: LLMs struggle with complex calculations
External Interaction: LLMs can't access current information or systems
Verification: LLMs can't verify outputs against real-world data
Tools transform a passive text generator into an active agent by providing:
Real-time information access
Computational capabilities
External system integration
Output verification mechanisms
2.2 Types of External Environment Interactions
Interaction Pattern
Description
When to Use
Example
Direct Function
Agent executes local functions
Simple operations with no external dependencies
Calculator, text formatting, local data processing
External API / MCP
Agent connects to APIs or MCP servers
Real-time data, integrations, or external actions
Weather API, Slack, GitHub, database queries via MCP
Database Retrieval
Agent queries databases for information
Working with persistent structured data
Customer records, product catalogs, transaction history
Code Execution
Agent generates and runs code
Complex computational tasks requiring flexibility
Data analysis, test execution, algorithm implementation
Computer Use
Agent controls a browser or desktop UI directly
Automating tasks that lack an API (legacy UIs, web scraping)
Filling forms, navigating web apps, visual QA testing
Human Interaction
Agent collaborates or escalates to a human
Tasks requiring judgment, approval, or clarification
Escalating support tickets, requesting user input, human-in-the-loop review
MCP: The Standard for Agent Tool Connectivity Model Context Protocol (MCP), released by Anthropic in late 2024, has quickly become the standard protocol for connecting agents to external tools and data sources. Instead of writing custom integration code for each tool, agents discover and call MCP servers — which expose tools, resources, and prompts over a standard interface. AWS Bedrock AgentCore, LangChain, and most major agent frameworks now support MCP natively. We cover MCP in depth in Module 5.
2.3 Key Principles for Building Agent Tools
Building effective tools for AI agents requires careful consideration of how agents interact with and understand tools. Here are five key principles:
1. Speak the Agent's Language
Design your tool description in clear natural language that helps the agent understand exactly when and how to use it.
❌ "API for meteorological data retrieval"
✅ "Get current weather conditions for any location by city name or zip code"
2. Right-Size Your Tools
Create tools that do one job well, not too granular (requiring too many calls) or too broad (causing confusion about purpose).
❌ Generic "DatabaseTool"
✅ Specific tools like "CustomerLookup" and "OrderHistory" with clear, distinct purposes
3. Structure for Success
Design inputs and outputs to make the agent's job easier, with intuitive parameter names and results formatted for easy reasoning.
❌ Generic parameters like "input1" and "input2"
✅ Descriptive parameters like "sourceText" and "targetLanguage"
4. Fail Informatively
Return helpful error messages that guide the agent toward correction rather than confusion.
❌ "Error 404"
✅ "Location 'Atlantis' not found. Please provide a valid city name or zip code"
5. Prevent Hallucinations
Provide factual, verifiable outputs that reduce the likelihood of the agent making things up.
❌ Empty results that might lead to invented details
✅ "No information available about product XYZ-123"
Decision Loop: Observe, Plan, and Act
In agentic LLM applications, the decision loop is key: the agent coordinates memory, tool use, and LLM reasoning within each iteration.
The agent actively manages when to retrieve context, when to call tools, and when to leverage the LLM for reasoning or generation.
This loop enables adaptive, multi-step workflows and robust integration with external systems.
What is the Decision Loop?
This diagram illustrates how, at each cycle, the agent observes all available context, decides the best next step, and takes action—repeating until the goal is achieved.
The Agentic Decision Loop: What Happens at Each Step? 1. Observes working memory which may include user input (latest message or command), recent conversation history, relevant memory (episodic, semantic, preferences), current environment state (results from API calls, databases queries etc.), and available tools/actions. 2. Plans next step to take based on what was observed, available tools and the current goal. Some Examples: Which tool(s) or action(s) to use next, what information to retrieve or store, how to structure the next prompt or response, whether to ask for clarification, proceed, or escalate, and how to handle errors or ambiguity. 3. Act on the plan by generating a response, calling a tool/API/external system, store or retrieve information from memory, ask clarifying questions, escalate to a human or another agent, or update internal state/goals.
Step
What the Agent Does
Observe
Observes working memory user input, context, memory, environment, and available tools
Plan
plans next step to take based on what was observed, available tools and the current goal
Act
Responds, calls tools/APIs, updates memory, asks questions, escalates, updates state
Modern Models and Autonomous Tool Use
Today's frontier models (Claude Sonnet 4, Claude Opus 4, Amazon Nova Pro) are trained specifically for agentic tool use. Rather than needing explicit step-by-step instructions, they can autonomously decide which tool to call, when to call it, and how to interpret the result — all within a single iteration of the decision loop. This shifts the developer's job from scripting tool calls to defining the right tools, guardrails, and success criteria.
You don't strictly need a library to build an agent—at its core, an agent is a software system that manages memory, tool use, and decision logic around an LLM. However, building a robust agent from scratch can be complex and time-consuming.
Popular frameworks and runtimes:
LangGraph (Python, JS): Graph-based framework for building stateful, multi-step agentic workflows. Now the recommended approach over basic LangChain chains for production agents.
CrewAI: Multi-agent collaboration and role-based workflow orchestration.
AutoGen (Microsoft): For building multi-agent and tool-using systems with human-in-the-loop support.
AWS Strands Agents: Open-source Python SDK from AWS for building agents with native Bedrock and MCP integration. Designed for AWS-native deployments.
Amazon Bedrock AgentCore: Managed production runtime for agents on AWS — handles memory, MCP gateway, tool registry, guardrails, and observability. Takes an agent from prototype to production without managing infrastructure.
🛠️Note: These frameworks reduce boilerplate and provide production-grade components (retries, logging, memory, tool registries). That said, evaluate carefully — for simpler agents, a lightweight custom loop may be easier to debug and maintain than a full framework.
Example (Customer Support Chatbot)
Observe: The user asks, "What's my order status?"
Plan: The agent checks its memory for recent orders, decides it needs up-to-date info, and chooses to use an external tool (API) to fetch the order status.
Act: The agent retrieves the status and replies, "Your order is out for delivery and should arrive today."
The agent then updates its memory with this interaction, ready for the next question.
Agent Patterns
Agentic LLM applications can be implemented in various ways depending on the application needs. Here are some of the patterns you'll encounter:
Pattern
Description
Best For
Example
Conversational Agents
One agent handles multi-turn conversations with users
Customer service, personal assistants, Q&A systems
ChatGPT-style interfaces, support chatbots, coding assistants etc.
Task-Oriented Agents
Designed to complete specific workflows or objectives, including those requiring interaction with browsers, desktop applications, or system interfaces. Computer use agents can control a browser or desktop UI directly — no API required.
Automated analysis, report generation, document handling, web automation, coding tasks
Coding agents (Claude Code, Cursor, GitHub Copilot Agent Mode), market research agent, web scraping agent
Multi-Agent Systems
Multiple specialized agents collaborate on complex tasks
Complex workflows requiring different expertise areas
Research team (data gathering, analysis, reporting)
Human-in-the-Loop Systems
Require human approval for key decisions or actions
High-stakes decisions, regulated environments, building trust
In this module, you learned how modern AI agents are designed to go beyond simple text generation. You explored:
The fundamentals of what makes an AI agent, including the importance of memory, tools, and the decision loop
How agents use different types of memory (working, episodic, semantic, procedural) to remember, reason, and act
The various ways agents interact with external environments using tools and integration patterns
The decision loop that enables agents to observe, plan, act, and learn—mirroring the way human knowledge workers handle tasks
The importance of separating the agent's decision loop logic from the LLM's language and reasoning capabilities, and how frameworks like LangChain, CrewAI, and others can help you build robust, production-ready agents
By understanding these concepts, you're now equipped to design and build AI agents that can autonomously assist, augment, or automate knowledge work in digital applications.
Resources
Core Reading
Building Effective Agents — Anthropic Engineering Blog anthropic.com — Practical advice, best practices, and design patterns including when to use workflows vs. agents. Start here.
How We Build Effective Agents — Barry Zhang, Anthropic YouTube — Companion talk with practical implementation insights from an Anthropic engineer.
CoALA: Cognitive Architectures for Language Agents arXiv — Academic framework for memory types (working/episodic/semantic/procedural) in language agents.
AWS / Bedrock
Amazon Bedrock AgentCore aws.amazon.com — Managed runtime for production agents on AWS: memory, MCP gateway, tool registry, guardrails, observability.
Amazon Bedrock Agents aws.amazon.com — Fully managed agent builder with multi-agent collaboration, knowledge bases, and guardrails.
AWS Strands Agents SDK GitHub — Open-source Python SDK from AWS for building agents with native Bedrock and MCP integration.
Frameworks
LangGraph langgraph docs — Graph-based framework for stateful, multi-step agentic workflows. Recommended for production agents over basic LangChain.
CrewAI GitHub — Multi-agent collaboration and role-based workflow orchestration.
Microsoft AutoGen GitHub — Framework for multi-agent and tool-using systems with human-in-the-loop support.
Concept Check Questions
1. Memory: Which memory type is responsible for remembering the details of a user's last support ticket?
A) Episodic memory
B) Semantic memory
C) Procedural memory
D) Working memory
Answer: A) Episodic memory stores specific past experiences and events — like a previous conversation or support ticket. Semantic memory stores general facts; procedural memory stores how to do things; working memory holds what the agent is actively thinking about right now.
2. Agents vs LLMs: What is the primary difference between a base LLM and an AI agent?
A) LLMs are less capable at language understanding than agents
B) Agents do not use language models internally
C) LLMs can use tools but agents cannot
D) Agents actively take actions, use tools, and operate in a loop to achieve goals — a base LLM only generates text in response to a prompt
Answer: D) A base LLM is reactive — it responds to one prompt and stops. An agent wraps the LLM with a decision loop, memory, and tool access so it can take multi-step actions toward a goal.
3. Autonomy: True or False — AI agents are always fully autonomous and never require human intervention.
A) True
B) False
Answer: B) False. Agency exists on a spectrum. Most production agents include human-in-the-loop checkpoints for high-stakes decisions, and "fully autonomous" agents are the exception rather than the rule.
4. Application Tiers: Which capability is the defining characteristic that separates agentic applications from single-step and workflow-based LLM applications?
A) Ability to generate longer responses
B) Access to a larger training dataset
C) The LLM dynamically decides the control flow — which tools to call, when to retrieve memory, and when the task is done
D) Ability to generate images from text
Answer: C) In single-step and workflow-based applications, the developer defines every step in code. In agentic applications, the LLM itself participates in deciding what happens next — making it adaptive to situations the developer didn't anticipate.
5. Decision Loop: You ask a coding agent to "fix the failing tests in my repo." Which sequence correctly describes its decision loop?
A) The agent generates a response immediately without reading any files
B) The agent asks a human to decide what to fix first
C) The agent reads the test output (Observe), decides which file to edit (Plan), makes the edit and re-runs tests (Act), then repeats until all tests pass
D) The agent runs once and stops regardless of the test results
Answer: C) This is the Observe → Plan → Act loop in action. The agent iterates until the goal is achieved — a key difference from a one-shot LLM call.