Prompt System#

Framework prompt system with dependency injection for domain-specific prompt customization.

Core Prompt Builder Interface#

class framework.prompts.FrameworkPromptBuilder[source]#

Bases: ABC

Abstract base class for building domain-agnostic framework prompts with flexible composition.

This class provides the foundational architecture for the framework’s prompt system, enabling clean separation between generic framework infrastructure and domain-specific prompt customization. Applications can inherit from this class to provide specialized prompts while maintaining compatibility with the framework’s orchestration, task extraction, and response generation systems.

The prompt building system follows a modular composition pattern where each component (role, task, instructions, examples, context) can be independently customized or omitted based on the specific needs of the prompt type. This flexibility allows everything from simple single-purpose prompts to complex multi-stage prompts with dynamic context injection.

Raises:

NotImplementedError – If required abstract methods are not implemented

Note

All prompts automatically integrate with the framework’s debug system for development visibility. Set development.prompts.show_all=true in config to see generated prompts in logs.

Warning

Subclasses must implement get_role_definition() and get_instructions(). These are the minimum requirements for a functional prompt.

Examples

Basic prompt builder implementation:

class CustomPromptBuilder(FrameworkPromptBuilder):
    def get_role_definition(self) -> str:
        return "You are a data analysis specialist."

    def get_instructions(self) -> str:
        return "Analyze the provided data and extract key insights."

Advanced prompt with dynamic context:

class ContextualPromptBuilder(FrameworkPromptBuilder):
    def get_role_definition(self) -> str:
        return "You are an ALS accelerator operations expert."

    def get_instructions(self) -> str:
        return "Provide technical analysis using ALS-specific terminology."

    def _get_dynamic_context(self, **kwargs) -> Optional[str]:
        if 'device_status' in kwargs:
            return f"Current device status: {kwargs['device_status']}"
        return None

See also

FrameworkPromptProvider : Provider interface for registering prompt builders get_framework_prompts() : Access registered prompt builders debug_print_prompt() : Standalone debug function for prompt inspection Prompt Customization : Guide for customizing framework prompts

Required Abstract Methods

get_role_definition

Define the AI agent's role and primary identity for the prompt.

get_instructions

Provide detailed instructions for how the agent should perform its task.

Optional Composition Methods

get_task_definition

Define the specific task or objective for the prompt.

_get_dynamic_context

Inject runtime context information into the prompt.

_get_examples

Provide few-shot examples to guide agent behavior and output format.

Prompt Assembly Methods

get_system_instructions

Compose and return complete system instructions for agent/LLM configuration.

debug_print_prompt

Output prompt content for debugging and development visibility.

_format_examples

Format example objects into prompt-ready text representation.

abstractmethod get_role_definition()[source]#

Define the AI agent’s role and primary identity for the prompt.

This method provides the foundational “You are…” statement that establishes the agent’s expertise, perspective, and behavioral context. This is always required and forms the first component of every generated prompt.

Returns:

Role definition string that establishes agent identity and expertise

Return type:

str

Examples

Generic framework role:

return "You are an expert execution planner for the assistant system."

Domain-specific role:

return "You are an ALS accelerator operations specialist with expertise in beam diagnostics."
get_task_definition()[source]#

Define the specific task or objective for the prompt.

This method provides an explicit task statement when the role definition alone is insufficient to establish the prompt’s purpose. Can be omitted if the task is embedded within the role definition or instructions.

Returns:

Task definition string or None if task is embedded elsewhere

Return type:

Optional[str]

Examples

Explicit task definition:

return "TASK: Create a detailed execution plan for the user's request."

No separate task (embedded in role):

return None
abstractmethod get_instructions()[source]#

Provide detailed instructions for how the agent should perform its task.

This method contains the core operational guidance that tells the agent exactly how to approach and execute its assigned task. This is always required and typically contains the most detailed content of the prompt.

Returns:

Comprehensive instructions for task execution

Return type:

str

Examples

Structured instructions with guidelines:

return textwrap.dedent('''
    Follow these steps:
    1. Analyze the user's request for key requirements
    2. Identify necessary data sources and dependencies
    3. Create a step-by-step execution plan

    Guidelines:
    - Be specific and actionable
    - Consider error handling scenarios
    - Optimize for efficiency
    ''')
