Annotation EnableAgents

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

    @Retention(value = RetentionPolicy.RUNTIME)@Target(value = ElementType.TYPE) 
    public @interface EnableAgents
    
                        

    Enables the Embabel Agent framework with auto-configuration support.

    This annotation triggers the import of agent-related configuration classes and activates appropriate Spring profiles based on the specified attributes. It serves as the foundation for more specialized annotations like @EnableAgentShell and @EnableAgentMcp.

    
    
    
        loggingTheme = "starwars",
        localModels = {"ollama", "docker"},
        mcpClients = {"filesystem", "github"}
    )
    public class MyAgentApplication {
        public static void main(String[] args) {
            SpringApplication.run(MyAgentApplication.class, args);
        }
    }
    

    This annotation activates Spring profiles based on the provided attributes:

    • loggingTheme - Activates a theme-specific profile (e.g., "starwars", "severance")
    • localModels - Activates profiles for local AI model providers
    • mcpClients - Activates profiles for Model Context Protocol clients
    Since:

    0.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 String loggingTheme() Specifies the logging theme to use for agent operations.
      abstract Array<String> localModels() Specifies local AI model providers to enable.
      abstract Array<String> mcpServers() Specifies Model Context Protocol (MCP) clients to enable.
      • 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

      • loggingTheme

         abstract String loggingTheme()

        Specifies the logging theme to use for agent operations.

        If set, this activates a corresponding Spring profile that customizes logging output with themed messages and formatting.

        Supported themes:
        • "starwars" - Star Wars themed logging messages
        • "severance" - Corporate/Severance themed logging
        • "" (default) - Standard logging without theming
        Example:
        
        = LoggingThemes.STAR_WARS)
        // Outputs: "May the Force be with your agents!"
        
        Returns:

        the logging theme name, or empty string for default logging

      • localModels

        @Deprecated(since = "0.1.3", forRemoval = true) abstract Array<String> localModels()

        Specifies local AI model providers to enable.

        This attribute configures which local model providers should be initialized and made available to agents. Each value activates a corresponding Spring profile and loads provider-specific configuration.

        Common providers:
        • "ollama" - Ollama local model server
        • "docker" - Docker-based model containers
        • "llamacpp" - LLaMA C++ implementation
        Example:
        
        = {LocalModels.OLLAMA, LocalModels.DOCKER"})
        // Enables both Ollama and Docker-based models
        
        Returns:

        array of local model provider identifiers

      • mcpServers

         abstract Array<String> mcpServers()

        Specifies Model Context Protocol (MCP) clients to enable.

        MCP clients allow agents to interact with external tools and data sources through the standardized Model Context Protocol. Each value activates a corresponding integration module.

        Example:
        
        = {"filesystem", "github", "postgres"})
        // Enables file system, GitHub, and PostgresSQL MCP clients
        
        Security Note:

        Each MCP server specified may require additional configuration and authentication. Ensure proper credentials are configured before enabling clients.

        Returns:

        array of MCP server identifiers to enable and connect to