Skip to content

■ PEOPLE // FIELD NOTE

Omar Khattab turns prompting into programming

Omar Khattab's DSPy pattern replaces brittle prompt handwork with signatures, modules, optimizers, and evaluation loops that can be inspected and improved.

Omar Khattab turns prompting into programming
[!] OPERATOR DOSSIER
[!] ON THIS PAGE

Omar Khattab is useful because he takes a messy habit and gives it a programming model. Most teams still treat prompts as fragile prose. DSPy treats language-model behavior as something you can specify, compose, optimize, and evaluate.

That does not make prompting disappear. It moves the work into a better shape.

Why he matters now

Manual prompt engineering breaks down when systems get bigger. A prompt that works in one notebook fails in a pipeline. A slight model change breaks output shape. A chain gets longer and nobody knows which instruction mattered.

Khattab’s pattern gives builders another route:

  • define signatures for inputs and outputs;
  • compose modules instead of pasting long prompt chains;
  • optimize prompts or weights against examples;
  • measure behavior instead of arguing from taste;
  • treat retrieval and generation as one programmable system.

That matters for context engineering . Good context is not only better prose. It is the right interface, examples, constraints, and feedback loop.

The operator pattern

Khattab’s pattern is prompt compilation.

MoveWhat it replaces
SignaturesHandwritten instruction blobs.
ModulesAd hoc chains hidden in notebooks.
OptimizersManual prompt tweaking by vibes.
Evaluation setsOne-off demos that cannot detect regressions.
Retrieval programsRAG pipelines with unclear responsibilities.

DSPy is not a magic wand. You still need data, examples, and judgment. But it gives the work an addressable structure.

DSPy and ColBERT

Khattab’s background with ColBERT matters because DSPy is not isolated from retrieval. Many useful AI systems are retrieval-plus-generation systems. They need to find evidence, pass it into a model, and produce an answer with enough structure to be trusted.

That is where hybrid retrieval and DSPy-style programming meet. A system can retrieve, reason, generate, and evaluate as a program rather than a long prompt wearing a trench coat.

For self.md, the takeaway is direct: if an AI workflow matters, it deserves specs and tests.

What to copy

You can copy the shape without adopting the entire framework.

  1. Write the input and output fields before writing the prompt.
  2. Collect a small set of examples.
  3. Run changes against those examples.
  4. Log failures by type, not only by prompt version.
  5. Optimize the workflow only after you know what success means.

A better prompt is nice. A measurable program is better.

Internal map

Use this page with:

For agents

FieldContent
ThesisOmar Khattab’s DSPy turns prompt work into programmable artifacts with signatures, modules, optimizers, and evals.
Proven patternSpecify behavior, compose modules, optimize against examples, and measure regressions.
Copy tomorrowRewrite one important prompt as explicit input fields, output fields, and three test examples.
Do not claimDo not say DSPy eliminates prompt engineering. It gives prompt work a programmable structure.
Internal links/concepts/context-engineering/, /concepts/hybrid-retrieval/, /tools/personal-ai-os/, /people/jesse-vincent-superpowers/

Sources


Next: Context engineering