Skip to main content

LangChain Skills Adapter

This package provides an easy way to work with Agent Skills in your LangChain/LangGraph project by treating Skills as any other tool in LangChain, allowing you to easily integrate skills with existing workflows and agents. For developers, Skills work like any other LangChain tool.

alt text

Installation

Install from PyPI:

pip install langchain-skills-adapter

Create SkillTool

SkillTool accepts 2 arguments: directories (required) and description_template (optional).

Supported Directory Structures:

Scenario 1 - Direct skill directory:

skills/
└── pdf/
    └── SKILL.md

Usage: SkillTool(directories="skills/pdf")

Scenario 2 - Parent directory with multiple skills:

.copilot/skills/
├── pdf/
│   └── SKILL.md
├── pptx/
│   └── SKILL.md 
└── excel/
    └── SKILL.md

Usage: SkillTool(directories=".copilot/skills") # Discovers all three skills

Scenario 3 - Nested skill directories:

skills/
├── documents/
│   ├── pdf/
│   │   └── SKILL.md
│   └── word/
│       └── SKILL.md 
└── data/
    └── csv/
        └── SKILL.md

Usage: SkillTool(directories="skills") # Recursively discovers all nested skills

Scenario 4 - Multiple parent directories:

~/.agents/skills/
└── pdf/
    └── SKILL.md

./custom-skills/
└── excel/
    └── SKILL.md

Usage: SkillTool(directories=["~/.agents/skills", "./custom-skills"])

from langchain_skills import SkillTool

# Load skills from a directory
skill_tool = SkillTool(directories=".agent/skills/")

Example Usage

from langchain.agents import create_agent
from langchain_community.agent_toolkits import FileManagementToolkit
from langchain_community.tools import ShellTool
from langchain_skills import SkillTool

# create skill tool
skill_tool = SkillTool(directories=".agent/skills/")

# Create supporting tools to complement the skill
file_management_toolkit = FileManagementToolkit(root_dir='..').get_tools()
bash_tool = ShellTool()

# Combine all tools
tools = file_management_toolkit + [bash_tool, skill_tool]

agent = create_agent(model, tools)

It is highly recommended to provide FileManagementToolkit and ShellTool, which act as supporting tools in case your skill is not just a SKILL.md file. Even if the skill is a simple single SKILL.md file, it depends on what is actually written in that SKILL.md file. It depends on your use case.

Important:

Since this setup makes use of FileSystemTools and ShellTool, ensure proper security and safety measures. This is not the responsibility of this library.

Inspiration

This work is inspired by Spring AI's SkillTool implementation:
https://github.com/spring-ai-community/spring-ai-agent-utils/blob/main/spring-ai-agent-utils/src/main/java/org/springaicommunity/agent/tools/SkillsTool.java

Metadata

Release files for langchain-skills-adapter 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-skills-adapter 0.1.2
File Size Uploaded
langchain_skills_adapter-0.1.2.tar.gz 481.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-skills-adapter 0.1.2
File Interpreter ABI Platform
langchain_skills_adapter-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 492.8 kB

Release files / langchain_skills_adapter-0.1.2.tar.gz

Download URL langchain_skills_adapter-0.1.2.tar.gz
Size 481.3 kB
Tags Source
SHA-256 checksum
How to use checksums
108f4960a29636665cc58a26c09d689f5610cebd46ce918c31f4f3a96b86992a
BLAKE2b-256 checksum
How to use checksums
444323abce2c2db64730785590db2b41c64215ddd8cd13ae78a2cd990df782a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / langchain_skills_adapter-0.1.2-py3-none-any.whl

Download URL langchain_skills_adapter-0.1.2-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83859b7c77634efff7ace6f3fdc2813599236d77b05d28210b3de13cc114b10b
BLAKE2b-256 checksum
How to use checksums
623fabe299fef1a6122be7e0cac5fd790692f63048ff19dff4fea8c4c1d0d396
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page