Prompt/Response Optimiser
At runtime, transform user inputs and model outputs into standardised, template-aligned prompts and responses against predefined constraints, so the agent and its downstream consumers see consistent shapes.
Problem
If user prompts go straight to the model and the model's free-form output goes straight to consumers, two things drift in parallel. The model's behaviour changes with every small wording variation in how users phrase the same intent, and each downstream consumer ends up writing its own ad-hoc parser to extract what it needs from prose, with parsers that disagree on edge cases. Over time the agent's behaviour becomes hard to reproduce and downstream integrations become brittle, because there is no single contract that both the model and the consumers are held to.
Solution
A prompt/response optimiser sits between the user-facing surface and the foundation model. On input, it loads a template for the current task (few-shot examples, format constraints, goal restatement) and rewrites the user's prompt to match. On output, it post-processes the model's response into the consumer's expected shape. The template registry can be evolved independently of the agent logic.
When to use
- Multiple downstream consumers depend on the agent's response shape.
- Domain-specific prompt scaffolding must be reused across many requests.
- Templates can be evolved separately from agent logic.
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.