get_system_instructions(**context)[source]#

Compose and return complete system instructions for agent/LLM configuration.

This method orchestrates the prompt building process by combining all prompt components in the correct order: role, task, instructions, examples, and dynamic context. It handles optional components gracefully and automatically integrates with the framework’s debug system for development visibility.

The composition follows this structure: 1. Role definition (always present) 2. Task definition (optional) 3. Instructions (always present) 4. Examples (optional, can be static or dynamic) 5. Dynamic context (optional)

Parameters:

context (dict) – Runtime context data passed to dynamic methods

Returns:

Complete system prompt ready for LLM consumption

Return type:

str

Note

This method automatically calls debug_print_prompt() if debug output is enabled in the configuration. No manual debug calls are needed.

Examples

Basic usage in framework infrastructure:

prompt_builder = get_framework_prompts().get_orchestrator_prompt_builder()
system_prompt = prompt_builder.get_system_instructions(
    capabilities=active_capabilities,
    context_manager=context_manager
)

With dynamic context injection:

system_prompt = builder.get_system_instructions(
    user_preferences={'format': 'detailed'},
    system_status='operational',
    available_data_sources=['archiver', 'logbook']
)

See also

debug_print_prompt() : Debug output for prompt development _format_examples() : Custom example formatting override

debug_print_prompt(prompt, name=None)[source]#

Output prompt content for debugging and development visibility.

This method integrates with the framework’s development configuration to provide optional prompt debugging through console output and file saving. It’s automatically called by get_system_instructions() but can also be used manually for specialized prompts or intermediate prompt stages.

The debug output includes metadata such as timestamp, builder class, and configuration settings, making it easy to trace prompt generation during development and troubleshooting.

Parameters:
  • prompt (str) – The complete prompt text to output for debugging

  • name (Optional[str]) – Custom name for the prompt in debug output. If not provided, uses class-based default naming

Note

Debug output is controlled by development.prompts configuration: - show_all: Enable console output with detailed formatting - print_all: Enable file output to prompts directory - latest_only: Control file naming (latest.md vs timestamped)

Examples

Automatic usage (called by get_system_instructions):

# Debug output happens automatically
system_prompt = builder.get_system_instructions()

Manual usage for specialized prompts:

classification_prompt = "Classify this task..."
builder.debug_print_prompt(classification_prompt, "task_classification")

See also

debug_print_prompt() : Standalone debug function _get_default_prompt_name() : Default naming logic

get_orchestrator_guide()[source]#

Provide orchestrator planning guidance for capability-specific prompts.

This method allows prompt builders to provide structured guidance to the orchestrator about how to plan and execute tasks related to their specific capability or domain. The guide includes detailed instructions, rich examples, and priority settings for capability coordination.

Returns:

Orchestrator guide object or None if no guidance needed

Return type:

Optional[OrchestratorGuide]

Note

This method is primarily used by capability-specific prompt builders rather than infrastructure prompt builders.

Examples

Capability-specific orchestrator guidance:

def get_orchestrator_guide(self):
    return OrchestratorGuide(
        instructions="Use for data analysis when user requests statistical analysis or data validation",
        examples=[
            OrchestratorExample(
                step=PlannedStep(
                    context_key="analysis_results",
                    capability="data_analysis",
                    task_objective="Analyze provided data for trends and anomalies",
                    success_criteria="Statistical analysis complete",
                    expected_output="ANALYSIS_RESULTS",
                    inputs=[{"DATA_SET": "numerical_data"}]
                ),
                scenario_description="When user requests data analysis or trend identification",
                context_requirements={"DATA_SET": "Numerical data for analysis"}
            )
        ],
        priority=10
    )

See also

OrchestratorGuide : Structure for orchestrator guidance PlannedStep : Structure for planned steps get_classifier_guide() : Related classifier guidance

get_classifier_guide()[source]#

Provide task classification guidance for capability-specific prompts.

