AI: prompt architectures
This course treats a prompt as an engineered artifact with no compiler, non-local effects and silent degradation. It splits a prompt into layers: identity, task, examples, context, input and output contract. It shows what goes in the system prompt, the user message or a schema, and why layers are ordered stable to volatile for caching. Later lessons cover composing shared layers without coupling, reasoning scaffolds under adaptive thinking, context assembly under a token budget, multi-turn state, and a versioned prompt registry in Rails.
What you'll learn
- ✓Organizing a prompt into layers with distinct jobs and rates of change
- ✓Placing content in the system prompt, user message or schema, ordered for caching
- ✓Composing shared layers as an explicit list without hidden coupling
- ✓Choosing reasoning scaffolds that still help under adaptive thinking and effort
- ✓Assembling context under a token budget with required and prioritized sections
- ✓Managing conversation state and versioning prompts in a Rails registry
The prompt as an artifact
Nine courses established that you will be changing prompts, not weights. This course shows what a prompt looks like once you accept that and engineer it properly.
Read the full lesson free →Curriculum
7 lessonsThe prompt as an artifact
Why a prompt is an artifact with no compiler, and how layers with distinct rates of change organize it.
Anatomy: what belongs where
Which content belongs in the system prompt, the user message or a schema, ordered stable to volatile for caching.
Composition without coupling
When to share prompt text between prompts, and how to compose testable layers as an explicit list in Ruby.
Reasoning scaffolds
Which reasoning instructions adaptive thinking and effort made redundant, and which scaffolds, like naming considerations, still help.
Context assembly under a budget
Building a context assembler that fits sections into a token budget by necessity and priority, recording what was dropped.
Multi-turn prompts and state
Treating the message array as application state: windowing, compaction, mid-conversation system messages and storing the prompt version.
A prompt registry in Rails
Assembling a versioned prompt registry in Rails, with tests at three levels and a table recording each prompt run.