PromptBuilder.core_analysis()
Define core analysis requirements as a high-priority, required structured section.
Usage
PromptBuilder.core_analysis(analysis_points)The core analysis method creates the central analytical framework that defines what specific aspects must be examined and addressed in the AI’s response. This method automatically creates a "CORE ANALYSIS (Required)" section with high priority placement, ensuring that the fundamental analytical requirements receive prominent attention and are treated as non-negotiable deliverables.
Parameters
analysis_points: Union[str, List[str]]-
Specific analysis requirements that define the mandatory analytical dimensions. Can be a single string or list of strings. Each point should be clear, actionable, and represent a distinct aspect of the analysis. Points should be formulated as analytical objectives rather than general suggestions (e.g.,
"evaluate security implementation patterns"rather than"look at security").
Returns
PromptBuilder- Self for method chaining, allowing combination with other prompt building methods to create comprehensive, structured prompts.
Research Foundation
Strategic Purpose Framework. Core analysis requirements serve as the analytical backbone of the prompt, defining the specific dimensions of investigation that must be covered. Unlike general constraints or suggestions, core analysis points are treated as mandatory analytical objectives that structure the AI’s systematic examination of the subject matter.
Attention Priority Theory. This method automatically assigns Priority.HIGH and marks the section as required, ensuring that core analysis requirements are prominently positioned after critical constraints and task context but before standard constraints and formatting requirements. This placement leverages attention optimization principles to ensure analytical objectives receive appropriate focus.
Analytical Framework Design. Each analysis point should represent a distinct analytical dimension or investigative angle that contributes to comprehensive coverage of the task. The points work together to create a systematic analytical framework that guides the AI’s examination process and ensures thorough, structured analysis.
Quality Assurance Mechanism. By marking core analysis as required, this method establishes analytical accountability and the AI must address each specified analysis point to provide a complete response. This prevents superficial analysis and ensures comprehensive coverage of critical analytical dimensions.
Integration Notes
- Analytical Structure: creates systematic framework for comprehensive analysis
- High Priority Placement: automatically positioned prominently in the prompt hierarchy
- Required Coverage: marked as required to ensure all analytical dimensions are addressed
- Quality Assurance: establishes analytical accountability and prevents superficial responses
- Systematic Investigation: guides AI through structured, thorough examination process
- Comprehensive Coverage: ensures critical analytical aspects are not overlooked
The .core_analysis() method provides the analytical backbone for sophisticated prompts, ensuring that complex tasks receive systematic, thorough examination across all critical dimensions while maintaining focus on the most important analytical objectives.
Examples
Software architecture analysis
Define core analytical requirements for architectural review:
import talk_box as tb
builder = (
tb.PromptBuilder()
.persona("senior software architect", "enterprise systems")
.critical_constraint("focus on production-ready, scalable solutions")
.task_context("review microservices architecture for e-commerce platform")
.core_analysis([
"evaluate service decomposition strategy and boundaries",
"assess inter-service communication patterns and protocols",
"analyze data consistency and transaction management approaches",
"review scalability patterns and load distribution mechanisms",
"examine security implementation across service boundaries"
])
)
print(builder)Security audit analysis
Structure mandatory security analysis dimensions:
builder = (
tb.PromptBuilder()
.persona("security engineer", "application security")
.critical_constraint("prioritize critical vulnerabilities that block deployment")
.task_context("conduct comprehensive security audit of web application")
.core_analysis([
"analyze authentication and authorization mechanisms",
"evaluate input validation and sanitization practices",
"assess data protection and encryption implementations",
"review API security and rate limiting strategies",
"examine logging, monitoring, and incident response capabilities"
])
)
print(builder)Code quality review analysis
Define analytical framework for code review:
builder = (
tb.PromptBuilder()
.persona("senior developer", "code quality and best practices")
.task_context("review pull request for production deployment")
.core_analysis([
"evaluate logic correctness and edge case handling",
"assess performance implications and optimization opportunities",
"review maintainability and code organization patterns",
"analyze test coverage and quality assurance approaches",
"examine security considerations and vulnerability patterns"
])
.constraint("provide constructive feedback with learning opportunities")
.constraint("include positive reinforcement for good practices")
)
print(builder)Data science model analysis
Structure analytical requirements for ML model evaluation:
builder = (
tb.PromptBuilder()
.persona("data scientist", "machine learning and model evaluation")
.critical_constraint("include bias detection and fairness assessment")
.task_context("evaluate machine learning model for production deployment")
.core_analysis([
"assess model accuracy across different demographic groups",
"evaluate feature importance and model interpretability",
"analyze training data quality and representation",
"review model generalization and overfitting indicators",
"examine deployment considerations and monitoring requirements"
])
)
print(builder)Business process analysis
Define analytical framework for process improvement:
builder = (
tb.PromptBuilder()
.persona("business analyst", "process optimization")
.task_context("analyze customer onboarding process for efficiency improvements")
.core_analysis([
"map current process flow and identify bottlenecks",
"evaluate customer experience and friction points",
"assess resource utilization and cost implications",
"analyze compliance and risk management considerations",
"identify automation opportunities and technology solutions"
])
.constraint("support recommendations with quantitative analysis")
.constraint("consider both short-term wins and long-term strategy")
)
print(builder)Financial analysis framework
Structure comprehensive financial evaluation:
builder = (
tb.PromptBuilder()
.persona("financial analyst", "portfolio and risk management")
.critical_constraint("include regulatory compliance considerations")
.task_context("analyze investment portfolio performance and risk exposure")
.core_analysis([
"evaluate return performance across asset classes and time periods",
"assess risk metrics including VaR, correlation, and concentration",
"analyze portfolio diversification and asset allocation effectiveness",
"review stress testing results and scenario analysis",
"examine liquidity management and cash flow projections"
])
)
print(builder)