
Per-turn skill selection for LangChain and deepagents agents: a fast judge picks the few skills a turn needs, so a catalog of hundreds stays out of the prompt.
概览
Per-turn skill routing for LangChain deepagents A drop-in replacement for the deepagents SkillsMiddleware : on each user turn a fast judge decides which SKILL.md skills are needed, and only those are loaded, so a catalog of hundreds stays out of the prompt. Bring any judge: a hosted model, a self-hosted one, or plain rules. An adapter for Jev is included. 113.0k → 25.8k input tokens per turn on a 236-skill catalog, and the agent answered 90% of questions correctly against 88% with the whole catalog in the prompt. See the benchmark → deepagents lists every skill's name and description in the system prompt on every model call. With a handful of skills that is fine. With hundreds, the list takes tens of thousands of tokens per call, and the model has to pick the right procedure from a crowd of similar ones. Skill Router replaces the built-in SkillsMiddleware with one that decides : - A confident pick is loaded with its instructions.
README
以下为原文 README 节选,完整内容请查看原文。
Why Skill Router
deepagents lists every skill’s name and description in the system prompt on every model call. With a handful of skills that is fine. With hundreds, the list takes tens of thousands of tokens per call, and the model has to pick the right procedure from a crowd of similar ones.
Skill Router replaces the built-in SkillsMiddleware with one that decides per user turn:
- Only what the turn needs. A confident pick is loaded with its instructions. When the pick is unsure,
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add deyna256/langchain-skill-router