PromptBuilder.focus_on()method

Set the primary focus that leverages both front-loading and recency bias for maximum attention impact.

USAGE

PromptBuilder.focus_on(primary_goal)

.focus_on() provides a powerful dual-positioning method that ensures the most critical objective receives maximum attention throughout the prompt by strategically placing it both at the beginning (as a critical constraint) and at the end (as final emphasis). This dual-anchor approach leverages both primacy and recency effects to create the strongest possible attention focus on the primary objective.

Parameters

primary_goal : str

The single most important objective that must receive maximum attention and priority throughout the AI’s response. Should be formulated as a clear, specific, and measurable objective that captures the essential purpose of the prompt (e.g., "provide actionable security recommendations", "create implementable cost reduction strategies", "generate learning-focused technical explanations", etc.).

Returns

PromptBuilder

Self for method chaining, allowing combination with other prompt building methods to create comprehensive, structured prompts.

Research Foundation

Dual Attention Strategy. Information positioned at both the beginning and end of a sequence receives the highest attention and retention. By anchoring the primary goal at both positions, .focus_on() ensures that the most critical objective maintains prominence throughout the entire prompt processing sequence.

Primacy and Recency Effects. The method capitalizes on both primacy bias (heightened attention to early information) and recency bias (heightened attention to final information) to create a reinforcing attention pattern that keeps the primary objective at the forefront of the AI’s processing throughout response generation.

Objective Reinforcement. Unlike single-position emphasis methods, .focus_on() creates a reinforcing loop where the primary goal is established early as a critical requirement and then reinforced at the end as the ultimate focus. This dual reinforcement significantly reduces the risk of objective drift in complex prompts.

Attention Hierarchy Management. By explicitly establishing one primary objective above all others, this method helps manage attention hierarchy in complex prompts with multiple competing requirements, ensuring that when trade-offs must be made, the primary goal takes clear precedence.

Integration Notes

  • Dual Positioning: leverages both primacy and recency effects for maximum attention impact
  • Objective Reinforcement: creates reinforcing attention pattern that prevents goal drift
  • Attention Hierarchy: establishes clear priority structure for complex prompts
  • Trade-off Guidance: provides clear decision criteria when competing objectives conflict
  • Quality Assurance: ensures responses align with the most critical objective throughout
  • Strategic Emphasis: combines front-loaded critical constraints with end-positioned final emphasis

The .focus_on() method provides the strongest possible attention management by establishing the primary objective as both the opening critical requirement and closing final emphasis, creating a dual-anchor system that maintains unwavering focus on the most important goal throughout the entire AI response generation process.

Examples


Security-first system analysis

Ensure security remains the absolute priority across all considerations:

import talk_box as tb

builder = (
    tb.PromptBuilder()
    .persona("security architect", "enterprise security design")
    .focus_on("identify and eliminate all security vulnerabilities before considering any other improvements")
    .task_context("analyze enterprise application architecture for production deployment")
    .core_analysis([
        "authentication and authorization mechanisms",
        "data protection and encryption standards",
        "network security and access controls",
        "infrastructure security configuration"
    ])
    .constraint("include performance optimization suggestions where security-compatible")
    .constraint("consider user experience implications of security measures")
    .output_format([
        "security assessment with risk severity levels",
        "critical vulnerabilities requiring immediate attention",
        "security-first recommendations with implementation priorities"
    ])
)

print(builder)
You are a security architect with expertise in enterprise security design.

CRITICAL REQUIREMENTS:
- Primary objective: identify and eliminate all security vulnerabilities before considering any
  other improvements

TASK: analyze enterprise application architecture for production deployment

CORE ANALYSIS (Required):
- authentication and authorization mechanisms
- data protection and encryption standards
- network security and access controls
- infrastructure security configuration

ADDITIONAL CONSTRAINTS:
- include performance optimization suggestions where security-compatible
- consider user experience implications of security measures

OUTPUT FORMAT:
- security assessment with risk severity levels
- critical vulnerabilities requiring immediate attention
- security-first recommendations with implementation priorities

Focus your entire response on: identify and eliminate all security vulnerabilities before
considering any other improvements

Cost-effectiveness priority

Prioritize cost-effective solutions above all other considerations:

