Agent Platform
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 thecom.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"
Content copied to clipboard)
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:
- EnableAgentShell - Adds
@AgentPlatform("shell")
- EnableAgentMcpServer - Adds
@AgentPlatform("mcp-server")
- EnableAgentBedrock - Adds
@AgentPlatform("shell, bedrock")
- EnableAgents - Adds
@AgentPlatform
with default value
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