Agent skill · AI & Agents

deepagents-memory

在 Deep Agents 中实现长期内存,使用 StoreBackend、CompositeBackend 和 InMemoryStore 进行跨会话的持久化数据存储。

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill deepagents-memory --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 5 KB
Bundled scripts: none
Path: skills/agent/deepagents-memory/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# deepagents-memory (JavaScript/TypeScript) ## 概述 **短期(StateBackend)**:仅单会话 **长期(StoreBackend)**:跨会话持久化 **混合(CompositeBackend)**:两者结合 ## 长期内存设置 ```typescript import { createDeepAgent, CompositeBackend, StateBackend, StoreBackend } from "deepagents"; import { InMemoryStore } from "@langchain/langgraph"; const store = new InMemoryStore(); const agent = await createDeepAgent({ backend: (config) => new CompositeBackend( new StateBackend(config), { "/memories/": new StoreBackend(config) } ), store }); // /memories/* 文件跨会话持久化 // 其他文件是临时的 ``` ## 代码示例 ### 示例 1:跨会话的用户偏好 ```typescript import { createDeepAgent, CompositeBackend, StateBackend, StoreBackend } from "deepagents"; import { InMemoryStore } from "@langchain/langgraph"; const store = new InMemoryStore(); const agent = await createDeepAgent({ backend: (config) => new CompositeBackend( new StateBackend(config), { "/memories/": new StoreBackend(config) } ), store }); // 会话 1:保存偏好 const config1 = { configurable: { thread_id: "thread-1" } }; await agent.invoke({ messages: [{ role: "user", content: "将我的编码风格保存到 /memories/style.txt:TypeScript、async/await、Jest" }] }, config1); // 会话 2:访问偏好 const config2 = { configurable: { thread_id: "thread-

What's inside
Steps it walks through
  1. 概述
  2. 长期内存设置
  3. 代码示例
  4. 示例 1:跨会话的用户偏好
  5. 示例 2:在工具中直接使用 Store
  6. 示例 3:项目知识库
  7. 决策表
  8. 边界
  9. Agent 可以做的事情
  10. Agent 不能做的事情
  11. 注意事项
  12. 1. StoreBackend 需要 Store
  13. 2. 路径前缀很重要
  14. 3. InMemoryStore 不持久化
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the deepagents-memory skill do?

在 Deep Agents 中实现长期内存,使用 StoreBackend、CompositeBackend 和 InMemoryStore 进行跨会话的持久化数据存储。

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill deepagents-memory --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going