TDM 19000: Week 3 Questions — Summer 2026

Overview About Single Agent Models

Project Objectives

Motivation: Large Language Models (LLMs) can generate text, but many tasks require them to interact with external systems, and to make decisions based on available information. AI agents extend what LLMs can do by allowing the model to use tools, follow workflows, and complete tasks on behalf of users.

Context: In this project, students will build a single-agent system using LangGraph, LangChain, Ollama, and a customer order dataset. Students will create tools, design agent workflows, connect the agent to a dataset, and implement safeguards to ensure the agent follows set rules.

Scope: AI agents, LangGraph, LangChain, tool calling

Learning Objectives
  • Understand the purpose and workflow of a single-agent system.

  • Build agent workflows using LangGraph and state-based execution.

  • Connect an agent to an external dataset.

  • Set rules for agent behavior to ensure reliability.

Dataset

  • /anvil/projects/tdm/data/orders/Superstore_modified.csv

Question 1

In the graph.py file, consider the call_model:

In the prompt where it says: You are an ecommerce support agent please change this to a prompt that gives the ecommerce support agent a personality, for instance, an attitude of humbly helping the customer, or an impatient customer service agent, or a support agent that is long-winded and likes to give wordy responses, etc.

Question 2

Also in the graph.py file, consider the call_model:

To the current set of rules, add two rules of your own choosing.

Question 3

After setting up version 1 of the three Python files, run the tests in the file:

and show the outputs.

Question 4

After setting up version 2 of the three Python files (and remembering to use graph = construct_graph() to reconstruct the graph with these updates), run the tests in the file:

and show the outputs.

Question 5

Using version 2 of the three Python files, run the command:

myDF['Order Status'].value_counts()

at the start of version 2, and also after successfully cancelling at least one order.

Question 6

After setting up version 3 of the state.py and graph.py Python files (and remembering to use graph = construct_graph() to reconstruct the graph with these updates), run the tests in the file:

and show the outputs.

Question 7

Using version 3 of the three Python files, explain (using a few sentences in English) how the agent handles order cancellation requests.

Question 8

After setting up version 4 of the tools.py and graph.py Python files (and remembering to use graph = construct_graph() to reconstruct the graph with these updates), run the tests in the file:

and show the outputs.

Question 9

Many companies are using agent-based models for customer service requests. Write two paragraphs in English about your understanding about customer service requests that rely on prompts, rules, tools, and may have potential failures and hallucinations. For instance, are such changes are automations good or bad, and why? Please comment on your views related to the integration of such tools, your opinion about their potential to aid economic development and potentially to improve customer service? What are your opinions of single agent-based models, now that you see how they work behind the scenes?

Question 10

Agent-based models need governance, checks, rules, appropriate handling of potential hallucinations and mistakes, etc. Please comment on your opinion about ethics and compliance issues, related to the pervasive usage of such tools. What strengths and weakness do you perceive? What are your perceptions about the potential needs related to governance, guiderails, and ethical usage of such tools?

Submitting your Work

Once you have completed the questions, save your Jupyter notebook. You can then download the notebook and submit it to Gradescope.

Items to submit
  • firstname_lastname_week3.ipynb

You must double check your .ipynb after submitting it in gradescope. A very common mistake is to assume that your .ipynb file has been rendered properly and contains your code, markdown, and code output even though it may not. Please take the time to double check your work. See here for instructions on how to double check this.

You will not receive full credit if your .ipynb file does not contain all of the information you expect it to, or if it does not render properly in Gradescope. Please ask a TA if you need help with this.