LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Configuration
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsConfigurationTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsindexcreateSkillsMiddleware
Function●Since v1.4

createSkillsMiddleware

Create backend-agnostic middleware for loading and exposing agent skills.

This middleware loads skills from configurable backend sources and injects skill metadata into the system prompt. It implements the progressive disclosure pattern: skill names and descriptions are shown in the prompt, but the agent reads full SKILL.md content only when needed.

Copy
createSkillsMiddleware(
  options: SkillsMiddlewareOptions
): AgentMiddleware<StateSchema<__type>, undefined, unknown, readonly ClientTool | ServerTool[]>

Parameters

NameTypeDescription
options*SkillsMiddlewareOptions

Configuration options

Example

Copy
const middleware = createSkillsMiddleware({
  backend: new FilesystemBackend({ rootDir: "/" }),
  sources: ["/skills/user/", "/skills/project/"],
});
View source on GitHub