builder = (
    tb.PromptBuilder()
    .persona("operations consultant", "cost optimization and efficiency")
    .focus_on("maximize cost savings while maintaining operational quality")
    .task_context("develop operational efficiency improvement plan for manufacturing company")
    .core_analysis([
        "current cost structure and inefficiencies",
        "automation and technology opportunities",
        "process optimization potential",
        "resource allocation improvements"
    ])
    .constraint("include innovation opportunities where cost-effective")
    .constraint("consider employee impact and change management")
    .output_format([
        "cost analysis with savings potential",
        "implementation priorities by ROI and payback period",
        "budget-conscious recommendations with measurable outcomes"
    ])
)

print(builder)
You are a operations consultant with expertise in cost optimization and efficiency.

CRITICAL REQUIREMENTS:
- Primary objective: maximize cost savings while maintaining operational quality

TASK: develop operational efficiency improvement plan for manufacturing company

CORE ANALYSIS (Required):
- current cost structure and inefficiencies
- automation and technology opportunities
- process optimization potential
- resource allocation improvements

ADDITIONAL CONSTRAINTS:
- include innovation opportunities where cost-effective
- consider employee impact and change management

OUTPUT FORMAT:
- cost analysis with savings potential
- implementation priorities by ROI and payback period
- budget-conscious recommendations with measurable outcomes

Focus your entire response on: maximize cost savings while maintaining operational quality

User experience excellence

Make user experience the paramount consideration in all decisions:

builder = (
    tb.PromptBuilder()
    .persona("UX designer", "user-centered product design")
    .focus_on("optimize every aspect of the user experience above technical or business convenience")
    .task_context("redesign mobile banking application interface for improved usability")
    .core_analysis([
        "user journey mapping and pain points",
        "accessibility and inclusive design requirements",
        "interface clarity and intuitive navigation",
        "performance impact on user experience"
    ])
    .constraint("consider technical implementation constraints")
    .constraint("include business stakeholder requirements")
    .output_format([
        "UX assessment with user impact analysis",
        "design recommendations prioritized by user value",
        "implementation plan with user testing validation"
    ])
)

print(builder)
You are a UX designer with expertise in user-centered product design.

CRITICAL REQUIREMENTS:
- Primary objective: optimize every aspect of the user experience above technical or business
  convenience

TASK: redesign mobile banking application interface for improved usability

CORE ANALYSIS (Required):
- user journey mapping and pain points
- accessibility and inclusive design requirements
- interface clarity and intuitive navigation
- performance impact on user experience

ADDITIONAL CONSTRAINTS:
- consider technical implementation constraints
- include business stakeholder requirements

OUTPUT FORMAT:
- UX assessment with user impact analysis
- design recommendations prioritized by user value
- implementation plan with user testing validation

Focus your entire response on: optimize every aspect of the user experience above technical or
business convenience

Learning-centered education

Prioritize learning effectiveness over all other educational considerations:

builder = (
    tb.PromptBuilder()
    .persona("instructional designer", "evidence-based learning design")
    .focus_on("maximize student learning outcomes and knowledge retention")
    .task_context("design comprehensive data science curriculum for career changers")
    .core_analysis([
        "learning objective alignment and progression",
        "skill building sequence and scaffolding",
        "practice opportunities and feedback mechanisms",
        "real-world application and project integration"
    ])
    .constraint("consider time constraints and resource limitations")
    .constraint("include diverse learning styles and accessibility")
    .output_format([
        "curriculum structure with learning outcome mapping",
        "module design with skill progression tracking",
        "assessment strategy focused on competency development"
    ])
)

print(builder)
You are a instructional designer with expertise in evidence-based learning design.

CRITICAL REQUIREMENTS:
- Primary objective: maximize student learning outcomes and knowledge retention

TASK: design comprehensive data science curriculum for career changers

CORE ANALYSIS (Required):
- learning objective alignment and progression
- skill building sequence and scaffolding
- practice opportunities and feedback mechanisms
- real-world application and project integration

ADDITIONAL CONSTRAINTS:
- consider time constraints and resource limitations
- include diverse learning styles and accessibility

OUTPUT FORMAT:
- curriculum structure with learning outcome mapping
- module design with skill progression tracking
- assessment strategy focused on competency development

Focus your entire response on: maximize student learning outcomes and knowledge retention

Compliance-first approach

Ensure regulatory compliance takes absolute precedence:

