-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
I have searched existing GitHub issues and confirmed this feature has not been previously requested.
Expected Behavior
Spring AI should provide a built-in Skill Extension Framework that enables developers to:
- Define reusable AI skills as self-contained, modular components that can be composed into larger AI applications
- Register skills dynamically at runtime with support for both eager and lazy loading strategies
- Manage skill lifecycle including initialization, configuration, and resource management
- Integrate skills with AI models seamlessly through a standardized tool/capability interface
- Discover and catalog skills with metadata support for documentation and versioning
Code Example:
// Define a Skill
@Skill(
name = "weather",
description = "Provides weather information for cities",
source = "example"
)
public class WeatherSkill {
@SkillInit
public static WeatherSkill create() {
return new WeatherSkill();
}
@SkillContent
public String content() {
return "# Weather Skill\nProvides weather information...";
}
@SkillTools
public List<ToolCallback> tools() {
return List.of(ToolCallbacks.from(this));
}
@Tool(description = "Get current weather for a city")
public String getWeather(String city) {
// Implementation
return weatherData;
}
}
// Register and use
SkillPoolManager poolManager = new DefaultSkillPoolManager();
ClassBasedSkillRegistrar registrar = ClassBasedSkillRegistrar.builder().build();
SkillDefinition definition = registrar.register(poolManager, WeatherSkill.class);Current Behavior
Currently, Spring AI lacks a unified framework for defining and managing reusable skills. This makes it difficult to:
- Create composable, self-contained AI capabilities
- Share skills across different applications and teams
- Manage skill versions and dependencies
- Provide standardized metadata and documentation for skills
- Integrate skills dynamically at runtime
Context
How this addresses real needs:
The Skill Extension Framework enables developers to build modular AI applications where business logic is encapsulated as reusable skills. This is particularly valuable for:
- Enterprise applications: Composing complex AI workflows from well-tested skill components
- Multi-tenant systems: Managing different skill sets per tenant or customer
- Skill marketplace scenarios: Sharing and discovering skills across teams and organizations
- Progressive AI enhancement: Adding new capabilities without modifying core application code
Current implementation:
We have successfully developed and open-sourced a production-ready Skill Extension Framework available at: https://github.com/semir-labs/spring-ai-skill-extension
The implementation includes:
- ✅ Full skill lifecycle management with multiple loading strategies
- ✅ Lazy and eager loading support for performance optimization
- ✅ Comprehensive skill registration and discovery mechanism
- ✅ Integration with Spring AI's tool/capability framework
- ✅ Full test coverage (8 test classes covering all core functionality)
- ✅ Complete adherence to Spring Framework coding standards (100% checkstyle compliant)
- ✅ Thorough documentation and examples
Status:
We are ready to contribute this feature as a PR to the Spring AI project. The implementation is stable, tested, and follows all Spring Framework guidelines.
Related Resources
- Open Source Reference Implementation: https://github.com/semir-labs/spring-ai-skill-extension
- Example Application: https://github.com/semir-labs/spring-ai-skill-extension/tree/main/example
Proposed Solution
Integration of the Skill Extension Framework as a new module (spring-ai-skill) in the Spring AI project, providing:
Proposed Solution
Integration of the Skill Extension Framework as a new module (spring-ai-skill) in the Spring AI project, providing:
- Core skill abstraction and lifecycle management
- Multiple registration strategies (class-based, instance-based)
- Skill pool and kit management
- Full integration with Spring's dependency injection
- Comprehensive documentation and examples
We are committed to maintaining this feature and addressing any feedback or enhancements from the Spring AI team.