Installation
Add FastSkill to yourCargo.toml:
The Rust API requires tokio for async/await support. All service methods are asynchronous.
FastSkillService
The main service struct that provides access to all FastSkill functionality.Constructor
Lifecycle Methods
new(config: ServiceConfig) -> Result<Self, ServiceError>
Create a new service instance with the provided configuration.
Parameters:
config: Service configuration including skill storage path, embedding settings, etc.
Result<FastSkillService, ServiceError>
Example:
initialize(&mut self) -> Result<(), ServiceError>
Initialize the service and load all components. Must be called before using other methods.
Returns: Result<(), ServiceError>
Example:
shutdown(&mut self) -> Result<(), ServiceError>
Gracefully shut down the service and clean up resources. Should be called when done.
Returns: Result<(), ServiceError>
Example:
is_initialized(&self) -> bool
Check if the service has been initialized.
Returns: bool
Service Accessors
skill_manager(&self) -> Arc<dyn SkillManagementService>
Get the skill management service for CRUD operations on skills.
Returns: Arc<dyn SkillManagementService>
Example:
metadata_service(&self) -> Arc<dyn MetadataService>
Get the metadata service for skill discovery and search.
Returns: Arc<dyn MetadataService>
Example:
vector_index_service(&self) -> Option<Arc<dyn VectorIndexService>>
Get the vector index service for semantic search (if embedding is configured).
Returns: Option<Arc<dyn VectorIndexService>>
Example:
loading_service(&self) -> Arc<dyn ProgressiveLoadingService>
Get the progressive loading service for on-demand skill content loading.
Returns: Arc<dyn ProgressiveLoadingService>
tool_service(&self) -> Arc<dyn ToolCallingService>
Get the tool calling service for executing skill tools.
Returns: Arc<dyn ToolCallingService>
routing_service(&self) -> Arc<dyn RoutingService>
Get the routing service for intelligent skill routing.
Returns: Arc<dyn RoutingService>
config(&self) -> &ServiceConfig
Get the service configuration.
Returns: &ServiceConfig
ServiceConfig
Main configuration struct for the FastSkill service.Fields
skill_storage_path: PathBuf- Base directory for skill storageexecution: ExecutionConfig- Execution configurationhot_reload: HotReloadConfig- Hot reloading configurationcache: CacheConfig- Cache configurationembedding: Option<EmbeddingConfig>- Embedding configuration (optional, required for semantic search)security: SecurityConfig- Security configuration
Example
SkillManagementService
Trait for managing skills (CRUD operations).Methods
register_skill(&self, skill: SkillDefinition) -> Result<SkillId, ServiceError>
Register a new skill with the service.
Parameters:
skill: Skill definition to register
Result<SkillId, ServiceError>
Example:
force_register_skill(&self, skill: SkillDefinition) -> Result<SkillId, ServiceError>
Force register a skill, overwriting if it already exists.
Parameters:
skill: Skill definition to register
Result<SkillId, ServiceError>
get_skill(&self, skill_id: &SkillId) -> Result<Option<SkillDefinition>, ServiceError>
Get a skill by ID.
Parameters:
skill_id: ID of the skill to retrieve
Result<Option<SkillDefinition>, ServiceError>
Example:
update_skill(&self, skill_id: &SkillId, updates: SkillUpdate) -> Result<(), ServiceError>
Update an existing skill.
Parameters:
skill_id: ID of the skill to updateupdates: Fields to update
Result<(), ServiceError>
unregister_skill(&self, skill_id: &SkillId) -> Result<(), ServiceError>
Unregister a skill from the service.
Parameters:
skill_id: ID of the skill to unregister
Result<(), ServiceError>
list_skills(&self, filters: Option<SkillFilters>) -> Result<Vec<SkillDefinition>, ServiceError>
List all registered skills with optional filtering.
Parameters:
filters: Optional filter criteria
Result<Vec<SkillDefinition>, ServiceError>
Example:
enable_skill(&self, skill_id: &SkillId) -> Result<(), ServiceError>
Enable a disabled skill.
Parameters:
skill_id: ID of the skill to enable
Result<(), ServiceError>
disable_skill(&self, skill_id: &SkillId) -> Result<(), ServiceError>
Disable an active skill.
Parameters:
skill_id: ID of the skill to disable
Result<(), ServiceError>
MetadataService
Trait for skill discovery and metadata operations.Methods
discover_skills(&self, query: &str) -> Result<Vec<SkillMetadata>, ServiceError>
Discover skills relevant to a query using natural language processing.
Parameters:
query: Search query string
Result<Vec<SkillMetadata>, ServiceError>
Example:
find_skills_by_capability(&self, capability: &str) -> Result<Vec<SkillMetadata>, ServiceError>
Find skills that provide a specific capability.
Parameters:
capability: Capability to search for
Result<Vec<SkillMetadata>, ServiceError>
Example:
find_skills_by_tag(&self, tag: &str) -> Result<Vec<SkillMetadata>, ServiceError>
Find skills with a specific tag.
Parameters:
tag: Tag to search for
Result<Vec<SkillMetadata>, ServiceError>
Example:
search_skills(&self, query: &str) -> Result<Vec<SkillMetadata>, ServiceError>
Search skills using keyword matching.
Parameters:
query: Search query string
Result<Vec<SkillMetadata>, ServiceError>
get_available_capabilities(&self) -> Result<Vec<String>, ServiceError>
Get all available capabilities across all skills.
Returns: Result<Vec<String>, ServiceError>
get_skill_frontmatter(&self, skill_id: &str) -> Result<SkillFrontmatter, ServiceError>
Get the frontmatter for a specific skill.
Parameters:
skill_id: ID of the skill
Result<SkillFrontmatter, ServiceError>
VectorIndexService
Trait for semantic search using vector embeddings.Methods
search(&self, query: &str, limit: usize) -> Result<Vec<SkillMatch>, ServiceError>
Search for skills using semantic similarity.
Parameters:
query: Search query stringlimit: Maximum number of results
Result<Vec<SkillMatch>, ServiceError>
Example:
index_skill(&self, skill_id: &str, metadata: &SkillMetadata) -> Result<(), ServiceError>
Index a skill for semantic search.
Parameters:
skill_id: ID of the skill to indexmetadata: Skill metadata
Result<(), ServiceError>
reindex_all(&self) -> Result<(), ServiceError>
Reindex all skills in the vector index.
Returns: Result<(), ServiceError>
RoutingService
Trait for intelligent skill routing.Methods
find_relevant_skills(&self, query: &str, context: Option<QueryContext>) -> Result<Vec<RoutedSkill>, ServiceError>
Find the most relevant skills for a query using intelligent routing.
Parameters:
query: Search query stringcontext: Optional query context (tokens, conversation history, etc.)
Result<Vec<RoutedSkill>, ServiceError>
Example:
ToolCallingService
Trait for tool execution.Methods
get_available_tools(&self) -> Result<Vec<AvailableTool>, ServiceError>
Get all available tools.
Returns: Result<Vec<AvailableTool>, ServiceError>
ProgressiveLoadingService
Trait for progressive loading of skill content.Methods
load_metadata(&self, skill_ids: &[String]) -> Result<Vec<LoadedSkill>, ServiceError>
Load metadata for specific skills.
Parameters:
skill_ids: List of skill IDs to load metadata for
Result<Vec<LoadedSkill>, ServiceError>
load_content(&self, skill_ids: &[String]) -> Result<Vec<LoadedSkill>, ServiceError>
Load full content for specific skills.
Parameters:
skill_ids: List of skill IDs to load content for
Result<Vec<LoadedSkill>, ServiceError>