builder = (
    tb.PromptBuilder()
    .persona("compliance officer", "financial services regulation")
    .focus_on("ensure 100% regulatory compliance before any operational considerations")
    .task_context("audit investment management platform for regulatory adherence")
    .core_analysis([
        "regulatory requirement mapping and gaps",
        "risk assessment and mitigation strategies",
        "documentation and audit trail completeness",
        "process compliance and control effectiveness"
    ])
    .constraint("include operational efficiency opportunities where compliant")
    .constraint("consider user experience impact of compliance measures")
    .output_format([
        "compliance status with regulatory requirement tracking",
        "critical violations requiring immediate remediation",
        "compliance-first recommendations with implementation priorities"
    ])
)

print(builder)
You are a compliance officer with expertise in financial services regulation.

CRITICAL REQUIREMENTS:
- Primary objective: ensure 100% regulatory compliance before any operational considerations

TASK: audit investment management platform for regulatory adherence

CORE ANALYSIS (Required):
- regulatory requirement mapping and gaps
- risk assessment and mitigation strategies
- documentation and audit trail completeness
- process compliance and control effectiveness

ADDITIONAL CONSTRAINTS:
- include operational efficiency opportunities where compliant
- consider user experience impact of compliance measures

OUTPUT FORMAT:
- compliance status with regulatory requirement tracking
- critical violations requiring immediate remediation
- compliance-first recommendations with implementation priorities

Focus your entire response on: ensure 100% regulatory compliance before any operational
considerations

Innovation-driven development

Prioritize innovative solutions that provide competitive advantage:

builder = (
    tb.PromptBuilder()
    .persona("innovation strategist", "emerging technology adoption")
    .focus_on("identify and implement innovative solutions that create significant competitive advantage")
    .task_context("develop technology roadmap for digital transformation initiative")
    .core_analysis([
        "emerging technology opportunities and applications",
        "competitive differentiation potential",
        "implementation feasibility and risk assessment",
        "ROI and business impact projections"
    ])
    .constraint("consider enterprise stability and risk tolerance")
    .constraint("include team capability development requirements")
    .output_format([
        "innovation assessment with competitive impact analysis",
        "technology recommendations prioritized by advantage potential",
        "implementation strategy with innovation milestones"
    ])
)

print(builder)
You are a innovation strategist with expertise in emerging technology adoption.

CRITICAL REQUIREMENTS:
- Primary objective: identify and implement innovative solutions that create significant competitive
  advantage

TASK: develop technology roadmap for digital transformation initiative

CORE ANALYSIS (Required):
- emerging technology opportunities and applications
- competitive differentiation potential
- implementation feasibility and risk assessment
- ROI and business impact projections

ADDITIONAL CONSTRAINTS:
- consider enterprise stability and risk tolerance
- include team capability development requirements

OUTPUT FORMAT:
- innovation assessment with competitive impact analysis
- technology recommendations prioritized by advantage potential
- implementation strategy with innovation milestones

Focus your entire response on: identify and implement innovative solutions that create significant
competitive advantage

Quality-first manufacturing

Make product quality the overriding priority in all manufacturing decisions:

builder = (
    tb.PromptBuilder()
    .persona("quality engineer", "manufacturing excellence")
    .focus_on("achieving superior product quality that exceeds customer expectations")
    .task_context("optimize manufacturing process for automotive component production")
    .core_analysis([
        "current quality metrics and defect analysis",
        "process control and variability reduction",
        "quality assurance and testing protocols",
        "continuous improvement opportunities"
    ])
    .constraint("consider production efficiency where quality-compatible")
    .constraint("include cost implications of quality improvements")
    .output_format([
        "quality assessment with defect root cause analysis",
        "process improvements prioritized by quality impact",
        "implementation plan with quality validation metrics"
    ])
)

print(builder)
You are a quality engineer with expertise in manufacturing excellence.

CRITICAL REQUIREMENTS:
- Primary objective: achieving superior product quality that exceeds customer expectations

TASK: optimize manufacturing process for automotive component production

CORE ANALYSIS (Required):
- current quality metrics and defect analysis
- process control and variability reduction
- quality assurance and testing protocols
- continuous improvement opportunities

ADDITIONAL CONSTRAINTS:
- consider production efficiency where quality-compatible
- include cost implications of quality improvements

OUTPUT FORMAT:
- quality assessment with defect root cause analysis
- process improvements prioritized by quality impact
- implementation plan with quality validation metrics

Focus your entire response on: achieving superior product quality that exceeds customer expectations