This method allows prompt builders to provide structured guidance to the task classifier about when and how their associated capability should be selected for different types of tasks. This helps ensure accurate capability routing in multi-capability scenarios.

Returns:

Classifier guide object or None if no guidance needed

Return type:

Optional[TaskClassifierGuide]

Note

This method is primarily used by capability-specific prompt builders to improve task routing accuracy.

Examples

Capability-specific classification guidance:

def get_classifier_guide(self):
    return TaskClassifierGuide(
        instructions="Determine if the task involves data analysis or trend identification requests",
        examples=[
            ClassifierExample(
                query="Analyze the beam current trends",
                result=True,
                reason="Request for data analysis requiring trend identification"
            ),
            ClassifierExample(
                query="What time is it?",
                result=False,
                reason="Simple information request, not data analysis"
            )
        ],
        actions_if_true=ClassifierActions()
    )

See also

TaskClassifierGuide : Structure for classification guidance ClassifierExample : Structure for classifier examples get_orchestrator_guide() : Related orchestrator guidance

Framework Access#

framework.prompts.get_framework_prompts(application_name=None)[source]#

Access the framework prompt provider system with optional application targeting.

This is the primary entry point for framework components to access prompt builders. It provides a clean interface to the global prompt provider registry, enabling dependency injection of application-specific prompts without circular dependencies.

The function supports both default provider access (for single-application deployments) and explicit provider selection (for multi-application scenarios). It integrates with the global prompt loader to provide consistent access patterns across the framework.

Parameters:

application_name (Optional[str]) – Specific application provider to use, or None for default

Returns:

Prompt provider implementation for the specified or default application

Return type:

FrameworkPromptProvider

Raises:

ValueError – If no providers are registered or specified provider not found

Note

This function is the recommended way to access prompt providers from framework infrastructure components. It provides consistent error handling and integrates with the application registry system.

Examples

Framework infrastructure usage:

# In orchestration_node.py
prompt_provider = get_framework_prompts()
orchestrator_builder = prompt_provider.get_orchestrator_prompt_builder()
system_prompt = orchestrator_builder.get_system_instructions(
    capabilities=active_capabilities,
    context_manager=context_manager
)

Multi-application deployment:

# Use specific application's prompts
als_provider = get_framework_prompts("als_expert")
wind_provider = get_framework_prompts("wind_turbine")

Error handling pattern:

try:
    provider = get_framework_prompts()
except ValueError as e:
    logger.error(f"Prompt provider not configured: {e}")
    # Fallback to framework defaults or fail gracefully

See also

register_framework_prompt_provider() : Provider registration FrameworkPromptProvider : Provider interface definition FrameworkPromptLoader : Underlying registry implementation

Application Provider Interface#

class framework.prompts.loader.FrameworkPromptProvider[source]#

Bases: object

Abstract provider interface for framework prompt builders with dependency injection support.

This class defines the contract that applications must implement to provide domain-specific prompt builders to the framework infrastructure. It enables clean separation of concerns where the framework handles orchestration, task extraction, and response generation logic while applications provide the domain-specific prompts and terminology.

The provider pattern solves the architectural challenge of allowing framework infrastructure to use application-specific prompts without creating circular dependencies. Framework components request prompt builders through this abstract interface, and the registry system injects the appropriate application-specific implementations at runtime.

Prompt builders are organized into two categories:

Infrastructure Prompts: Used by core framework components like orchestration, task extraction, and response generation. These prompts control the fundamental behavior of the agent system.

Framework Capability Prompts: Used by built-in framework capabilities like memory extraction, time parsing, and Python execution. These prompts can be customized to use domain-specific terminology and examples.

Raises:

NotImplementedError – All methods must be implemented by concrete providers

Note

Applications typically inherit from this class and override only the prompt builders they want to customize, using framework defaults for the rest through composition patterns.

Warning

All methods in this interface must be implemented. Use framework defaults or delegation patterns if you don’t need custom behavior for specific prompts.

Examples

Basic application-specific provider:

