deepagents 1.6.2 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -12
- package/dist/index.cjs +242 -89
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +435 -63
- package/dist/index.d.ts +436 -64
- package/dist/index.js +230 -83
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -1,25 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://docs.langchain.com/oss/python/deepagents/overview#deep-agents-overview">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset=".github/images/logo-dark.svg">
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset=".github/images/logo-light.svg">
|
|
6
|
+
<img alt="Deep Agents Logo" src=".github/images/logo-dark.svg" width="80%">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div align="center">
|
|
12
|
+
<h3>The batteries-included agent harness.</h3>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div align="center">
|
|
16
|
+
<a href="https://www.npmjs.com/package/deepagents"><img src="https://img.shields.io/npm/v/deepagents.svg" alt="npm version"></a>
|
|
17
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
18
|
+
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.0+-blue.svg" alt="TypeScript"></a>
|
|
19
|
+
<a href="https://x.com/LangChain_JS" target="_blank"><img src="https://img.shields.io/twitter/url/https/twitter.com/LangChain_JS.svg?style=social&label=Follow%20%40LangChain_JS" alt="Twitter / X"></a>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
Using an LLM to call tools in a loop is the simplest form of an agent. This architecture, however, can yield agents that are "shallow" and fail to plan and act over longer, more complex tasks.
|
|
5
23
|
|
|
6
24
|
Applications like "Deep Research", "Manus", and "Claude Code" have gotten around this limitation by implementing a combination of four things:
|
|
7
25
|
a **planning tool**, **sub agents**, access to a **file system**, and a **detailed prompt**.
|
|
8
26
|
|
|
9
|
-
> 💡 **Tip:** Looking for the Python version of this package? See [langchain-ai/deepagents](https://github.com/langchain-ai/deepagents)
|
|
10
|
-
|
|
11
|
-

|
|
12
|
-
|
|
13
27
|
`deepagents` is a TypeScript package that implements these in a general purpose way so that you can easily create a Deep Agent for your application.
|
|
14
28
|
|
|
15
|
-
|
|
29
|
+
> 💡 **Tip:** Looking for the Python version of this package? See [langchain-ai/deepagents](https://github.com/langchain-ai/deepagents)
|
|
16
30
|
|
|
17
|
-
|
|
18
|
-
[](https://opensource.org/licenses/MIT)
|
|
19
|
-
[](https://www.typescriptlang.org/)
|
|
31
|
+
<div align="center">
|
|
20
32
|
|
|
21
33
|
[Documentation](https://docs.langchain.com/oss/javascript/deepagents/overview) | [Examples](./examples) | [Report Bug](https://github.com/langchain-ai/deepagentsjs/issues) | [Request Feature](https://github.com/langchain-ai/deepagentsjs/issues)
|
|
22
34
|
|
|
35
|
+
</div>
|
|
36
|
+
|
|
23
37
|
## 📖 Overview
|
|
24
38
|
|
|
25
39
|
Using an LLM to call tools in a loop is the simplest form of an agent. However, this architecture can yield agents that are "shallow" and fail to plan and act over longer, more complex tasks.
|
|
@@ -316,6 +330,7 @@ interface SubAgent {
|
|
|
316
330
|
model?: LanguageModelLike | string;
|
|
317
331
|
middleware?: AgentMiddleware[];
|
|
318
332
|
interruptOn?: Record<string, boolean | InterruptOnConfig>;
|
|
333
|
+
skills?: string[];
|
|
319
334
|
}
|
|
320
335
|
```
|
|
321
336
|
|
|
@@ -328,6 +343,37 @@ interface SubAgent {
|
|
|
328
343
|
- **model**: Optional model name or model instance.
|
|
329
344
|
- **middleware**: Additional middleware to attach to the subagent. See [here](https://docs.langchain.com/oss/typescript/langchain/middleware) for an introduction into middleware and how it works with createAgent.
|
|
330
345
|
- **interruptOn**: A custom interrupt config that specifies human-in-the-loop interactions for your tools.
|
|
346
|
+
- **skills**: Skill source paths for the subagent (e.g., `["/skills/research/"]`). See skills inheritance below.
|
|
347
|
+
|
|
348
|
+
#### Skills Inheritance
|
|
349
|
+
|
|
350
|
+
When you configure `skills` on the main agent via `createDeepAgent`, the behavior differs between subagent types:
|
|
351
|
+
|
|
352
|
+
- **General-purpose subagent**: Automatically inherits skills from the main agent. This subagent has access to all the same skills as the main agent.
|
|
353
|
+
- **Custom subagents**: Do NOT inherit skills from the main agent by default. If you want a custom subagent to have access to skills, you must explicitly define the `skills` property on that subagent.
|
|
354
|
+
|
|
355
|
+
```typescript
|
|
356
|
+
const agent = createDeepAgent({
|
|
357
|
+
model: "claude-sonnet-4-20250514",
|
|
358
|
+
skills: ["/skills/"], // Main agent and general-purpose subagent get these skills
|
|
359
|
+
subagents: [
|
|
360
|
+
{
|
|
361
|
+
name: "researcher",
|
|
362
|
+
description: "Research assistant",
|
|
363
|
+
systemPrompt: "You are a researcher.",
|
|
364
|
+
// This subagent will NOT have access to /skills/ from the main agent
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: "coder",
|
|
368
|
+
description: "Coding assistant",
|
|
369
|
+
systemPrompt: "You are a coder.",
|
|
370
|
+
skills: ["/skills/coding/"], // This subagent has its own skills
|
|
371
|
+
},
|
|
372
|
+
],
|
|
373
|
+
});
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
This design ensures context isolation - custom subagents only have access to the skills they explicitly need, preventing unintended skill leakage between specialized agents.
|
|
331
377
|
|
|
332
378
|
#### Using SubAgent
|
|
333
379
|
|