deep-agents-memory
Skill2 starsChanged 38 days agoMITView on GitHub
INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.
9 other projects use a version of this, 3 of them edited.
How people change it
All 2 edited versions we compared keep every one of its 3 rules.
Of the 2 edited versions we compared: 2 keep every rule.
We split this file and each edited version into the rules they give an agent and match them by wording. A version that adds no rule of its own and has not changed since this file last did reads as an older text, so what it lacks is not counted as dropped. We keep no past texts of a file, so that is inferred, and an edited version that started from an older text still counts its gaps as drops.
Adopted by
Most recently taken up by
- langchain-ai/langchain-skillstheir own version, first seen Nov 29, 2026
- langchain-ai/design-agentword for word, first seen Oct 25, 2026
- willlee1995/skillsedited, first seen Oct 13, 2026
- gerald-donkor/poli-intelword for word, first seen Oct 11, 2026
- NeoVand/op-xy-agentword for word, first seen Oct 9, 2026
- zoujindouGithub/agent-skillsedited, first seen Sep 2, 2026
Other versions9 projects use a version of this.
Word for word · 5
- langchain-ai/design-agent★ 780100% same
- buduan/soul-graph★ 2100% same
- gerald-donkor/poli-intel★ 1100% same
- NeoVand/op-xy-agent★ 1100% same
- danielvogler/ai-skills-library★ 0100% same
Edited · 3
- langchain-ai/skills-benchmarks★ 116100% same
- willlee1995/skills★ 1100% same
- zoujindouGithub/agent-skills★ 152% same
Wrote their own version · 1
- langchain-ai/langchain-skills★ 1.4ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- client/AGENTS.mdAGENTS.md
- core-guidelinesSkill
- hairline-adoptSkill
- hairline-createSkill
- higgsfield-brandkitSkill
- higgsfield-faceless-videoSkill
- higgsfield-generateSkill
- higgsfield-marketplace-cardsSkill
- higgsfield-product-photoshootSkill
- higgsfield-soul-idSkill
- higgsfield-video-explainerSkill
- higgsfield-websitesSkill
- higgsfield-youtube-thumbnailSkill
- temporal-cloudSkill
- temporal-developerSkill
- deep-agents-coreSkill
- deep-agents-orchestrationSkill
- deepagents-python-quickstartSkill
- deepagents-typescript-quickstartSkill
- ecosystem-primerSkill
- eval-engineeringSkill
- higgsfield-brandkitSkill
- higgsfield-faceless-videoSkill
- higgsfield-generateSkill
- higgsfield-marketplace-cardsSkill
- higgsfield-product-photoshootSkill
- higgsfield-soul-idSkill
- higgsfield-video-explainerSkill
- higgsfield-websitesSkill
- higgsfield-youtube-thumbnailSkill
- langchain-dependenciesSkill
- langchain-fundamentalsSkill
- langchain-middlewareSkill
- langchain-python-quickstartSkill
- langchain-ragSkill
- langchain-typescript-quickstartSkill
- langgraph-cliSkill
- langgraph-decision-modelsSkill
- langgraph-fundamentalsSkill
- langgraph-human-in-the-loopSkill
- langgraph-persistenceSkill
- langgraph-python-quickstartSkill
- langgraph-typescript-quickstartSkill
- managed-deep-agentsSkill
- swarmSkill
- temporal-cloudSkill
The file
We split this skill into the rules it gives an agent
3 rules. 3 are common, 0 are distinctive, and 0 are very specific to this project.
3
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 29
Default StateBackend stores files ephemerally within a thread.
- Common: line 132
Use FilesystemBackend for local development with real disk access and human-in-the-loop.
- Common: line 284
Use PostgresStore for production (InMemoryStore lost on restart).
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<overview>
Deep Agents use pluggable backends for file operations and memory:Short-term (StateBackend): Persists within a single thread, lost when thread ends Long-term (StoreBackend): Persists across threads and sessions Hybrid (CompositeBackend): Route different paths to different backends
FilesystemMiddleware provides tools: ls, read_file, write_file, edit_file, glob, grep
</overview>
<backend-selection>| Use Case | Backend | Why |
| Temporary working files | StateBackend | Default, no setup |
| Local development CLI | FilesystemBackend | Direct disk access |
| Cross-session memory | StoreBackend | Persists across threads |
| Hybrid storage | CompositeBackend | Mix ephemeral + persistent |
</backend-selection><ex-default-state-backend>
<python>
Default StateBackend stores files ephemerally within a thread.from deepagents import create_deep_agent
agent = create_deep_agent() # Default: StateBackend
result = agent.invoke({
"messages": [{"role": "user", "content": "Write notes to /draft.txt"}]
}, config={"configurable": {"thread_id": "thread-1"}})
# /draft.txt is lost when thread ends</python>
<typescript>
Default StateBackend stores files ephemerally within a thread.import { createDeepAgent } from "deepagents";
const agent = await createDeepAgent(); // Default: StateBackend
const result = await agent.invoke({
messages: [{ role: "user", content: "Write notes to /draft.txt" }]
}, { configurable: { thread_id: "thread-1" } });
// /draft.txt is lost when thread ends</typescript>
</ex-default-state-backend><ex-composite-backend-for-hybrid>
<python>
Configure CompositeBackend to route paths to different storage backends.from deepagents import create_deep_agent
from deepagents.backends import CompositeBackend, StateBackend, StoreBackend
from langgraph.store.memory import InMemoryStore
store = InMemoryStore()
composite_backend = lambda rt: CompositeBackend(
default=StateBackend(rt),
routes={"/memories/": StoreBackend(rt)}
)
agent = create_deep_agent(backend=composite_backend, store=store)
# /draft.txt -> ephemeral (StateBackend)
# /memories/user-prefs.txt -> persistent (StoreBackend)</python>
<typescript>
Configure CompositeBackend to route paths to different storage backends.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
});
// /draft.txt -> ephemeral (StateBackend)
// /memories/user-prefs.txt -> persistent (StoreBackend)</typescript>
</ex-composite-backend-for-hybrid><ex-cross-session-memory>
<python>
Files in /memories/ persist across threads via StoreBackend routing.# Using CompositeBackend from previous example
config1 = {"configurable": {"thread_id": "thread-1"}}
agent.invoke({"messages": [{"role": "user", "content": "Save to /memories/style.txt"}]}, config=config1)
config2 = {"configurable": {"thread_id": "thread-2"}}
agent.invoke({"messages": [{"role": "user", "content": "Read /memories/style.txt"}]}, config=config2)
# Thread 2 can read file saved by Thread 1</python>
<typescript>
Files in /memories/ persist across threads via StoreBackend routing.// Using CompositeBackend from previous example
const config1 = { configurable: { thread_id: "thread-1" } };
await agent.invoke({ messages: [{ role: "user", content: "Save to /memories/style.txt" }] }, config1);
const config2 = { configurable: { thread_id: "thread-2" } };
await agent.invoke({ messages: [{ role: "user", content: "Read /memories/style.txt" }] }, config2);
// Thread 2 can read file saved by Thread 1</typescript>
</ex-cross-session-memory><ex-filesystem-backend-local-dev>
<python>
Use FilesystemBackend for local development with real disk access and human-in-the-loop.from deepagents import create_deep_agent
from deepagents.backends import FilesystemBackend
from langgraph.checkpoint.memory import MemorySaver
agent = create_deep_agent(
backend=FilesystemBackend(root_dir=".", virtual_mode=True), # Restrict access
interrupt_on={"write_file": True, "edit_file": True},
checkpointer=MemorySaver()
)
# Agent can read/write actual files on disk</python>
<typescript>
Use FilesystemBackend for local development with real disk access and human-in-the-loop.import { createDeepAgent, FilesystemBackend } from "deepagents";
import { MemorySaver } from "@langchain/langgraph";
const agent = await createDeepAgent({
backend: new FilesystemBackend({ rootDir: ".", virtualMode: true }),
interruptOn: { write_file: true, edit_file: true },
checkpointer: new MemorySaver()
});</typescript>Security: Never use FilesystemBackend in web servers - use StateBackend or sandbox instead.
</ex-filesystem-backend-local-dev>
<ex-store-in-custom-tools>
<python>
Access the store directly in custom tools for long-term memory operations.from langchain.tools import tool, ToolRuntime
from langchain.agents import create_agent
from langgraph.store.memory import InMemoryStore
@tool
def get_user_preference(key: str, runtime: ToolRuntime) -> str:
"""Get a user preference from long-term storage."""
store = runtime.store
result = store.get(("user_prefs",), key)
return str(result.value) if result else "Not found"
@tool
def save_user_preference(key: str, value: str, runtime: ToolRuntime) -> str:
"""Save a user preference to long-term storage."""
store = runtime.store
store.put(("user_prefs",), key, {"value": value})
return f"Saved {key}={value}"
store = InMemoryStore()
agent = create_agent(
model="gpt-4.1",
tools=[get_user_preference, save_user_preference],
store=store
)</python>
</ex-store-in-custom-tools><boundaries>
### What Agents CAN Configure- Backend type and configuration
- Routing rules for CompositeBackend
- Root directory for FilesystemBackend
- Human-in-the-loop for file operations
What Agents CANNOT Configure
- Tool names (ls, read_file, write_file, edit_file, glob, grep)
- Access files outside virtual_mode restrictions
- Cross-thread file access without proper backend setup
</boundaries>
<fix-storebackend-requires-store>
<python>
StoreBackend requires a store instance.# WRONG
agent = create_deep_agent(backend=lambda rt: StoreBackend(rt))
# CORRECT
agent = create_deep_agent(backend=lambda rt: StoreBackend(rt), store=InMemoryStore())</python>
<typescript>
StoreBackend requires a store instance.// WRONG
const agent = await createDeepAgent({ backend: (c) => new StoreBackend(c) });
// CORRECT
const agent = await createDeepAgent({ backend: (c) => new StoreBackend(c), store: new InMemoryStore() });</typescript>
</fix-storebackend-requires-store><fix-statebackend-files-dont-persist>
<python>
StateBackend files are thread-scoped - use same thread_id or StoreBackend for cross-thread access.# WRONG: thread-2 can't read file from thread-1
agent.invoke({"messages": [...]}, config={"configurable": {"thread_id": "thread-1"}}) # Write
agent.invoke({"messages": [...]}, config={"configurable": {"thread_id": "thread-2"}}) # File not found!</python>
<typescript>
StateBackend files are thread-scoped - use same thread_id or StoreBackend for cross-thread access.// WRONG: thread-2 can't read file from thread-1
await agent.invoke({ messages: [...] }, { configurable: { thread_id: "thread-1" } }); // Write
await agent.invoke({ messages: [...] }, { configurable: { thread_id: "thread-2" } }); // File not found!</typescript>
</fix-statebackend-files-dont-persist><fix-path-prefix-for-persistence>
<python>
Path must match CompositeBackend route prefix for persistence.# With routes={"/memories/": StoreBackend(rt)}:
agent.invoke(...) # /prefs.txt -> ephemeral (no match)
agent.invoke(...) # /memories/prefs.txt -> persistent (matches route)</python>
<typescript>
Path must match CompositeBackend route prefix for persistence.// With routes: { "/memories/": StoreBackend }:
await agent.invoke(...); // /prefs.txt -> ephemeral (no match)
await agent.invoke(...); // /memories/prefs.txt -> persistent (matches route)</typescript>
</fix-path-prefix-for-persistence><fix-production-store>
<python>
Use PostgresStore for production (InMemoryStore lost on restart).# WRONG # CORRECT
store = InMemoryStore() store = PostgresStore(connection_string="postgresql://...")</python>
<typescript>
Use PostgresStore for production (InMemoryStore lost on restart).// WRONG // CORRECT
const store = new InMemoryStore(); const store = new PostgresStore({ connectionString: "..." });</typescript>
</fix-production-store><fix-filesystem-backend-needs-virtual-mode>
<python>
Enable virtual_mode=True to restrict path access (prevents ../ and ~/ escapes).backend = FilesystemBackend(root_dir="/project", virtual_mode=True) # Secure</python>
</fix-filesystem-backend-needs-virtual-mode><fix-longest-prefix-match>
<python>
CompositeBackend matches longest prefix first.routes = {"/mem/": StoreBackend(rt), "/mem/temp/": StateBackend(rt)}
# /mem/file.txt -> StoreBackend, /mem/temp/file.txt -> StateBackend (longer match)</python>
</fix-longest-prefix-match>Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

