CS357: Foundations of AI

Bill Mongan

Welcome to CS357!

About Me

  • Born in Delaware County, PA
  • Upper Darby High School Class of 2000
  • Drexel University Class of 2005; PhD at Drexel in 2018
  • Married in Carmel, CA in 2015

About Me

  • I am a private pilot who loves to travel
  • We love animals and have two cats … plus some occasional visitors!

About Me

  • I use computing (specifically Machine Learning and Signal Processing)…
    • To improve public health
    • To leverage technology to mitigate side-effects and to improve access to care

Our Goals

  • Analyze the ethical implications of AI applications in non-pedagogical campus operations, research, and classroom instruction, using case studies and design justice principles.
  • Design tailored AI-driven tools and prompt-engineering strategies that augment human capabilities while adhering to ethical guidelines.
  • Evaluate the effectiveness of AI systems across different disciplines, identifying best practices and potential risks associated with their use.
  • Create documentation and strategic plans for the responsible deployment of AI technologies in campus operations, ensuring that these plans are both practical and ethically sound.

Our Goals

  • Describe the transformative potential of AI in augmenting human creativity, critical thinking, and decision-making processes across various fields.
  • Apply ethical considerations in AI development and deployment, particularly in preventing biases and ensuring equitable outcomes.
  • Articulate the limitations of AI when used out-of-the-box and the need for careful customization and prompt engineering to achieve desired results.
  • Engage meaningfully in cross-disciplinary collaboration in AI research and application, understanding how insights from different fields can lead to more robust and responsible AI systems.

Class Logistics and Culture

  • Class website and syllabus: http://www.billmongan.com/Ursinus-CS357
  • Challenging but fun!
  • Communicate with me and the TA’s often - we enjoy it.
  • If you know stuff, use it for good to help others!

Welcome: What Is AI, and What Is an Agent?

This course is organized around a single guiding idea: an agent is a system that perceives its situation, plans what to do, and acts toward a goal. We move from intuition → history → a working definition → our first conversation with an agent, and along the way we establish how this class works: in teams, with rotating roles, building things from day one.

How Today Works (no experience assumed)

You do not need to write any code today. Bring curiosity and a laptop; everything we do is either discussion or clicking around a tool together.

  • No setup required now. We install the toolchain together at the Week 1 clinic — nobody debugs Docker alone at midnight.
  • You will use tools before you build them. All semester, every topic arrives twice: first as something you drive, then as something you assemble.
  • Ask the obvious question. If a term is new, say so — the person next to you is wondering too, and naming it is exactly the participation this course grades.

Two Ways Through Every Assignment

Each lab and assignment this semester offers a low-code route and a code route that meet the same learning goal and earn the same credit.

  Low-code route Code route
You work in A visual builder, a CLI, a config file Python you write and test
You still must Explain the design, evaluate the output, disclose AI use The same
Good if You are newer to programming, or want the concepts first You want implementation depth

Choosing low-code is not the easy way out — the evaluation and reasoning are identical, and they are where the grade lives. You may switch routes from one assignment to the next.

Directions and Group Roles

Throughout this course, we work in POGIL-style teams of three or four. Today, choose roles; you will rotate them every class meeting so that everyone practices each role.

  • Manager: keeps the team on task and watches the time.
  • Recorder: writes the team’s answers on the Class Activity Questions discussion board.
  • Presenter: reports the team’s findings to the class.
  • Reflector: notes what helped or hindered the team, and shares one observation at the end.

Consider each model below and answer the questions provided. First reflect on your own briefly, then discuss and compare with your group. After class, respond to the reflective prompt individually in your notebook.

1. A Very Short History of a Very Big Question

Artificial intelligence is older than the computer science department. In 1950, Alan Turing asked whether machines can think, and proposed his famous imitation game as a substitute for that question. The 1956 Dartmouth workshop named the field.

Since then, AI has cycled through eras: symbolic reasoning and search, expert systems, statistical machine learning, deep learning, and now generative models and agents.

1. A Very Short History of a Very Big Question

Each era redefined what counts as intelligence. Chess fell in 1997, Jeopardy in 2011, Go in 2016, and fluent conversation in the early 2020s. Each time, the goalposts moved, a phenomenon sometimes called the AI effect: once a machine can do it, we stop calling it intelligence.

This course enters the story at the agent era. A large language model that only answers prompts is a remarkable artifact, but it is reactive. The systems reshaping work and study today wrap that model in a loop: they observe, decide, call tools, check their own work, and try again. That loop is our subject.

Model 1: Three Systems

