deep-agents-memory: a LangChain skill for Deep Agent memory and file storage
A LangChain skill that helps Claude add memory, persistence and file access to a Deep Agent you are building.
- Installs
- 19.4K
- on skills.sh
- Stars
- 1.3K
- on GitHub
- Updated
- Oct 2026
- last repo commit
deep-agents-memory is a coding reference for the Deep Agents library. It explains four storage options: StateBackend for files that vanish when a thread ends, StoreBackend for files that persist across threads, FilesystemBackend for real disk access, and CompositeBackend for routing paths such as /memories/ to different backends. Claude uses it when your Deep Agent needs memory, persistence or filesystem access.
Examples come in Python and TypeScript. The skill is one file and bundles no scripts. It edits your agent code only. The LangChain README says the project is in early development, so check the library docs if an API has changed.
Good for
- Developers building agents with LangChain's Deep Agents library
- Anyone who needs memory that survives across conversation threads
- Teams choosing a safe file backend for local tools or a web server
Install deep-agents-memory
Claude Code
- 1
Copy this prompt.
Install the deep-agents-memory skill in Claude Code. Run this command: npx skills add https://github.com/langchain-ai/langchain-skills --skill deep-agents-memory Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.
Sections in SKILL.md
- What Agents CAN Configure
- What Agents CANNOT Configure
Key facts
- License
- MIT
- Installs on skills.sh
- 19,356 as of 2026-11-02
- Last repo commit
- 2026-10-29
- skills.sh audits
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: pass
What it includes
Which backend for temporary, local, cross-session or hybrid storage
StateBackend for temporary files, FilesystemBackend for local development, StoreBackend for cross-session memory and CompositeBackend to mix them.
Try: “Add long-term memory to my Deep Agent so it remembers user preferences across chats.”
Read ·
Backend selection tableThread-scoped files lost when the thread ends
A create_deep_agent example with the default backend.
Write ·
Default StateBackendSend /memories/ to a persistent store, everything else to state
Shows routes such as /memories/ going to StoreBackend with an InMemoryStore, and that the longest matching prefix wins.
Write ·
CompositeBackend routingA file saved in thread 1 is readable in thread 2
Uses two thread IDs against the /memories/ route.
Write ·
Cross-session memoryReal disk access with human approval on writes
Uses root_dir, virtual_mode=True and interrupt_on for write_file and edit_file. The skill says never to use it in web servers.
Write ·
FilesystemBackend for local developmentRead and write long-term memory from your own tools
Python example with get and put on the runtime store.
Write ·
Store access in custom toolsWhat agents can and cannot configure
Backend type, routing rules, root directory and human-in-the-loop can be set. Tool names and access outside virtual_mode cannot.
Read ·
BoundariesSix wrong versus correct snippets
StoreBackend needs a store, StateBackend is thread-scoped, paths must match the route prefix, use PostgresStore in production, set virtual_mode=True and the longest prefix match.
Read ·
Fixes for common mistakes
From the official docs
Questions
What does deep-agents-memory do?
It tells Claude how to give a LangChain Deep Agent short-term memory, long-term memory and file access, using StateBackend, StoreBackend, FilesystemBackend and CompositeBackend. It loads when the agent you are building needs memory, persistence or filesystem access.
How do I install it?
Use the install box at the top of this page for this skill alone. The LangChain README also documents installing all of its skills with npx skills and a Claude Code plugin, if you want the whole set.
Does it need an API key?
The skill itself does not name one. The README tells you to set OPENAI_API_KEY or ANTHROPIC_API_KEY after installing, for the model your agent will call.
Is it safe to use?
It only guides the code Claude writes, so review the generated agent code. The skill warns never to use FilesystemBackend in web servers, and to set virtual_mode=True so paths with ../ or ~/ cannot escape the root directory.
Will memory survive a restart?
Not with InMemoryStore. The skill says InMemoryStore is lost on restart and to use PostgresStore in production.
Which languages does it cover?
Most examples are given in both Python and TypeScript. The custom tool example for store access is Python only.
Information
updated Nov 2, 2026
- Repository
- langchain-ai/langchain-skills
- Folder
config/skills/deep-agents-memory
Sources
Docs, issue trackers and discussions this page is built from.