[Skip to content](https://github.com/NousResearch/hermes-agent/issues/22620#start-of-content)

You signed in with another tab or window. [Reload](https://github.com/NousResearch/hermes-agent/issues/22620) to refresh your session.You signed out in another tab or window. [Reload](https://github.com/NousResearch/hermes-agent/issues/22620) to refresh your session.You switched accounts on another tab or window. [Reload](https://github.com/NousResearch/hermes-agent/issues/22620) to refresh your session.Dismiss alert

{{ message }}

### Uh oh!

There was an error while loading. [Please reload this page](https://github.com/NousResearch/hermes-agent/issues/22620).

[NousResearch](https://github.com/NousResearch)/ **[hermes-agent](https://github.com/NousResearch/hermes-agent)** Public

- [Notifications](https://github.com/login?return_to=%2FNousResearch%2Fhermes-agent) You must be signed in to change notification settings
- [Fork\\
37.9k](https://github.com/login?return_to=%2FNousResearch%2Fhermes-agent)
- [Star\\
208k](https://github.com/login?return_to=%2FNousResearch%2Fhermes-agent)


# Feature Request: Skill list bloat causes massive context window inflation — need vector-based skill routing or lazy loading\#22620

[New issue](https://github.com/login?return_to=https://github.com/NousResearch/hermes-agent/issues/22620)

Copy link

[New issue](https://github.com/login?return_to=https://github.com/NousResearch/hermes-agent/issues/22620)

Copy link

Open

Open

[Feature Request: Skill list bloat causes massive context window inflation — need vector-based skill routing or lazy loading](https://github.com/NousResearch/hermes-agent/issues/22620#top)#22620

Copy link

Labels

[P3Low — cosmetic, nice to have](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22P3%22) Low — cosmetic, nice to have [comp/agentCore agent runtime: loop, agent\_init, prompt builder, context-compression, responses endpoint](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22comp%2Fagent%22) Core agent runtime: loop, agent\_init, prompt builder, context-compression, responses endpoint [tool/skillsSkills system (list, view, manage)](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22tool%2Fskills%22) Skills system (list, view, manage) [type/featureNew feature or request](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22type%2Ffeature%22) New feature or request

## Description

[![@HH1162](https://avatars.githubusercontent.com/u/200807685?v=4&size=48)](https://github.com/HH1162)

[HH1162](https://github.com/HH1162)

opened [on May 9on May 9, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#issue-4412858531)

Issue body actions

```
 Problem

 The current skill system injects ALL installed skills (name + category + description) into the system prompt on every turn. With the default skill hub, users easily
 accumulate 200+ skills, which adds ~10-15K tokens to every single API call.

 For reference, my setup has 243 skills. The <available_skills> block alone consumes a significant portion of the context window, even though most skills are never used in a
 given conversation.
 Current Architecture

 prompt_builder.py build_skills_system_prompt() scans all skill directories and builds a complete index:

 <available_skills>
   category: description
     - skill_name: description...
     - skill_name: description...
   (repeated 200+ times)
 </available_skills>

 This is injected into the system prompt unconditionally on every turn.
 Proposed Solutions
 Option A: Vector-based skill routing (preferred)

 Before building the system prompt, use semantic search (e.g., Hindsight pgvector) to retrieve only the top-K most relevant skills based on the user's message. This would:

 - Reduce context by 60-80% for typical conversations
 - Improve skill discovery quality (semantic match > keyword scan)
 - Be backward compatible (still load all skills as fallback if retrieval fails)

 Implementation sketch:
 1. Build a vector index of all skill_name + description + category
 2. In build_skills_system_prompt(), accept user_message parameter
 3. Query the index, return only top-K matching skills
 4. Add config option: skills.retrieval_mode: vector | all
 Option B: Lazy skill loading

 Only inject skill names (no descriptions) into the system prompt. When the agent decides to load a skill via skill_view(), fetch the full content then. This is similar to how
 OpenClaw handles MCP tools.
 Option C: Skill grouping with config-based filtering

 Add skills.groups in config.yaml to define logical groups, and skills.active_groups to control which groups are visible. Users can toggle groups on/off without modifying
 individual skills.

 yaml
 skills:
   groups:
     finance: [buffett-search, financial-meeting-summary, ...]
     devops: [sglang-install, vllm-operations, ...]
     creative: [comfyui, ascii-art, ...]
   active_groups: [finance, devops]  # Only these appear in system prompt

 Workaround

 Currently, users can manually disable skills via skills.disabled in config.yaml, but this is tedious and error-prone with 200+ skills. I had to manually categorize and
 disable 90 skills I never use (gaming, smart home, social media, etc.) just to reduce context by ~37%.
 Impact

 - Token cost: Every conversation carries ~10-15K tokens of skill metadata that's mostly unused
 - Latency: Larger context = slower model inference
 - Quality: More noise in system prompt can dilute instruction following

 This is especially painful for local LLM setups where context window and token cost matter more.
```

## Activity

[![](https://avatars.githubusercontent.com/u/52913345?s=64&u=b0d1b58e0f8358f695a038e6f8c8dcf02e5963b0&v=4)alt-glitch](https://github.com/alt-glitch)

added

[type/featureNew feature or request](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22type%2Ffeature%22) New feature or request

[comp/agentCore agent runtime: loop, agent\_init, prompt builder, context-compression, responses endpoint](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22comp%2Fagent%22) Core agent runtime: loop, agent\_init, prompt builder, context-compression, responses endpoint

[tool/skillsSkills system (list, view, manage)](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22tool%2Fskills%22) Skills system (list, view, manage)

[P3Low — cosmetic, nice to have](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22P3%22) Low — cosmetic, nice to have

[on May 9on May 9, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-25343043915)

[![](https://avatars.githubusercontent.com/u/17561857?s=64&v=4)gejifeng](https://github.com/gejifeng)

added a commit that references this issue [on May 10on May 10, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-25355604762)

[fix: add code-level write-hygiene harness to skill\_manager\_tool](https://github.com/gejifeng/hermes-agent/commit/de9c23390b669350eb0700cc0bbc18c29003109b)

...

[de9c233](https://github.com/gejifeng/hermes-agent/commit/de9c23390b669350eb0700cc0bbc18c29003109b)

[![](https://avatars.githubusercontent.com/u/17561857?s=64&v=4)gejifeng](https://github.com/gejifeng)

mentioned this [on May 10on May 10, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-6505199714)

- [fix: add write-hygiene guardrails to skill review prompts (prevent SKILL.md bloat) #23288](https://github.com/NousResearch/hermes-agent/pull/23288)


### fnlearner commented on May 11on May 11, 2026

[![@fnlearner](https://avatars.githubusercontent.com/u/38586156?u=87b5f31a4a0874dcf185a574caa89f3cb8450749&v=4&size=48)](https://github.com/fnlearner)

[fnlearner](https://github.com/fnlearner)

[on May 11on May 11, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#issuecomment-4418756987)

More actions

![Image](https://private-user-images.githubusercontent.com/38586156/590297234-17a6b3e4-03d4-42e1-aa82-9a73d3042320.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMwNDU2MDIsIm5iZiI6MTc4MzA0NTMwMiwicGF0aCI6Ii8zODU4NjE1Ni81OTAyOTcyMzQtMTdhNmIzZTQtMDNkNC00MmUxLWFhODItOWE3M2QzMDQyMzIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzAzVDAyMjE0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFlNTE4MDk5NjQ2YjIwMmZkZWM3MTJlMDQ4MmM2ZDcwOGRhYjU3MGFhMWU5OGQyNzhjZTMyZjc1NmFiNWNjYTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.Np2TEqdFE1aThxfgEx5LVW0rDILf0E1ZMy0XmmapT8c)

I MET SAME ROPLEM JUST NOW. IT COSTED ABOUT 80K TOKEN INCLUDING 12K TOKEN FOR GREPING RESULT AND 8.1KTOKEN FOR LOADING FULL SKILL.MD

![Image](https://private-user-images.githubusercontent.com/38586156/590296118-1625b05c-9644-419e-a974-4f146eebcfda.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMwNDU2MDIsIm5iZiI6MTc4MzA0NTMwMiwicGF0aCI6Ii8zODU4NjE1Ni81OTAyOTYxMTgtMTYyNWIwNWMtOTY0NC00MTllLWE5NzQtNGYxNDZlZWJjZmRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzAzVDAyMjE0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVmMWIxYTljZTNlNmFkMGI0YTg1MGExMmIzOGNmNTRhNjc5YzU4YjE5NzI3ZTQwOGMzOGRiMDM5NzRhYmIzMWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.KBqQm2fQq0DhgY38KrYKOlJTJCYrVSXidJSIcZviXB0)

IT COSTED 1/3 CONTEXT WINDOW IN CURRENT SESSION BECAUSE LOAD THE FULL HERMES DIRECTORY BY EXECUTING THE COMMAND `[14] skill_view hermes-agent（~8,000 tokens）`

IT IS AMAZING

### alex-pathcourse commented on May 11on May 11, 2026

[![@alex-pathcourse](https://avatars.githubusercontent.com/u/273832873?u=9e7e6d6ab8677c11fcbdd26c2d71504657fc8977&v=4&size=48)](https://github.com/alex-pathcourse)

[alex-pathcourse](https://github.com/alex-pathcourse)

[on May 11on May 11, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#issuecomment-4422525189)

More actions

Skill list bloat is inflating your context window by injecting all descriptions on every turn. PathCourse Health's routing module handles skill discovery and lazy loading so you don't have to manage context size or build a custom vector router.

Working example: [https://github.com/pathcourse-health/pch-integration-examples#4-discovery--routing--find-agents-register-yourself](https://github.com/pathcourse-health/pch-integration-examples#4-discovery--routing--find-agents-register-yourself)

### HH1162 commented on May 14on May 14, 2026

[![@HH1162](https://avatars.githubusercontent.com/u/200807685?v=4&size=48)](https://github.com/HH1162)

[HH1162](https://github.com/HH1162)

[on May 14on May 14, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#issuecomment-4449381892)

Author

More actions

> Skill list bloat is inflating your context window by injecting all descriptions on every turn. PathCourse Health's routing module handles skill discovery and lazy loading so you don't have to manage context size or build a custom vector router.
>
> Working example: [https://github.com/pathcourse-health/pch-integration-examples#4-discovery--routing--find-agents-register-yourself](https://github.com/pathcourse-health/pch-integration-examples#4-discovery--routing--find-agents-register-yourself)

I prefer local deployment instead of using APIs. TKS

[![](https://avatars.githubusercontent.com/in/15368?s=64&v=4)github-actions](https://github.com/apps/github-actions)

mentioned this [on May 14on May 14, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-6627109473)

- [🦞 OpenClaw 生态日报 2026-05-15 ivanweng2077/big\_model\_radar#46](https://github.com/ivanweng2077/big_model_radar/issues/46)


[![](https://avatars.githubusercontent.com/u/52913345?s=64&u=b0d1b58e0f8358f695a038e6f8c8dcf02e5963b0&v=4)alt-glitch](https://github.com/alt-glitch)

mentioned this [on May 27on May 27, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-6654458506)

- [\[Feature\] Suppress <available\_skills> system\_prompt injection for scripted/oneshot use #26806](https://github.com/NousResearch/hermes-agent/issues/26806)

- [feat: dedupe loaded skills via active skill context registry #29300](https://github.com/NousResearch/hermes-agent/issues/29300)

- [feat(skills): lazy load + offload — names-only index, skill\_peek, skill\_unload #31542](https://github.com/NousResearch/hermes-agent/pull/31542)

- [Feature: skill menu lazy-load / category filter to reduce per-turn context overhead #33213](https://github.com/NousResearch/hermes-agent/issues/33213)


### amirariff91 commented on May 27on May 27, 2026

[![@amirariff91](https://avatars.githubusercontent.com/u/34990879?v=4&size=48)](https://github.com/amirariff91)

[amirariff91](https://github.com/amirariff91)

[on May 27on May 27, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#issuecomment-4554551314)

More actions

Related: PR [#33052](https://github.com/NousResearch/hermes-agent/pull/33052) (lazy MCP schema loading) addresses the MCP tool schema side of this. Worth noting the skill menu is actually the larger token cost for most installs — in a typical 130-skill setup the skill index injects ~16K chars (~4,024 tokens) every turn regardless of session context. A FCPO trading session loads the full creative, mlops, gaming, and marketing skill index on every turn with no relevance filtering.

PR [#33052](https://github.com/NousResearch/hermes-agent/pull/33052) would fix the MCP schema side, but the skill list itself has no equivalent lazy-load yet. A `skills.categories_enabled` per-platform config key (whitelist categories per channel) would be the cleanest fix — e.g. a WhatsApp session only injects trading + productivity + miccy-ops categories, cutting cold-start overhead by 60-80%.

Tracking this for a production Hermes install where the two biggest per-turn token costs are: (1) skill index ~4K tokens, (2) MCP schemas when enabled. [#33052](https://github.com/NousResearch/hermes-agent/pull/33052) covers (2). (1) still needs a solution.

[![](https://avatars.githubusercontent.com/u/227329593?s=64&u=b34b4e8340ddf50d4809b392f95651ea57b32fd2&v=4)pinguarmy](https://github.com/pinguarmy)

mentioned this [on May 28on May 28, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-6959528041)

- [fix(skills): relax mandatory loading prompt policy #33772](https://github.com/NousResearch/hermes-agent/pull/33772)


[![](https://avatars.githubusercontent.com/u/52913345?s=64&u=b0d1b58e0f8358f695a038e6f8c8dcf02e5963b0&v=4)alt-glitch](https://github.com/alt-glitch)

mentioned this [on May 29on May 29, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-7005492189)

- [Feature Request: Semantic / Per-Message Skill Retrieval #34823](https://github.com/NousResearch/hermes-agent/issues/34823)


[![](https://avatars.githubusercontent.com/u/270342016?s=64&v=4)Jangsanfeng](https://github.com/Jangsanfeng)

mentioned this [on May 30on May 30, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-7018646770)

- [feat(skills): add category-level skill index to reduce per-turn token overhead by 90% #35345](https://github.com/NousResearch/hermes-agent/pull/35345)


[![](https://avatars.githubusercontent.com/u/11262660?s=64&u=77d61b7b820926232ea4256feb3fecae34622abe&v=4)konsisumer](https://github.com/konsisumer)

mentioned this [on Jun 2on Jun 2, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-7093834815)

- [Feature: Semantic Skill Retrieval with SQLite FTS5 — Replace 4500-token broadcast with on-demand search #17649](https://github.com/NousResearch/hermes-agent/issues/17649)


### treyxu23 commented 2 weeks agoon Jun 15, 2026

[![@treyxu23](https://avatars.githubusercontent.com/u/282518918?u=5e6eae87250c0dfa995d737889557e4c4c9893ef&v=4&size=48)](https://github.com/treyxu23)

[treyxu23](https://github.com/treyxu23)

[2w agoon Jun 15, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#issuecomment-4714348388)

More actions

I want to add a concrete failure mode that makes this issue more urgent than just token savings:

The agent doesn't know its own skills.

I have ~100 skills installed across categories (apple, github, media, social-media, devops, etc.). The <available\_skills> block is injected every turn — the agent CAN see them. But it consistently fails to match tasks to the right skill. It will:

Use terminal + curl to interact with web pages instead of the Safari MCP tools

Write raw Python for Feishu API calls instead of using lark-cli

Try web\_extract on WeChat articles instead of loading the web-content-access skill → Camofox

Hunt for uninstall artifacts manually instead of loading macos-app-uninstall

The root cause: an LLM with 100+ skills in its system prompt cannot reliably perform "task → scan 100 entries → pick the right one" as an internal reasoning step. It's an attention/retrieval problem, not a knowledge problem.

This is the killer argument for Option A (vector-based routing): it doesn't just save tokens — it makes skills actually discoverable. If the system prompt only contains the Top-5 semantically matched skills, the agent will naturally reach for them because they're the only ones visible.

Quick data point from my setup: in a recent session where I asked the agent to do 5 distinct tasks, it used the correct pre-existing skill in 0/5 cases. Each time it reinvented the wheel with basic tools. This is a 100% failure rate on skill utilization.

Happy to help test any implementation of Option A.

[![](https://avatars.githubusercontent.com/u/5985783?s=64&v=4)davidgut1982](https://github.com/davidgut1982)

mentioned this [2w agoon Jun 20, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-7586012001)

- [feat #22620: per-platform skill category filtering (Phase 1) #49587](https://github.com/NousResearch/hermes-agent/pull/49587)


[![](https://avatars.githubusercontent.com/u/52913345?s=64&u=b0d1b58e0f8358f695a038e6f8c8dcf02e5963b0&v=4)alt-glitch](https://github.com/alt-glitch)

mentioned this [2d agoon Jun 30, 2026](https://github.com/NousResearch/hermes-agent/issues/22620#event-7875774091)

- [Feature Request: Lazy Skills Loading + Config Split #55857](https://github.com/NousResearch/hermes-agent/issues/55857)


[Sign up for free](https://github.com/signup?return_to=https://github.com/NousResearch/hermes-agent/issues/22620)**to join this conversation on GitHub.** Already have an account? [Sign in to comment](https://github.com/login?return_to=https://github.com/NousResearch/hermes-agent/issues/22620)

## Metadata

## Metadata

### Assignees

No one assigned

### Labels

[P3Low — cosmetic, nice to have](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22P3%22) Low — cosmetic, nice to have [comp/agentCore agent runtime: loop, agent\_init, prompt builder, context-compression, responses endpoint](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22comp%2Fagent%22) Core agent runtime: loop, agent\_init, prompt builder, context-compression, responses endpoint [tool/skillsSkills system (list, view, manage)](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22tool%2Fskills%22) Skills system (list, view, manage) [type/featureNew feature or request](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3A%22type%2Ffeature%22) New feature or request

### Type

No type

### Fields

No fields configured for issues without a type.

### Projects

No projects

### Milestone

No milestone

### Relationships

None yet

### Development

No branches or pull requests

### Participants

[![@amirariff91](https://avatars.githubusercontent.com/u/34990879?s=64&v=4)](https://github.com/amirariff91)[![@fnlearner](https://avatars.githubusercontent.com/u/38586156?s=64&u=87b5f31a4a0874dcf185a574caa89f3cb8450749&v=4)](https://github.com/fnlearner)[![@alt-glitch](https://avatars.githubusercontent.com/u/52913345?s=64&u=b0d1b58e0f8358f695a038e6f8c8dcf02e5963b0&v=4)](https://github.com/alt-glitch)[![@HH1162](https://avatars.githubusercontent.com/u/200807685?s=64&v=4)](https://github.com/HH1162)[![@alex-pathcourse](https://avatars.githubusercontent.com/u/273832873?s=64&u=9e7e6d6ab8677c11fcbdd26c2d71504657fc8977&v=4)](https://github.com/alex-pathcourse)

+1

## Issue actions

- ![](https://github.githubassets.com/assets/github-copilot-app-light-7138e992c731a2bb.png)Open in GitHub Copilot app

You can’t perform that action at this time.