Learning path · Programmatic Prompting · 34
Programmatic Prompting
Building prompts through code—templates, optimizers, and typed modules—instead of one-off strings in notebooks.
Why it matters
- Enables testing, diff review, and CI eval hooks.
- Connects product logic with prompt assembly.
- Foundation for DSPy, agents, and dynamic RAG.
Key ideas
- Templates with typed slots
- Version control
- Eval-driven change
Top resources
- 01DocsStanford NLP
DSPy: programming—not prompting—LMs
Why this resource. The alternative to hand-tuned adjectives: programs with metrics.
Covers in this concept
- signatures
- compile
- metrics
- 02DocsOpenAI
Prompt engineering
Why this resource. What you are replacing when you stop editing prompt text by taste.
Covers in this concept
- prompt strings
Programmatic prompting treats prompts like SQL queries assembled from parameters: tenant policy fragments, retrieved chunks, tool outputs. Centralize assembly functions, forbid copy-paste prompt forks, and run golden tests on every change. Optimizers and teleprompters assume this structure—free-text prompts in scattered services resist automation and observability. Expose prompt assembly functions to observability with hashes of each segment so incidents map to exact template versions quickly.
Updated 2026-08-09 · Full learning path