You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(skill): BM25-based smart skill retrieval for large catalogues
When >80 skills are installed, the system prompt switches from a full
listing to a compact name-only format. The model discovers skills via
the Skill tool's new action:"search" endpoint backed by a BM25 index.
Three tiers by skill count:
≤ 80: legacy full listing (prompt-cache optimal)
81-300: compact name + description + search
> 300: names only + search required
Key changes:
- skill/search.ts: BM25 index with synonym expansion (zero deps)
- skill/registry.ts: auto-detect tier, lazy content loading
- skill/parser.ts: parseSkillMetaFromFile (frontmatter-only)
- skill-tool.ts: search action on existing Skill tool
- system.md: search-first workflow instructions
Performance (measured with 1,530 real skills):
- System prompt: 118K → 8.4K tokens (93% reduction)
- Startup memory: 88MB → 4MB (95% reduction)
- Search latency: 0.0-0.2ms per query
- Lazy content load: 0.4ms per skill activation
Closes#725
Add BM25-based skill search for large catalogues. When >80 skills are installed, the system prompt switches from a full listing to a compact name-only format and the model discovers skills via the Skill tool's new `action: "search"` endpoint. Startup memory reduced ~95% via lazy content loading.
Copy file name to clipboardExpand all lines: packages/agent-core/src/profile/default/system.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,9 +148,12 @@ Skills are grouped by scope (`Project`, `User`, `Extra`, `Built-in`) so you can
148
148
149
149
## How to use skills
150
150
151
-
Identify the skills that are likely to be useful for the tasks you are currently working on, read the skill file for detailed instructions, guidelines, scripts and more.
151
+
When you need a skill, follow this two-step process:
152
152
153
-
Only read skill details when needed to conserve the context window.
153
+
1.**Search**: Call the `Skill` tool with `action: "search"` and relevant keywords to find matching skills. The search returns ranked results instantly.
154
+
2.**Load**: Once you identify the right skill from search results, call the `Skill` tool with `action: "load"` and the skill name to load its full instructions into context.
155
+
156
+
Only read skill details when needed to conserve the context window. Do NOT guess skill names — always search first when the skill listing above does not contain enough detail.
0 commit comments