DSPy
@DSPyOSS
An open-source declarative framework for building modular AI software. Programming—not prompting—LLMs via higher-level abstractions & optimizers.
DSPy is the highest-bandwidth language to talk to computers in a just-precise-enough way. First 36 lines below: 1. Take arbitrarily long content: `chunks`. 2. Build a global Table of Contents. 3. Distribute chunks into sections to be written. 4. Recursively write each section.

Regular expressions originally sparked my interest in programming. And now I’m so excited that I can do web scraping *without* them (and without XML parsers either!). @DSPyOSS + @firecrawl_dev allows me to write an agentic web scraper that can navigate to the data I want and…
It's rare to meet engineers that understand all three. Do read them carefully!
How it started: "AI vibe coding tools will replace devs!" How it's going: "Do this: - Provide it w a detailed spec - Break down tasks to small ones - Separate dev and prod envs - Do NOT give access to the agent to prod - Never trust the agent; verify every step it takes - ...
Heard of @DSPyOSS but find it intimidating? I wrote a beginner's playbook that breaks it down into simple, practical steps. Learn the fundamentals of building AI systems that don't constantly need fixing. This is part of chapter 3 from our upcoming book on AI Agents. Link:…
I just published a new playbook which is part of my upcoming book on AI Agents. The response to the last playbook was incredible, thank you! To build on that, I'm sharing the next logical step: the exact 4-part template I use to prompt reliable agents. The full playbook is…
University of Maryland researchers introduce AegisLLM, a new agentic system for LLM security, like defending against jailbreaks. Leveraging DSPy, AegisLLM *evolves* based on the attacks it sees in real time—via dspy.MIPROv2 prompt optimization. Up to 32% in optimization gains!
🐭🔒 LLM security is a cat-and-mouse game. Attackers adapt. Prompts mutate. Meanwhile, most defenses? 🚫 Static. Fragile. One-shot fixes. It’s time for something smarter. ⚔️ Meet AegisLLM: An agentic runtime defense that thinks, reacts, and learns — just like the attackers do.…
🤯 New research deploys DSPy-optimized system in real-world medical settings. Finds 70% increase in positive patient feedback. The authors introduce Dr.Copilot, a multi-agent DSPy assistant in Romanian. Optimized along 17 axes like Empathy & Explanations using dspy.SIMBA.
I gave a talk at @pyowa last night about @DSPyOSS! Definitely one of the best things to happen to GenAI workloads in the last few years.
RAG or not, I’m compound systems pilled all thanks to @DSPyOSS. That is indeed the right abstraction. Anything that is relevant since 2022 in AI (three years is an eternity in AI!) must be doing something right.
Big merge coming to Arbor soon! Lots of wonderful things coming together all at once
dspy now works great in the browser. try the cool new dspy notebook with built in local in browser models. @DSPyOSS @lateinteraction you folks will like this.
😂 careful
So relatable. For me it was. Ok just break the prompt into signatures. Then it was ok just use predict. Then it was ok let’s try MIPRO. Then I wanted to compare it to SIMBA. Now it’s figuring out relationship between prompt complexity and module/optimizer need. Perpetual cycle
Day 1 of using @DSPyOSS, and it's amazing 🚀. It's indeed remarkable how simple its API is to relate with - all you need to wrap your head around is the idea of signatures & modules (don't worry about optimizers to start with). And knowledge of Pydantic helps. It's a breeze!
Properly implementing @DSPyOSS is paying dividends but slowly becoming a fixation 😅
Um what’s happening in this prompt exactly
Wow, did you know you can use DSPy to deduce you System Prompt from 20 examples? This prompt is hilarious: You are the sole interpreter for a live, high-stakes police negotiation taking place between an anglophone SWAT commander and a francophone hostage-taker holed up inside a…
Wow, did you know you can use DSPy to deduce you System Prompt from 20 examples? This prompt is hilarious: You are the sole interpreter for a live, high-stakes police negotiation taking place between an anglophone SWAT commander and a francophone hostage-taker holed up inside a…