Skip to content
Series
19 posts

Reading Stanford CS329Z Engineering AI Agents

A self-study guide to Stanford CS329Z Fall 2026, one post per lecture: page-linked guides to the eleven released slide decks and digests of each lecture's readings, from agent loops, memory and coordination to evaluation, safety and proactive assistants.

Series guide

Engineering AI Agents: Building an Agent Harness from One Chat-Completion Call, No Frameworks | Stanford CS329Z Course Overview

CS329Z is Stanford's course on engineering AI agents: you first build RAG, tool use and the agent loop by hand without frameworks, then see what frameworks like DSPy abstract away; the two assignments are building an agent harness and designing an agent evaluation. The syllabus, the assigned readings, the first eleven slide decks, and the starter code, data and public tests for Assignment 1 are available; the recordings require an enrolled Canvas login.

Hand-Build Your First RAG: From Chunking to Agent-Decided Retrieval | Stanford CS329Z Lecture 3

Lecture 03 starts from the project question and works through RAG's motivation, chunk boundaries, approximate vector search, BM25 / dense / hybrid / rerankers, and letting the agent decide when to retrieve. The assigned Lewis et al. RAG paper and ColBERT add the original recipe and late interaction.

Tell Workflows from Agents, Then Learn to Think While Acting | Stanford CS329Z Lecture 6

Lecture 06 compares workflows with agents: five composable workflow patterns, reasoning-and-acting patterns such as ReAct, Reflexion, CodeAct and ReWOO, and context-management techniques such as event logs, compaction, observation masking and context isolation, with the Pi harness as a case study. The assigned ReAct paper and Anthropic's Building Effective Agents each supply half the picture.

Make Agents Remember What Matters: MemGPT, Letta, Mem0, and Generative Agents | Stanford CS329Z Lecture 7

Lecture 07 sorts agent memory into working, episodic, semantic and procedural types, compares skill libraries, MemGPT-style tiers, reflective consolidation and memory maintenance, and covers memory benchmarks plus forgetting, privacy and over-personalization. The readings run from MemGPT's virtual memory to Letta, Mem0 and Generative Agents.

Go Solo or Call a Meeting: Division of Labor, Communication, and Failure in Multi-Agent Systems | Stanford CS329Z Lecture 8

Lecture 08 first asks whether a single agent is enough, then compares orchestrator, swarm and hybrid patterns, communication through handoffs, message boards and A2A, and coordination infrastructure such as task ledgers, shared memory and worktree isolation, before tracing why multi-agent systems fail. The readings run from AutoGen to MAST, the single-agent counterargument and DyLAN.

Change the Prompt, the Weights, or Think Longer: Three Axes of Agent Optimization | Stanford CS329Z Lecture 9

Lecture 09 asks when optimization pays off, then compares context optimization (bootstrapped few-shot, MIPROv2, OPRO, TextGrad, GEPA), weight optimization (SFT, PPO, GRPO, on-policy distillation), and agents as optimizers. The readings cover test-time compute, GEPA, BetterTogether and MIPRO, ending with three things to do before HW1 is due.

After the Agent Says Done, Verify It: The Terminal-Bench Guest Lecture | Stanford CS329Z Lecture 10

Lecture 10 is a guest lecture by Terminal-Bench co-creators Ryan Marten and Alex Shaw on evaluating agents in terminal environments: how to write tasks, how verifiers check the final state, and how task versions and the Harbor harness are managed. The assigned Terminal-Bench paper adds the benchmark's design and results.

What Data Do Agents Need? Traces, Demonstrations, Feedback, and the Data Flywheel | Stanford CS329Z Lecture 11

Lecture 11 lays out the forms and sources of agent data: traces, demonstrations and feedback, data for optimization versus evaluation, data flywheels, synthetic data and data from human-agent interaction, with a warning that data can teach models unintended shortcuts. The readings are Shankar's data flywheel essay and a survey of LLMs for data annotation and synthesis.

More Data Is Not Always Better: Selection, Validation, and Quality | Stanford CS329Z Lecture 12

Per the schedule, Lecture 12 covers finding maximally informative data, filtering and selection, tiny-but-targeted benchmarks, annotation practice, quality assessment and building datasets from agent traces. SWE-smith shows how to scale software-engineering task data, Who Validates the Validators covers aligning LLM grading with humans, and LIMA shows what a small high-quality dataset can do.

Let a Model Judge: Grader Choice, Judge Bias, and Calibration | Stanford CS329Z Lecture 14

Per the schedule, Lecture 14 covers the three grader types, judge prompt design, known biases, pairwise versus pointwise evaluation, non-determinism metrics such as pass@k and pass^k, harness design and Anthropic's eight-step roadmap. The readings run from Demystifying Evals and MT-Bench to AutoMetrics and AutoLibra.

Put Guardrails on the Agent: Privacy, Prompt Injection, Sandboxes, and Permissions | Stanford CS329Z Lecture 15

Per the schedule, Lecture 15 covers privacy risks from tool access, prompt injection including indirect injection, red-teaming, sandboxing and permission models, output guardrails, liability, responsible deployment and human-in-the-loop patterns. The readings run from PrivacyLens's leakage in action to simulated privacy-risk search, deanonymization, contextualized privacy defense, prompt injection and the Responsible Scaling Policy.

For a Coding Agent, Build a Good IDE First | Stanford CS329Z Lecture 17

Per the schedule, Lecture 17 covers how coding agents work end to end: the SWE-agent, Claude Code and OpenHands architectures, scaffolds as design decisions, SWE-bench and the 4-tuple framework in practice, and the future of software development. The readings cover SWE-agent's ACI, OpenHands's event-stream sandbox, Claude Code practice, long-running harnesses and SWE-bench.

From Waiting for Instructions to Acting First: Proactive Agents and General User Models | Stanford CS329Z Lecture 18

Per the schedule, Lecture 18 covers the move from reactive to proactive agents: General User Models, Next Action Prediction, open-source proactive personal agents, privacy and trust, and when agents should initiate versus wait. The readings are GUM, Next Action Predictors and OpenClaw.

(Finale) Open Problems and Demo Day: Computer Use, Web Agents, and Pre-Launch Checks | Stanford CS329Z Lecture 19

Per the schedule, Lecture 19 closes the course with multimodal agents, web and computer-use agents, science agents, long-running architectures, production and observability (tracing, monitoring, cost management), and open problems in reliability, scalability and interpretability. The additional readings are OSWorld and WebShop; the final Demo Day falls in exam week, Dec 7–11.