[PR #123] [MERGED] feat(deepagents): add MemoryMiddleware for AGENTS.md support #139

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/123
Author: @christian-bromann
Created: 1/16/2026
Status: Merged
Merged: 1/16/2026
Merged by: @christian-bromann

Base: mainHead: cb/memory


📝 Commits (2)

  • ad58bbb feat(deepagents): add MemoryMiddleware for AGENTS.md support
  • 106f57f add example

📊 Changes

11 files changed (+694 additions, -0 deletions)

View changed files

examples/memory/AGENTS.md (+30 -0)
examples/memory/memory-agent.ts (+91 -0)
📝 examples/package.json (+1 -0)
📝 libs/deepagents/src/agent.ts (+11 -0)
📝 libs/deepagents/src/index.ts (+2 -0)
📝 libs/deepagents/src/middleware/index.ts (+4 -0)
libs/deepagents/src/middleware/memory.test.ts (+261 -0)
libs/deepagents/src/middleware/memory.ts (+280 -0)
📝 libs/deepagents/src/types.ts (+7 -0)
📝 package.json (+1 -0)
📝 pnpm-lock.yaml (+6 -0)

📄 Description

Port of langchain-ai/deepagents#646 to TypeScript.

Adds MemoryMiddleware that loads persistent context from AGENTS.md files following the agents.md specification. Unlike skills (which are on-demand), memory is always loaded at agent startup and injected into the system prompt.

Changes:

  • Add createMemoryMiddleware in middleware/memory.ts
  • Add memory parameter to createDeepAgent for automatic middleware setup
  • Export MemoryMiddleware from package index
  • Add unit tests for memory loading and prompt injection

Usage:

const agent = createDeepAgent({
  memory: [ "~/.deepagents/AGENTS.md", "./.deepagents/AGENTS.md", ]
});

🔄 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/123 **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/memory` --- ### 📝 Commits (2) - [`ad58bbb`](https://github.com/langchain-ai/deepagentsjs/commit/ad58bbbd8def86fe3c982679e36dbfa39dbf34b2) feat(deepagents): add MemoryMiddleware for AGENTS.md support - [`106f57f`](https://github.com/langchain-ai/deepagentsjs/commit/106f57ff6ea0ac2bc5c39e5ca43cf605b77702db) add example ### 📊 Changes **11 files changed** (+694 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `examples/memory/AGENTS.md` (+30 -0) ➕ `examples/memory/memory-agent.ts` (+91 -0) 📝 `examples/package.json` (+1 -0) 📝 `libs/deepagents/src/agent.ts` (+11 -0) 📝 `libs/deepagents/src/index.ts` (+2 -0) 📝 `libs/deepagents/src/middleware/index.ts` (+4 -0) ➕ `libs/deepagents/src/middleware/memory.test.ts` (+261 -0) ➕ `libs/deepagents/src/middleware/memory.ts` (+280 -0) 📝 `libs/deepagents/src/types.ts` (+7 -0) 📝 `package.json` (+1 -0) 📝 `pnpm-lock.yaml` (+6 -0) </details> ### 📄 Description Port of langchain-ai/deepagents#646 to TypeScript. Adds MemoryMiddleware that loads persistent context from AGENTS.md files following the agents.md specification. Unlike skills (which are on-demand), memory is always loaded at agent startup and injected into the system prompt. Changes: - Add createMemoryMiddleware in middleware/memory.ts - Add `memory` parameter to createDeepAgent for automatic middleware setup - Export MemoryMiddleware from package index - Add unit tests for memory loading and prompt injection Usage: ```ts const agent = createDeepAgent({ memory: [ "~/.deepagents/AGENTS.md", "./.deepagents/AGENTS.md", ] }); ``` --- <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#139