[PR #124] [MERGED] fix(deepagents): port backend agnostic skills #140

Closed
opened 2026-02-16 06:17:16 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/124
Author: @christian-bromann
Created: 1/16/2026
Status: Merged
Merged: 1/16/2026
Merged by: @christian-bromann

Base: mainHead: cb/backend-independant-skills


📝 Commits (2)

  • fa0dc40 fix(deepagents): port backend agnostic skills
  • 5a21a71 update test

📊 Changes

9 files changed (+976 additions, -443 deletions)

View changed files

📝 examples/skills-memory/skills-memory-agent.ts (+175 -104)
📝 libs/deepagents/src/agent.ts (+17 -0)
📝 libs/deepagents/src/index.ts (+12 -12)
📝 libs/deepagents/src/middleware/index.ts (+11 -0)
📝 libs/deepagents/src/middleware/skills.test.ts (+317 -179)
📝 libs/deepagents/src/middleware/skills.ts (+367 -116)
📝 libs/deepagents/src/skills/index.int.test.ts (+45 -31)
📝 libs/deepagents/src/types.ts (+31 -0)
📝 package.json (+1 -1)

📄 Description

Ports langchain-ai/deepagents#591 from Python to TypeScript, adding backend-agnostic skills support to the SDK.

This enables agents to discover and use skills from configurable source paths, matching the Python SDK interface.

Features

skills Parameter on createDeepAgent

const agent = await createDeepAgent({
  model,
  backend: new FilesystemBackend({ rootDir: "/path/to/root" }),
  skills: ["/skills/user/", "/skills/project/"],
});

Skills are loaded from the configured sources and injected into the system prompt using the progressive disclosure pattern—the agent sees skill names and descriptions, then reads full SKILL.md content when needed.

createSkillsMiddleware for Custom Usage

import { createSkillsMiddleware, FilesystemBackend } from "deepagents";

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

const agent = await createDeepAgent({
  middleware: [middleware],
});

Skill Structure

Each skill is a directory containing a SKILL.md file with YAML frontmatter:

/skills/
├── web-research/
│   ├── SKILL.md        # Required: YAML frontmatter + instructions
│   └── helper.py       # Optional: supporting files
└── code-review/
    └── SKILL.md
---
name: web-research
description: Structured approach to conducting thorough web research
---

# Web Research Skill

## When to Use
- User asks you to research a topic
...

Breaking Changes

  • Removed old createSkillsMiddleware({ skillsDir, assistantId }) - use the new backend-agnostic version with { backend, sources } instead
  • The skills loader utility (listSkills) is still available for direct filesystem access

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/124 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 1/16/2026 **Status:** ✅ Merged **Merged:** 1/16/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `cb/backend-independant-skills` --- ### 📝 Commits (2) - [`fa0dc40`](https://github.com/langchain-ai/deepagentsjs/commit/fa0dc4026aa112710227ada66423553de8ce31fd) fix(deepagents): port backend agnostic skills - [`5a21a71`](https://github.com/langchain-ai/deepagentsjs/commit/5a21a7177800c2d7076c40fc04bbfd8b936e6fc7) update test ### 📊 Changes **9 files changed** (+976 additions, -443 deletions) <details> <summary>View changed files</summary> 📝 `examples/skills-memory/skills-memory-agent.ts` (+175 -104) 📝 `libs/deepagents/src/agent.ts` (+17 -0) 📝 `libs/deepagents/src/index.ts` (+12 -12) 📝 `libs/deepagents/src/middleware/index.ts` (+11 -0) 📝 `libs/deepagents/src/middleware/skills.test.ts` (+317 -179) 📝 `libs/deepagents/src/middleware/skills.ts` (+367 -116) 📝 `libs/deepagents/src/skills/index.int.test.ts` (+45 -31) 📝 `libs/deepagents/src/types.ts` (+31 -0) 📝 `package.json` (+1 -1) </details> ### 📄 Description Ports [langchain-ai/deepagents#591](https://github.com/langchain-ai/deepagents/pull/591) from Python to TypeScript, adding backend-agnostic skills support to the SDK. This enables agents to discover and use skills from configurable source paths, matching the Python SDK interface. ## Features ### `skills` Parameter on `createDeepAgent` ```typescript const agent = await createDeepAgent({ model, backend: new FilesystemBackend({ rootDir: "/path/to/root" }), skills: ["/skills/user/", "/skills/project/"], }); ``` Skills are loaded from the configured sources and injected into the system prompt using the progressive disclosure pattern—the agent sees skill names and descriptions, then reads full SKILL.md content when needed. ### `createSkillsMiddleware` for Custom Usage ```typescript import { createSkillsMiddleware, FilesystemBackend } from "deepagents"; const middleware = createSkillsMiddleware({ backend: new FilesystemBackend({ rootDir: "/" }), sources: ["/skills/user/", "/skills/project/"], }); const agent = await createDeepAgent({ middleware: [middleware], }); ``` ### Skill Structure Each skill is a directory containing a `SKILL.md` file with YAML frontmatter: ``` /skills/ ├── web-research/ │ ├── SKILL.md # Required: YAML frontmatter + instructions │ └── helper.py # Optional: supporting files └── code-review/ └── SKILL.md ``` ```md --- name: web-research description: Structured approach to conducting thorough web research --- # Web Research Skill ## When to Use - User asks you to research a topic ... ``` ## Breaking Changes - Removed old `createSkillsMiddleware({ skillsDir, assistantId })` - use the new backend-agnostic version with `{ backend, sources }` instead - The skills loader utility (`listSkills`) is still available for direct filesystem access --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 06:17:16 -05:00
yindo closed this issue 2026-02-16 06:17:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#140