ratel_ai_core/skill.rs
1use std::collections::HashMap;
2
3/// A skill registered for retrieval — the on-demand analog of a [`crate::Tool`].
4///
5/// `name`, `description`, and `tags` drive ranking (see [`crate::skill_indexing`]).
6/// `tags` are author-declared labels and task phrases ("frontend", "login form")
7/// folded into the BM25 text so a terse intent prompt matches the skill. `tools`
8/// are the ids of tools the body's instructions call — an explicit dependency
9/// edge, **not** indexed; the gateway pulls them into the `search_capabilities`
10/// tools bucket so the agent gets a skill and the tools it needs in one turn
11/// instead of a second search. `metadata` is free-form, non-indexed context for
12/// higher layers — e.g. `{"stacks": ["react"]}` for the push-path ranker to
13/// boost/filter by project context, deliberately *not* matched as query terms.
14/// `body` is the dispatch payload and is also not indexed, so a long body never
15/// skews relevance.
16pub struct Skill {
17 pub id: String,
18 pub name: String,
19 pub description: String,
20 pub tags: Vec<String>,
21 pub tools: Vec<String>,
22 pub metadata: HashMap<String, Vec<String>>,
23 pub body: String,
24}