Before we look at the data, consider this: every time you ask a navigation app for directions, it perceives your location, plans a route, and acts by showing you the map — and if you miss a turn, it recalculates and tries again.

AI agents work the same way, but instead of roads they navigate information and decisions. The three systems below span a wide range of that idea.

Examine these three systems and decide which, if any, is an agent.

Model 1: Three Systems

System Behavior What It Does When Something Goes Wrong
A A thermostat turns the heat on when the room drops below 68 degrees, and off above 70 degrees. It applies the same fixed rule again — it cannot diagnose a broken furnace or call a repairperson.
B A chatbot answers each question you type, with no memory of the conversation once the window closes. It has no awareness that it gave a bad answer, and takes no follow-up action unless you send another message.
C A program is given the goal “find me three campsites available the weekend of October 10,” browses a reservation website, filters results, and reports back with links. It can retry failed page loads, try alternative search terms, and check availability across multiple sites before reporting.

Model 1: Critical Thinking Questions

  1. For each system, identify what it perceives, what it decides, and what actions it takes.

    Hint: Use the three-column breakdown — perception, decision, action — for each row. For System A, for example, perception is the temperature reading.

  2. Which systems pursue a goal over multiple steps? Which respond once and stop?

    Hint: Ask yourself whether the system would do anything differently if its first response turned out to be wrong or incomplete.

Model 1: Critical Thinking Questions

  1. System A contains no machine learning at all. Can something be an agent without being “AI”? Defend your answer.

    Hint: Look back at the working definition in section 2. Does it say anything about learning, or only about perceiving, deciding, and acting?

Model 1: Critical Thinking Questions

  1. What would System B need in order to behave like System C?

    Hint: Think about what System C has that System B lacks — memory, tools, a goal that persists across steps. List at least two additions.

2. A Working Definition

In this section, you will lock down the formal definition of an agent and place it on a spectrum from simple reflex to fully autonomous — so that every system you encounter this semester has a precise vocabulary to describe it.

An agent is anything that perceives its environment through sensors and acts upon it through actuators in pursuit of a goal (Russell and Norvig). For the software agents in this course:

\[\text{action}_t = \pi(\text{observation}_t, \text{memory}_t, \text{goal})\]

2. A Working Definition

where π is the agent’s policy: the rule, program, or model that maps what the agent knows to what it does next. In the agents we build, π is implemented by a large language model plus the scaffolding we write around it.

Agency is a spectrum, not a switch. A system is more agentic when it takes more steps autonomously, uses more tools, and recovers from more errors without a human in the loop. Greater agency brings greater usefulness, and greater responsibility — which is why governance occupies the final unit of this course.

2. Check Your Understanding

A spam filter classifies each incoming email as spam or not, one message at a time, and takes no further action. According to our working definition, the most accurate description is:

  • It is a fully agentic system because it perceives and acts
  • It exhibits minimal agency: it perceives and acts, but pursues no multi-step goal and uses no tools
  • It is not an agent because it uses machine learning
  • It is not an agent because it has no body

Minimal agency. It perceives and acts, but pursues no multi-step goal and uses no tools. Note that agency and machine learning are separate ideas: a spam filter learned from data yet is barely an agent, while the thermostat in System A uses no AI at all yet pursues a goal continuously.

3. Where We Are Going

The semester unfolds in four units, each building on the last. In Unit 1, Anatomy of an Agent, we build and run our own local agents within the first two weeks. In Unit 2, Foundations on Demand, we open the hood exactly when we need to: embeddings when our agent must search, attention when we wonder how it reads, retrieval when it must cite sources.

In Unit 3, Multi-Agent Systems, we compose agents into teams that critique, debate, and reach consensus. In Unit 4, Responsibility and Governance, we ask who is accountable when agents act, and you will write policy for the agent team you build as your final project.

The AI Fluency Framework

Working well with an AI is a human competency, not just a technical one. This course is organized around The AI Fluency Framework and its four competencies:

  • Delegation — whether, when, and how to engage AI
  • Description — describing goals well enough to prompt useful behavior
  • Discernment — assessing the usefulness of AI outputs
  • Diligence — taking responsibility for what we do with AI

It also names three interaction modes — automation, augmentation, and agency — mapping onto Section 2’s agency spectrum. Before the next activity, read the summary.

Dakan, Feller, and Anthropic, 2025. CC BY-NC-SA 4.0.

The AI Capabilities and Limitations Framework

Delegating well — and, later, discerning good output from bad — depends on a realistic picture of what today’s AI is actually good at. This companion framework names four properties that shape what AI can and can’t do for you. Each sits on a spectrum: the further toward the limitation end your task falls, the more you should verify the output.