class ALSPromptProvider(FrameworkPromptProvider):
    def __init__(self):
        # Use custom builders for key infrastructure prompts
        self._orchestrator = ALSOrchestratorPromptBuilder()
        self._task_extraction = ALSTaskExtractionPromptBuilder()

        # Use framework defaults for others
        from framework.prompts.defaults import DefaultPromptProvider
        self._defaults = DefaultPromptProvider()

    def get_orchestrator_prompt_builder(self):
        return self._orchestrator

    def get_task_extraction_prompt_builder(self):
        return self._task_extraction

    def get_classification_prompt_builder(self):
        # Delegate to framework default
        return self._defaults.get_classification_prompt_builder()

Registration in application registry:

framework_prompt_providers=[
    FrameworkPromptProviderRegistration(
        application_name="als_expert",
        module_path="applications.als_expert.framework_prompts",
        description="ALS-specific framework prompt provider",
        prompt_builders={
            "orchestrator": "ALSOrchestratorPromptBuilder",
            "task_extraction": "ALSTaskExtractionPromptBuilder"
            # Others use framework defaults
        }
    )
]

See also

FrameworkPromptBuilder : Base class for individual prompt builders FrameworkPromptLoader : Global loader for provider management register_framework_prompt_provider() : Provider registration function Prompt Customization : Complete customization guide

get_orchestrator_prompt_builder()[source]#

Provide prompt builder for execution planning and orchestration.

This prompt builder is used by the orchestration node to create detailed execution plans that break down user requests into specific, actionable steps. The orchestrator prompt is critical for the agent’s ability to coordinate multiple capabilities and manage complex workflows.

Returns:

Orchestrator prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

The orchestrator prompt heavily influences the agent’s planning capabilities and should include domain-specific planning patterns and capability integration guidance.

See also

OrchestrationNode : Infrastructure component that uses this prompt OrchestratorGuide : Planning guidance structure

get_task_extraction_prompt_builder()[source]#

Provide prompt builder for converting conversations into actionable tasks.

This prompt builder is used by the task extraction node to analyze conversation history and extract clear, actionable tasks. It’s responsible for understanding user intent and creating focused task descriptions that can be effectively planned and executed.

Returns:

Task extraction prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Task extraction prompts should include domain-specific terminology and examples to improve understanding of specialized requests.

See also

TaskExtractionNode : Infrastructure component that uses this prompt ExtractedTask : Output structure for extracted tasks

get_response_generation_prompt_builder()[source]#

Provide prompt builder for generating final user responses.

This prompt builder is used by the response generation system to create coherent, helpful responses based on execution results. It handles the synthesis of multiple execution outputs into user-friendly responses with appropriate formatting and context.

Returns:

Response generation prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Response generation prompts should reflect the application’s communication style and include domain-specific formatting guidelines.

See also

RespondCapability : Component that uses this prompt _get_base_system_prompt() : Response prompt composition

get_classification_prompt_builder()[source]#

Provide prompt builder for task and capability classification.

This prompt builder is used by the classification system to determine which capabilities are needed for specific tasks. It enables intelligent routing of tasks to appropriate capabilities based on content analysis and domain-specific patterns.

Returns:

Classification prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Classification prompts should include clear criteria for capability selection and domain-specific task categorization patterns.

See also

select_capabilities() : Task classification function TaskClassifierGuide : Classification guidance structure

get_error_analysis_prompt_builder()[source]#

Provide prompt builder for error analysis and recovery guidance.

This prompt builder is used by the error handling system to analyze failures and provide meaningful explanations to users. It focuses on translating technical errors into understandable explanations with appropriate recovery suggestions.

Returns:

Error analysis prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Error analysis prompts should provide domain-specific context for common failure modes and recovery patterns.

See also

ErrorNode : Infrastructure component for error handling ErrorClassification : Error categorization system

get_clarification_prompt_builder()[source]#

Provide prompt builder for generating clarifying questions.

This prompt builder is used by the clarification system to generate targeted questions when user requests are ambiguous or incomplete. It helps gather the specific information needed to provide accurate and helpful responses.

Returns:

Clarification prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Clarification prompts should include domain-specific question patterns and common ambiguity resolution strategies.

See also

ClarifyCapability : Component that uses this prompt ClarifyingQuestionsResponse : Output structure for questions

