The Four-Tier Prompt-Source Hierarchy
When an agent calls a tool to generate something — an image, a video, a piece of copy — it usually has more context than the tool's function signature can accept. The temptation is to pass only the structured form fields and "drop the rest on the floor." That produces template-feeling output regardless of which path the user took to get there.
The fix is to pass all four tiers of context to the generation step and rank them explicitly in the system prompt.
The four tiers
| Tier | Role | Source |
|---|---|---|
| 1 — Anchor | Primary subject / driver | The artifact the user chose — picked idea, selected reference, accepted suggestion |
| 2 — Emotional starting point | Background motivation, tone | The user's original free-text brief |
| 3 — Stylistic modifiers | Treatment knobs | Structured form choices (nomination, image type, style tags) |
| 4 — Fine-tuning | Last-mile refinement | The user's intent line or follow-up instruction |
The rule: lower tiers modify higher tiers, never override them. A "style: minimalist" tag does not change the subject — it changes how the subject is rendered.
Why it matters
If the chosen idea is tier-3 (a "modifier") instead of tier-1 (the "anchor"), every output regresses to a templated mean of the questionnaire space. Users feel the system isn't listening even when an LLM is technically in the loop. Promoting the chosen artifact to tier-1 — both in the payload and in the system prompt's explicit hierarchy — restores authorship.
Mechanism
- Persist tier-1 and tier-2 in shared agent state — a session-scoped store (Zustand, Redux, a server-side run record). Don't rely on re-deriving them from chat history; chat history is noisy and gets truncated.
- Carry them forward as structured args at every tool call — not as chat-text pass-through. Make the function signature accept all four tiers explicitly.
- The system prompt declares the hierarchy verbatim. List the four tiers, name what each is for, and instruct the LLM to anchor on tier-1.
- The fallback template mirrors the hierarchy. When the LLM call fails and you drop to a deterministic template, the template still leads with the chosen idea's blurb. Otherwise the fallback contradicts the doctrine and the user feels the regression.
Example — fixing a craft_prompt tool
A real agent had craft_prompt(nomination, image_type, style, user_intent) — tiers 3 and 4 only. The chosen idea (tier 1) and the original brief (tier 2) were chat-only and never reached the prompt composer. Outputs felt like questionnaire averages.
The fix: extend the run-state store to carry originalBrief and chosenIdea; widen the tool's args block to carry all four tiers as JSON; rewrite the prompt composer's system prompt to declare the hierarchy in order; rewrite the fallback template to lead with the chosen idea's blurb.
Outputs immediately stopped feeling templated. The change was almost entirely about plumbing — making the tool's surface match the doctrine the rest of the system already implied.
Pairs with
- typed-reference-composition — orthogonal: governs the role of each multi-input reference. This hierarchy governs content priority when multiple sources compete to fill one input.
- template-dispatch-prompts — orthogonal again: dispatches which prompt to use; this concept governs what content flows into it.