DSPy
A Python toolkit for building AI programs with code instead of hand-written prompts.
- Coding needed
- Developers only
A Python toolkit for building AI programs with code instead of hand-written prompts.
DSPy is a framework, a set of ready-made building blocks, for people who build software on top of language models (the AI behind chatbots). Instead of writing long, fragile instructions (prompts) by hand, you describe what you want in Python code.
DSPy then helps the AI give better answers. It includes methods that automatically improve the prompts, and even the model's internal settings, based on how well the program does.
Its makers say it works for simple sorting tasks, systems that look up documents before answering, and AI agents that take steps on their own. The name stands for Declarative Self-improving Python.
Python programmers and researchers who build apps or experiments on top of language models.
Developers only. It is a Python library, so you need to write code to use it. New to this? Start here.
Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?