get_memory_extraction_prompt_builder()[source]#

Provide prompt builder for extracting memorable information from conversations.

This prompt builder is used by the memory extraction capability to identify and structure information that should be preserved for future reference. It focuses on extracting user preferences, important facts, and contextual information that enhances future interactions.

Returns:

Memory extraction prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Memory extraction prompts should include domain-specific patterns for identifying important information and user preferences.

See also

MemoryCapability : Framework capability that uses this prompt MemoryExtractionResult : Output structure for extracted memories

get_time_range_parsing_prompt_builder()[source]#

Provide prompt builder for parsing natural language time expressions.

This prompt builder is used by the time range parsing capability to convert natural language time expressions into structured datetime ranges. It handles relative expressions, absolute dates, and domain-specific time references.

Returns:

Time range parsing prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Time parsing prompts should include domain-specific time patterns and examples relevant to the application’s temporal context.

See also

TimeRangeParsingCapability : Framework capability that uses this prompt TimeRange : Output structure for parsed time ranges

get_python_prompt_builder()[source]#

Provide prompt builder for Python code generation and execution.

This prompt builder is used by the Python execution capability to generate and execute Python code for data analysis, calculations, and other computational tasks. It includes safety guidelines and domain-specific code patterns.

Returns:

Python capability prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Python prompts should include domain-specific libraries, patterns, and safety constraints appropriate for the application context.

See also

PythonCapability : Framework capability that uses this prompt PythonExecutionService : Code execution infrastructure

Provider Registry System#

class framework.prompts.loader.FrameworkPromptLoader[source]#

Bases: object

Global registry and dependency injection system for framework prompt providers.

This class manages the registration and retrieval of application-specific prompt providers, enabling the framework infrastructure to access domain-specific prompts without creating circular dependencies. It implements a service locator pattern with fail-fast error handling and clear diagnostics.

The loader maintains a registry of prompt providers keyed by application name, with automatic default provider selection and explicit provider override capabilities. It’s designed to be used as a singleton through the global module-level functions.

Parameters:
  • _providers (Dict[str, FrameworkPromptProvider]) – Registry of application prompt providers

  • _default_provider (Optional[str]) – Name of the default provider application

Note

This class is typically accessed through the module-level functions rather than instantiated directly. The global instance handles all framework prompt provider management.

Warning

Provider registration must occur during application initialization before any framework components attempt to access prompts.

Examples

Typical usage through module functions:

# Registration (usually in application initialization)
register_framework_prompt_provider("als_expert", ALSPromptProvider())

# Access (from framework infrastructure)
provider = get_framework_prompts()
orchestrator_builder = provider.get_orchestrator_prompt_builder()

Direct usage for testing or specialized cases:

loader = FrameworkPromptLoader()
loader.register_provider("test_app", TestPromptProvider())
provider = loader.get_provider("test_app")

See also

get_framework_prompts() : Primary access function register_framework_prompt_provider() : Provider registration FrameworkPromptProvider : Provider interface

Initialize empty prompt provider registry.

Creates a new loader instance with empty provider registry and no default provider. The first registered provider automatically becomes the default unless explicitly overridden.

__init__()[source]#

Initialize empty prompt provider registry.

Creates a new loader instance with empty provider registry and no default provider. The first registered provider automatically becomes the default unless explicitly overridden.

register_provider(application_name, provider)[source]#

Register a prompt provider for an application with automatic default selection.

Adds the provider to the registry and automatically sets it as the default if no default provider is currently configured. This enables simple single-application setups while supporting multi-application scenarios.

Parameters:
  • application_name (str) – Unique identifier for the application

  • provider (FrameworkPromptProvider) – Prompt provider implementation for the application

Note

The first registered provider automatically becomes the default. Use set_default_provider() to change the default selection.

Examples

Basic registration:

loader.register_provider("als_expert", ALSPromptProvider())
# als_expert becomes default if first registration

Multiple application registration:

loader.register_provider("als_expert", ALSPromptProvider())
loader.register_provider("wind_turbine", WindTurbinePromptProvider())
# als_expert remains default

See also

