
DSPy vs. LangGraph: AI Agent Frameworks Explained
Michael Ryan, a DSPy contributor and CS PhD student at Stanford, compares two approaches to building AI agents in this CS329Z: Engineering AI Agents lecture. He live-codes examples in DSPy, covering signatures, modules, and optimizers, then builds an equivalent agent in LangGraph using state, nodes, and edges, laying out where each framework's design philosophy helps or hurts. Ryan also surveys open-source agent harnesses including mini-SWE-agent, OpenHands, and Pi, demonstrates durable orchestration with Temporal, and walks through practical observability and evaluation methods for agent systems in production. The course is taught jointly by Diyi Yang, Michael Ryan, and John Yang, and this session is part of the CS329Z graduate course at Stanford. The lecture mixes live coding with architectural comparison, aimed at viewers who already understand language model basics and want a working sense of how real agent frameworks differ in practice.