Skip to main content

Prompt Focusing

The Prompt Focusing operation analyzes an input prompt or multi-turn conversation and returns a sharper, purpose-aligned version. It helps reduce verbosity, re-align user questions with a predefined purpose, and improve overall clarity before sending the prompt to an LLM, resulting in lower token costs and more accurate responses.

Overview

Prompt Focusing addresses common challenges in LLM interactions by:

  • Reducing Verbosity: Eliminates unnecessary words and redundant information while preserving intent
  • Purpose Alignment: Ensures prompts stay focused on the intended goal or objective
  • Clarity Enhancement: Restructures confusing or ambiguous requests for better comprehension
  • Token Optimization: Reduces token usage without sacrificing meaning, leading to cost savings
  • Response Quality: Improves LLM output by providing clearer, more focused input

The operation analyzes the conversation context and applies intelligent refinements based on the specified purpose statement and target audience. It can output either an improved prompt, suggestions for improvement, or both depending on your needs.

Key benefits include faster processing times, reduced API costs, and more accurate LLM responses through clearer input prompts.

Configuration

FieldTypeDefaultDescription
purposeStatementstringundefinedShort text that describes the intended purpose/goal. If omitted the original system/context message is used.
targetAudience'general' | 'technical' | 'creative' | 'educational'"general"Adapts wording / tone to the audience profile.
outputFormat'improved_prompt' | 'suggestions' | 'both'"both"Choose whether the operation returns only the rewritten prompt, only bullet-point suggestions, or both.

Target Audience Options

  • general - Uses clear, accessible language suitable for most users
  • technical - Employs precise technical terminology and structured formatting
  • creative - Maintains creative flow while improving focus and clarity
  • educational - Optimizes for learning objectives with clear, instructional language

Output Format Options

  • improved_prompt - Returns only the refined, focused version of the input
  • suggestions - Provides bullet-point recommendations for manual improvement
  • both - Includes both the improved prompt and actionable suggestions

Configuration Example

interface PromptFocusingConfig {
purposeStatement?: string;
targetAudience?: 'general' | 'technical' | 'creative' | 'educational';
outputFormat?: 'improved_prompt' | 'suggestions' | 'both';
}

Result Format

interface PromptFocusingResult {
improvedPrompt: string; // Focused / rewritten prompt
confidence: number; // 0-1 confidence score
suggestions?: string[]; // Available when outputFormat includes 'suggestions'
}

Examples

curl -X POST https://api.meta-prompt.com/v1/process \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": "Here are the commit messages from sprint 14. Could you write release notes so that operations understands what changed? Make sure you mention the tickets addressed and also add emojis where suitable. Also shorten things if you can…"
}
],
"operations": [
{
"name": "promptFocusing",
"config": {
"purposeStatement": "Generate concise release-note summaries",
"targetAudience": "technical",
"outputFormat": "both"
}
}
]
}'

Response:

{
"messages": [
{
"role": "user",
"content": "Create concise release notes from the provided Sprint 14 commit messages. Include: ticket references, key changes for operations team, and relevant emojis."
}
],
"operations": [
{
"name": "promptFocusing",
"result": {
"improvedPrompt": "Create concise release notes from the provided Sprint 14 commit messages. Include: ticket references, key changes for operations team, and relevant emojis.",
"confidence": 0.92,
"suggestions": [
"Removed redundant phrasing ('Also shorten things if you can')",
"Structured requirements as clear bullet points",
"Eliminated unnecessary hedging language",
"Made the action verb more direct ('Create' vs 'Could you write')"
]
}
}
]
}