Annotation AgentPlatform

  • All Implemented Interfaces:
    java.lang.annotation.Annotation

    @Retention(value = RetentionPolicy.RUNTIME)@Target(value = ElementType.TYPE)@Deprecated(since = "0.1.3", forRemoval = true) 
    public @interface AgentPlatform
    
                        

    Core meta-annotation that enables the Embabel Agent platform infrastructure.

    This annotation serves as the foundation for all agent-specific annotations in the Embabel framework. It bootstraps the agent platform by importing necessary auto-configuration, scanning for components, and activating platform-specific Spring profiles.

    This is a meta-annotation designed to be used on other annotations rather than directly on application classes. It provides the common configuration needed by all agent platform variants (Shell, MCP Server, Bedrock, etc.).

    • Imports Auto-Configuration: Loads AgentPlatformAutoConfiguration which sets up core agent infrastructure
    • Scans Configuration Properties: Discovers all @ConfigurationProperties classes in the com.embabel.agent package
    • Component Scanning: Registers all Spring components in the com.embabel.agent.autoconfigure package
    • Profile Activation: Activates Spring profiles based on the value attribute (e.g., "shell", "mcp-server", "bedrock")
    
    // Creating a custom agent annotation
    
    
    
    public @interface EnableMyAgentPlatform {
    }
    
    
    // Only for advanced customization
    
    "custom-profile-2"
    ) public class CustomAgentApplication { } }

    The value attribute specifies which Spring profiles to activate:

    • "default" - Basic agent platform without specific features
    • "shell" - Interactive command-line interface mode
    • "mcp-server" - Model Context Protocol server mode
    • "bedrock" - AWS Bedrock integration mode
    • "a2a-server" - Agent-to-Agent communication server

    This annotation ensures the following are discovered and registered:

    • All @Agent annotated classes
    • Custom @Tool implementations
    • Agent @Repository interfaces
    • Configuration properties for agent behavior
    • Auto-configuration classes for platform features

    This annotation is used as a building block by:

    When multiple @AgentPlatform annotations are present (through meta-annotations), their profiles are merged. For example:

    
           // Contributes "shell"
         // Contributes "shell, bedrock"
    // Result: Profiles "shell" and "bedrock" are both active
    

    The actual profile activation is handled by EnvironmentPostProcessor which processes this annotation during the Spring Boot startup sequence.

    Since:

    1.0

    Author:

    Embabel Team

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Array<String> value() Specifies the platform profiles to activate.
      • Methods inherited from class java.lang.annotation.Annotation

        annotationType, equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • value

         abstract Array<String> value()

        Specifies the platform profiles to activate.

        Each value in this array will be registered as an active Spring profile, enabling platform-specific configurations and beans.

        Common Values:
        • "shell" - Interactive CLI mode
        • "mcp-server" - MCP protocol server
        • "bedrock" - AWS Bedrock integration
        Multiple Profiles:

        Multiple profiles can be specified to combine features:

        
        "metrics", "observability"
        ) }
        Returns:

        array of profile names to activate