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.

Primary Purpose:

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.).

What This Annotation Does:

  • 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")

Usage as Meta-Annotation:


// Creating a custom agent annotation



public @interface EnableMyAgentPlatform {
}

Direct Usage (Rare):


// Only for advanced customization

"custom-profile-2"
) public class CustomAgentApplication { } }

Platform Profiles:

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

Component Discovery:

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

Relationship to Other Annotations:

This annotation is used as a building block by:

Advanced Configuration:

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

Implementation Note:

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

Since

1.0

Author

Embabel Team

See also

Functions

Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun toString(): String
Link copied to clipboard
abstract fun value(): Array<String>
Specifies the platform profiles to activate.