Fetching from the wire…
Public story · 2026-07-14 · high
Willison used DSPy to tune the Datasette Agent's SQL prompts, and the optimizer caught a schema bug that would've taken him an hour to chase by hand.
Why now: DSPy's 3.3.0b1 release, with the new ReActV2 module, lands July 14, as teams weigh whether to keep hand-tuning prompts through the next model swap.
DSPy shipped 3.3.0b1 on July 14 with a new ReActV2 module, turning prompts from hand-tuned strings into a target you compile and re-run for any model. Anyone who's shipped a prompt-based feature knows this pain: you upgrade the model, the carefully-tuned prompt regresses, and nobody can say why. DSPy's fix is to stop treating the prompt as a precious artifact and treat it as a build output instead.
You declare a task as a typed Input to Output signature and pick a reasoning strategy. MIPROv2 then searches instructions and few-shot examples using Bayesian optimization against your own metric, per DSPy's documentation.
Swap models, re-run the optimizer, get a prompt tuned for what you're actually deploying on.
Willison used DSPy to tune the Datasette Agent's SQL prompts. The optimizer surfaced a real bug: schema listings without column names caused the agent to guess columns and loop on retries.
That's a failure mode you'd normally burn an hour chasing by hand. The optimizer found it as a side effect of optimizing against the metric.
There's a learning curve. The signatures-and-modules abstraction takes a beat to click if you've only written raw strings. Budget an afternoon to port one real task before judging it.
Start with something that has a clean metric, a classifier, an extractor, a SQL generator, so MIPROv2 has an actual target. If you've got a prompt you keep re-crafting every time a new model drops, that's the one to convert first.
Each link below shares sources, entities, or timing with this story.
Willison uses DSPy / Shared entities / Shared topic / Earlier coverage
Linked by a graph relationship (Willison uses DSPy); both cover Start, Willison; overlapping topics (agent, model).
Willison uses DSPy / Shared entities / Earlier coverage / Tension
Linked by a graph relationship (Willison uses DSPy); both cover SQL, Willison; earlier SQL coverage from 2026-06-19.
DSPy uses LiteLLM / Shared entities / Earlier coverage
Linked by a graph relationship (DSPy uses LiteLLM); both cover DSPy, Willison; earlier DSPy coverage from 2026-03-25.
Willison uses DSPy / Shared entities / Earlier coverage
Linked by a graph relationship (Willison uses DSPy); both cover Datasette Agent, Willison; earlier Datasette Agent coverage from 2026-06-07.
Willison uses DSPy / Shared entity: Willison / Shared topic / Earlier coverage
Linked by a graph relationship (Willison uses DSPy); both cover Willison; overlapping topics (agent, model).
DSPy uses LiteLLM / Shared entity: Willison / Shared topic / Earlier coverage
Linked by a graph relationship (DSPy uses LiteLLM); both cover Willison; overlapping topics (against, agent).
Willison uses DSPy / Shared entity: Willison / Shared topic / Earlier coverage
Linked by a graph relationship (Willison uses DSPy); both cover Willison; overlapping topics (against, agent).
Willison uses DSPy / Shared entity: Willison / Earlier coverage / Tension
Linked by a graph relationship (Willison uses DSPy); both cover Willison; earlier Willison coverage from 2026-03-26.