Read the table as a checklist for Delegation and Discernment. A task built from common concepts, mainstream knowledge, a short context, and a concrete instruction is a safe delegation. A task in novel territory, on contested facts, over a huge context, and requiring a long chain of reasoning is one to supervise closely — or keep for a human.

The AI Capabilities and Limitations Framework

Property The question it answers Works well (capability) Gets shaky (limitation)
Next Token Prediction Where do AI answers come from? Well-worn paths: summarize, reformat, explain common concepts Novel territory, sparse patterns; “true” vs. “sounds true”
Knowledge What does the AI actually know? Frequent, recent-in-training, consistent: mainstream topics, popular languages Rare, post-cutoff, niche, local, or contested topics
Working Memory What is the AI paying attention to right now? Material fits comfortably, session is current, you supply the relevant context Very long documents/conversations; expecting cross-session continuity (the “cliff”)
Steerability How much am I in control? Short, concrete, verifiable instructions (“respond as a table,” “under 100 words”) Long reasoning chains, abstract asks, native precision

Copyright 2026 Anthropic. Building on the AI Fluency Framework by Prof. Rick Dakan and Prof. Joseph Feller. CC BY-NC-SA 4.0.

Icebreaker: Predict the Next Token

Estimated time: 20 minutes.

Today’s first practice is seeing where AI answers come from. No accounts, no installs — just your team, paper, and the course’s Token Prediction Playground, a tiny next-word model that runs entirely in your browser.

The goal is to feel the top row of the Capabilities and Limitations table — Next Token Prediction — from the inside. Feed it a common phrase and watch it get confident (capability); feed it rare or ungrounded words and watch it shrug (limitation).

Icebreaker: Step 1 — Predict by Hand (7 minutes)

As a team, take these prompt stems (the Manager keeps time; the Recorder writes everything down). For each, every member privately writes the three most likely next words and a confidence (high/medium/low) — before anyone opens the Playground:

  • “The capital of France is ___”
  • “Once upon a ___”
  • “To be or not to ___”
  • “My professor’s favorite ___”
  • “The 2027 Nobel Prize in Physics was awarded to ___”

Compare within the team: where did everyone agree? Where did predictions scatter?

Icebreaker: Step 2 — Compare with the Simulator (7 minutes)

Now type each stem into the Token Prediction Playground and record what it predicts, and how confidently. Score your team against the machine. Watch for the pattern: on well-worn phrases the model is confident and so were you; on rare, personal, or future-facing stems it shrugs — and so, honestly, did you.

Icebreaker: Step 3 — What Prediction Can and Cannot Do (6 minutes)

Discuss as a team, and the Recorder posts your answers to the discussion board:

  • Which stems were easy for both humans and the model, and why? (What makes a continuation “well-worn”?)
  • Which stems cannot be answered by pattern-completion at all, no matter how much text the model has seen? What would a system need instead?
  • If a model always continues with what “sounds right,” when will “sounds true” diverge from “is true”? Name one concrete task where you would therefore verify its output.

Icebreaker: Reflection

  • What surprised you about how well (or poorly) your team predicted the model’s behavior?
  • Where does your own knowledge come from, and how is that different from — or similar to — next-token prediction?
  • Name one task from your own week that next-token prediction alone could handle, and one it could not.

Reflection Prompt

Personal: Before today, what did the word “agent” mean to you — a travel agent, a secret agent, something else? How has today’s definition changed that intuition?

Technical: You now have a formal definition of agency: perceive, decide, act, toward a goal, over multiple steps. If you were designing System B to become more agentic, which capability would you add first and why?

Societal: Identify one task you would delegate to an autonomous agent, and one you never would. What is the difference? If millions of people made the same choices, what decisions would agents be making at scale?

Coming Up Next

→ Coming Up Next: In The Agent Loop: Perceive, Plan, Act activity, we zoom inside the agent loop itself — the repeating cycle of perceive, plan, and act — and we write our first working agent in Python that calls a tool and loops until it finds an answer.

Further Reading

  • Melanie Mitchell. Artificial Intelligence: A Guide for Thinking Humans (2019). Prologue and Chapter 1 frame the questions of this course.
  • Stuart Russell and Peter Norvig. Artificial Intelligence: A Modern Approach (4th ed., 2020). Chapter 2 defines agents and environments.
  • Alan Turing. “Computing Machinery and Intelligence.” Mind (1950). The original imitation game paper, freely available online.
  • Rick Dakan and Joseph Feller, with Anthropic. The AI Fluency Framework (2025). Released under CC BY-NC-SA 4.0.