What are skills
Skills are a directory of folders, where each folder has one or more files that contain context the agent can use:- A
SKILL.mdfile containing instructions and metadata about the skill - Additional scripts (optional)
- Additional reference info, such as docs (optional)
- Additional assets, such as templates and other resources (optional)
Any additional assets (scripts, docs, templates, or other resources) must be referenced in the
SKILL.md file with information on what the file contains and how to use it so the agent can decide when to use them.How do skills work
When you create a deep agent, you can pass in a list of directories containing skills. As the agent starts, it reads through the frontmatter of eachSKILL.md file.
When the agent receives a prompt, the agent checks if it can use any skills while fulfilling the prompt.
If it finds a matching prompt, it then reviews the rest of the skill files.
This pattern of only reviewing the skill information when needed is called progressive disclosure.
Examples
You might have a skills folder that contains a skill to use a docs site in a certain way, as well as another skill to search the arXiv preprint repository of research papers:SKILL.md file always follows the same pattern, starting with metadata in the frontmatter and followed by the instructions for the skill.
The following example shows a skill that gives instructions on how to provide relevant langgraph docs when prompted:
Usage
Pass the skills directory when creating your deep agent:- StateBackend
- StoreBackend
- FilesystemBackend
list[str]
List of skill source paths. Paths must be specified using forward slashes and are relative to the backend’s root.
- When using StateBackend (default), provide skill files with
invoke(files={...}). - With FilesystemBackend, skills are loaded from disk relative to the backend’s root_dir.
When to use skills and tools
These are a few general guidelines for using tools and skills:- Use skills when there is a lot of context to reduce the number of tokens in the system prompt.
- Use skills to bundle capabilities together into larger actions and provide additional context beyond single tool descriptions.
- Use tools if the agent does not have access to the file system.