Skip to content
All tags

#cs329z

19 posts

Before Building Agents, Learn How Models Read and Write | Stanford CS329Z Lecture 2

Lecture 02 runs from decoding, attention and linear attention through the training pipeline, KV cache, test-time scaling, structured output and context engineering. The assigned Anthropic guide on context engineering asks what the model should see at each step.

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.

Plug Tools In: Function Calling, MCP, and Tool Failures | Stanford CS329Z Lecture 4

Lecture 04 runs from Toolformer's tool learning and Gorilla and ToolLLM's API retrieval to function calling, MCP, and reliability benchmarks such as BFCL and τ-bench. The assigned MCP specification standardizes the interface while trust responsibilities stay with the host.

Take Frameworks Apart: DSPy, LangGraph, and the Harness Gap | Stanford CS329Z Lecture 5

Lecture 05 frames agent engineering through data, systems and evaluation, demos DSPy and LangGraph, then compares open-source harnesses, Temporal's durable orchestration and observability tools. The assigned DSPy paper turns prompt templates into programs optimized against a metric.

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.

Don't Let the Score Fool You: Write the Full Evaluation as a 4-Tuple | Stanford CS329Z Lecture 13

Per the schedule, Lecture 13 covers why evals are hard, the request / environment / stopping criteria / scorer 4-tuple, properties of good benchmarks, realistic scaffolding and reliability. The readings are the agentic benchmark best-practice checklist, Press's benchmark guide and tinyBenchmarks.

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.

Compound AI Systems: How Models, Data, and Tools Work Together | Stanford CS329Z Lecture 1

Start with the opening slides on the agent loop, components, and engineering challenges, then examine BAIR's compound systems, Ng's work patterns, and Si's execution-feedback experiments. Distinguish the lecture, required reading, and additional readings.

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.