set_default_provider() : Explicit default provider selection get_provider() : Provider retrieval

set_default_provider(application_name)[source]#

Set the default prompt provider with validation.

Changes the default provider to the specified application, with validation to ensure the provider is already registered. The default provider is used when no specific application is requested.

Parameters:

application_name (str) – Name of registered application to use as default

Raises:

ValueError – If the specified provider is not registered

Examples

Setting default after multiple registrations:

loader.register_provider("als_expert", ALSPromptProvider())
loader.register_provider("wind_turbine", WindTurbinePromptProvider())
loader.set_default_provider("wind_turbine")
# wind_turbine is now default instead of als_expert

See also

register_provider() : Provider registration with auto-default get_provider() : Provider retrieval using defaults

get_provider(application_name=None)[source]#

Retrieve prompt provider with fail-fast error handling and clear diagnostics.

Returns the prompt provider for the specified application, or the default provider if no application is specified. Provides comprehensive error messages with available alternatives when providers are not found.

Parameters:

application_name (Optional[str]) – Specific application name, or None for default

Returns:

Prompt provider implementation for the application

Return type:

FrameworkPromptProvider

Raises:
  • ValueError – If no default provider is configured

  • ValueError – If specified provider is not found

Note

This method uses fail-fast error handling to catch configuration issues early in the application lifecycle with clear error messages.

Examples

Using default provider:

provider = loader.get_provider()  # Uses default
orchestrator = provider.get_orchestrator_prompt_builder()

Using specific provider:

provider = loader.get_provider("als_expert")
task_extractor = provider.get_task_extraction_prompt_builder()

Error handling:

try:
    provider = loader.get_provider("nonexistent")
except ValueError as e:
    print(f"Provider error: {e}")
    # Error includes list of available providers

See also

register_provider() : Provider registration set_default_provider() : Default provider management

Provider Registration#

framework.prompts.loader.register_framework_prompt_provider(application_name, provider)[source]#

Register an application-specific prompt provider in the global registry.

This function integrates application prompt providers with the framework’s dependency injection system. It’s typically called during application initialization to make domain-specific prompts available to framework infrastructure components.

The registration enables the framework to use application-specific terminology, examples, and patterns while maintaining clean architectural separation. The first registered provider automatically becomes the default for single-application deployments.

Parameters:
  • application_name (str) – Unique identifier for the application

  • provider (FrameworkPromptProvider) – Implementation of the prompt provider interface

Note

This function should be called during application initialization, typically from the application’s registry configuration or startup code.

Warning

Provider registration must occur before any framework components attempt to access prompts, or ValueError exceptions will be raised.

Examples

Application initialization:

# In als_expert/__init__.py or registry setup
from applications.als_expert.framework_prompts import ALSPromptProvider

register_framework_prompt_provider(
    "als_expert",
    ALSPromptProvider()
)

Multiple application setup:

register_framework_prompt_provider("als_expert", ALSPromptProvider())
register_framework_prompt_provider("wind_turbine", WindTurbinePromptProvider())
# First registration (als_expert) becomes default

Testing setup:

# In test fixtures
test_provider = MockPromptProvider()
register_framework_prompt_provider("test", test_provider)

See also

get_framework_prompts() : Provider access function set_default_framework_prompt_provider() : Default provider management FrameworkPromptProviderRegistration : Registry metadata structure

Framework Default Implementations#

class framework.prompts.defaults.DefaultPromptProvider[source]#

Bases: FrameworkPromptProvider

Default implementation of FrameworkPromptProvider using default builders.

__init__()[source]#
get_orchestrator_prompt_builder()[source]#

Provide prompt builder for execution planning and orchestration.

This prompt builder is used by the orchestration node to create detailed execution plans that break down user requests into specific, actionable steps. The orchestrator prompt is critical for the agent’s ability to coordinate multiple capabilities and manage complex workflows.

Returns:

Orchestrator prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

The orchestrator prompt heavily influences the agent’s planning capabilities and should include domain-specific planning patterns and capability integration guidance.

See also

OrchestrationNode : Infrastructure component that uses this prompt OrchestratorGuide : Planning guidance structure

