DSPy: Learn how to program (not prompt) language models

May 4, 2024


In this tutorial, you will be introduced to DSPy, a powerful framework for programming language models, without relying solely on prompting. DSPy offers an innovative approach to building LLM applications, minimizing the need for manual prompt optimization.

Course Overview

The course begins with an introduction to the key concepts of DSPy, such as signatures and modules. These elements allow you to define the input, outputs, and flow of your applications efficiently. You will also learn how DSPy supports prompt optimization using data sets.

Throughout the course, you'll engage in practical coding exercises, creating tools and agents such as a stock analysis tool, a chess-playing agent, and BabyAGI, an autonomous task-based AI agent.


  • Introduction to the Course: An overview of what to expect from the course.
  • Signatures and Modules: Learn the foundational elements of DSPy, including signatures and modules.
  • Advanced Modules and Retrievers: Dive deeper into modules and explore retrievers for enhanced functionality.
  • Building a Stock Analyst (Part 1): Start building a stock analysis tool.
  • Building a Stock Analyst (Part 2): Continue working on the stock analysis tool, refining and enhancing it.
  • Building a Chess Agent Using DSPy: Develop a chess-playing agent, exploring DSPy's capabilities in game AI.
  • Synthetic Prompt Optimization: Explore how DSPy facilitates prompt optimization using synthetic data.
  • Building BabyAGI with DSPy: Create an autonomous task-based AI agent using DSPy.
  • DSPy + LangChain for Automatic Prompt Optimization: Integrate DSPy with LangChain for automated prompt optimization.
  • Decision-Making AI Agent with DSPy and Finite State Machines: Build a decision-making AI agent, incorporating finite state machines.
  • Making the Code of Our AI Agent DRY: Learn how to refactor your code for maintainability and efficiency.

Why DSPy?

DSPy offers a streamlined approach to programming language models, making it a valuable tool for developers who want to focus on application logic rather than manual prompt tuning. By the end of this course, you'll have hands-on experience with DSPy's key features and be ready to implement your own language model applications.

Join the course to uncover the exciting possibilities DSPy offers for programming language models!

Learn more about the course here