[PR #139] [MERGED] feat(deepagents): align JS implementation with Python deepagents #152

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

📋 Pull Request Information

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

Base: mainHead: cb/py-update


📝 Commits (3)

  • 900a611 feat(deepagents): align JS implementation with Python deepagents
  • a2b7788 format
  • 9bb55e0 fix test

📊 Changes

15 files changed (+2277 additions, -122 deletions)

View changed files

📝 libs/deepagents/src/backends/composite.test.ts (+3 -0)
📝 libs/deepagents/src/backends/composite.ts (+8 -6)
libs/deepagents/src/backends/utils.test.ts (+287 -0)
📝 libs/deepagents/src/backends/utils.ts (+89 -1)
📝 libs/deepagents/src/middleware/agent-memory.ts (+27 -0)
libs/deepagents/src/middleware/fs.eviction.test.ts (+134 -0)
📝 libs/deepagents/src/middleware/fs.ts (+305 -110)
📝 libs/deepagents/src/middleware/index.ts (+18 -0)
📝 libs/deepagents/src/middleware/skills.test.ts (+82 -0)
📝 libs/deepagents/src/middleware/skills.ts (+20 -4)
libs/deepagents/src/middleware/summarization.test.ts (+444 -0)
libs/deepagents/src/middleware/summarization.ts (+666 -0)
libs/deepagents/src/middleware/utils.test.ts (+96 -0)
libs/deepagents/src/middleware/utils.ts (+96 -0)
📝 libs/deepagents/src/skills/index.int.test.ts (+2 -1)

📄 Description

This PR aligns the JavaScript implementation with the Python deepagents library. It ports several features from Python and adds comprehensive test coverage.

Key Changes

  • Deprecate createAgentMemoryMiddleware in favor of createMemoryMiddleware which uses the BackendProtocol abstraction
  • Port comprehensive tool descriptions from Python's filesystem.py for better LLM guidance
  • Add SummarizationMiddleware with backend-based conversation history offloading
  • Enhance skills middleware to show priority indicators and allowed tools
  • Add path validation utilities with security checks for path traversal

New Exports

Export Source Description
createSummarizationMiddleware summarization.ts Summarization with backend offloading
TOOLS_EXCLUDED_FROM_EVICTION fs.ts Tools exempt from eviction
NUM_CHARS_PER_TOKEN fs.ts Token estimation constant
createContentPreview fs.ts Preview generator for large content
appendToSystemMessage utils.ts System message helper
prependToSystemMessage utils.ts System message helper
validateFilePath backends/utils.ts Secure path validation

Breaking Changes

None. All changes are additive or internal improvements.


🔄 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/139 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 1/23/2026 **Status:** ✅ Merged **Merged:** 1/23/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `cb/py-update` --- ### 📝 Commits (3) - [`900a611`](https://github.com/langchain-ai/deepagentsjs/commit/900a6117379dc3bb9e39aac673d3e0ebd9769593) feat(deepagents): align JS implementation with Python deepagents - [`a2b7788`](https://github.com/langchain-ai/deepagentsjs/commit/a2b7788e848b1fa2b09da73ce5c73bc39e2f8ed0) format - [`9bb55e0`](https://github.com/langchain-ai/deepagentsjs/commit/9bb55e048b50ffe64577d7e5b2c260257f0a83c4) fix test ### 📊 Changes **15 files changed** (+2277 additions, -122 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/src/backends/composite.test.ts` (+3 -0) 📝 `libs/deepagents/src/backends/composite.ts` (+8 -6) ➕ `libs/deepagents/src/backends/utils.test.ts` (+287 -0) 📝 `libs/deepagents/src/backends/utils.ts` (+89 -1) 📝 `libs/deepagents/src/middleware/agent-memory.ts` (+27 -0) ➕ `libs/deepagents/src/middleware/fs.eviction.test.ts` (+134 -0) 📝 `libs/deepagents/src/middleware/fs.ts` (+305 -110) 📝 `libs/deepagents/src/middleware/index.ts` (+18 -0) 📝 `libs/deepagents/src/middleware/skills.test.ts` (+82 -0) 📝 `libs/deepagents/src/middleware/skills.ts` (+20 -4) ➕ `libs/deepagents/src/middleware/summarization.test.ts` (+444 -0) ➕ `libs/deepagents/src/middleware/summarization.ts` (+666 -0) ➕ `libs/deepagents/src/middleware/utils.test.ts` (+96 -0) ➕ `libs/deepagents/src/middleware/utils.ts` (+96 -0) 📝 `libs/deepagents/src/skills/index.int.test.ts` (+2 -1) </details> ### 📄 Description This PR aligns the JavaScript implementation with the Python `deepagents` library. It ports several features from Python and adds comprehensive test coverage. ### Key Changes - **Deprecate `createAgentMemoryMiddleware`** in favor of `createMemoryMiddleware` which uses the `BackendProtocol` abstraction - **Port comprehensive tool descriptions** from Python's `filesystem.py` for better LLM guidance - **Add `SummarizationMiddleware`** with backend-based conversation history offloading - **Enhance skills middleware** to show priority indicators and allowed tools - **Add path validation utilities** with security checks for path traversal ### New Exports | Export | Source | Description | |--------|--------|-------------| | `createSummarizationMiddleware` | `summarization.ts` | Summarization with backend offloading | | `TOOLS_EXCLUDED_FROM_EVICTION` | `fs.ts` | Tools exempt from eviction | | `NUM_CHARS_PER_TOKEN` | `fs.ts` | Token estimation constant | | `createContentPreview` | `fs.ts` | Preview generator for large content | | `appendToSystemMessage` | `utils.ts` | System message helper | | `prependToSystemMessage` | `utils.ts` | System message helper | | `validateFilePath` | `backends/utils.ts` | Secure path validation | ### Breaking Changes **None.** All changes are additive or internal improvements. --- <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:17 -05:00
yindo closed this issue 2026-02-16 06:17:17 -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#152