get_task_extraction_prompt_builder()[source]#

Provide prompt builder for converting conversations into actionable tasks.

This prompt builder is used by the task extraction node to analyze conversation history and extract clear, actionable tasks. It’s responsible for understanding user intent and creating focused task descriptions that can be effectively planned and executed.

Returns:

Task extraction prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Task extraction prompts should include domain-specific terminology and examples to improve understanding of specialized requests.

See also

TaskExtractionNode : Infrastructure component that uses this prompt ExtractedTask : Output structure for extracted tasks

get_response_generation_prompt_builder()[source]#

Provide prompt builder for generating final user responses.

This prompt builder is used by the response generation system to create coherent, helpful responses based on execution results. It handles the synthesis of multiple execution outputs into user-friendly responses with appropriate formatting and context.

Returns:

Response generation prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Response generation prompts should reflect the application’s communication style and include domain-specific formatting guidelines.

See also

RespondCapability : Component that uses this prompt _get_base_system_prompt() : Response prompt composition

get_classification_prompt_builder()[source]#

Provide prompt builder for task and capability classification.

This prompt builder is used by the classification system to determine which capabilities are needed for specific tasks. It enables intelligent routing of tasks to appropriate capabilities based on content analysis and domain-specific patterns.

Returns:

Classification prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Classification prompts should include clear criteria for capability selection and domain-specific task categorization patterns.

See also

select_capabilities() : Task classification function TaskClassifierGuide : Classification guidance structure

get_error_analysis_prompt_builder()[source]#

Provide prompt builder for error analysis and recovery guidance.

This prompt builder is used by the error handling system to analyze failures and provide meaningful explanations to users. It focuses on translating technical errors into understandable explanations with appropriate recovery suggestions.

Returns:

Error analysis prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Error analysis prompts should provide domain-specific context for common failure modes and recovery patterns.

See also

ErrorNode : Infrastructure component for error handling ErrorClassification : Error categorization system

get_clarification_prompt_builder()[source]#

Provide prompt builder for generating clarifying questions.

This prompt builder is used by the clarification system to generate targeted questions when user requests are ambiguous or incomplete. It helps gather the specific information needed to provide accurate and helpful responses.

Returns:

Clarification prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Clarification prompts should include domain-specific question patterns and common ambiguity resolution strategies.

See also

ClarifyCapability : Component that uses this prompt ClarifyingQuestionsResponse : Output structure for questions

get_memory_extraction_prompt_builder()[source]#

Provide prompt builder for extracting memorable information from conversations.

This prompt builder is used by the memory extraction capability to identify and structure information that should be preserved for future reference. It focuses on extracting user preferences, important facts, and contextual information that enhances future interactions.

Returns:

Memory extraction prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Memory extraction prompts should include domain-specific patterns for identifying important information and user preferences.

See also

MemoryCapability : Framework capability that uses this prompt MemoryExtractionResult : Output structure for extracted memories

get_time_range_parsing_prompt_builder()[source]#

Provide prompt builder for parsing natural language time expressions.

This prompt builder is used by the time range parsing capability to convert natural language time expressions into structured datetime ranges. It handles relative expressions, absolute dates, and domain-specific time references.

Returns:

Time range parsing prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Time parsing prompts should include domain-specific time patterns and examples relevant to the application’s temporal context.

See also

TimeRangeParsingCapability : Framework capability that uses this prompt TimeRange : Output structure for parsed time ranges

get_python_prompt_builder()[source]#

Provide prompt builder for Python code generation and execution.

This prompt builder is used by the Python execution capability to generate and execute Python code for data analysis, calculations, and other computational tasks. It includes safety guidelines and domain-specific code patterns.

Returns:

Python capability prompt builder instance

Return type:

FrameworkPromptBuilder

Raises:

NotImplementedError – Must be implemented by concrete providers

Note

Python prompts should include domain-specific libraries, patterns, and safety constraints appropriate for the application context.

See also

PythonCapability : Framework capability that uses this prompt PythonExecutionService : Code execution infrastructure

See also

Registry System

Registry system for component management

Prompt Customization

Complete guide for customizing and developing prompts