[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C5F79TWHT4DB5479Y656SV":3,"skill-same:01M6C5F79TWHT4DB5479Y656SV":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":28,"frontMatter":29,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M6C5F79TWHT4DB5479Y656SV","deep-agents-memory",null,"INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.","CoralShades\u002Facm-ai","CoralShades","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F220297585?v=4","01M6C5211QSJHZ8HXSDDWCR507","Coral Shades AI Agency","01M6C52161FNQDRQ0FRR8DAA9D",0,"MIT","https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdeep-agents-memory\u002FSKILL.md",[],[19,20,21,22,23,24],"memory","deep agents memory","routing","persistence","access","filesystem","2026-11-10 10:12:30",false,"---\nname: deep-agents-memory\ndescription: \"INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.\"\n---\n\n\u003Coverview>\nDeep Agents use pluggable backends for file operations and memory:\n\n**Short-term (StateBackend)**: Persists within a single thread, lost when thread ends\n**Long-term (StoreBackend)**: Persists across threads and sessions\n**Hybrid (CompositeBackend)**: Route different paths to different backends\n\nFilesystemMiddleware provides tools: `ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`\n\u003C\u002Foverview>\n\n\u003Cbackend-selection>\n\n| Use Case | Backend | Why |\n|----------|---------|-----|\n| Temporary working files | StateBackend | Default, no setup |\n| Local development CLI | FilesystemBackend | Direct disk access |\n| Cross-session memory | StoreBackend | Persists across threads |\n| Hybrid storage | CompositeBackend | Mix ephemeral + persistent |\n\n\u003C\u002Fbackend-selection>\n\n\u003Cex-default-state-backend>\n\u003Cpython>\nDefault StateBackend stores files ephemerally within a thread.\n```python\nfrom deepagents import create_deep_agent\n\nagent = create_deep_agent()  # Default: StateBackend\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"Write notes to \u002Fdraft.txt\"}]\n}, config={\"configurable\": {\"thread_id\": \"thread-1\"}})\n# \u002Fdraft.txt is lost when thread ends\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nDefault StateBackend stores files ephemerally within a thread.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\n\nconst agent = await createDeepAgent();  \u002F\u002F Default: StateBackend\nconst result = await agent.invoke({\n  messages: [{ role: \"user\", content: \"Write notes to \u002Fdraft.txt\" }]\n}, { configurable: { thread_id: \"thread-1\" } });\n\u002F\u002F \u002Fdraft.txt is lost when thread ends\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-default-state-backend>\n\n\u003Cex-composite-backend-for-hybrid>\n\u003Cpython>\nConfigure CompositeBackend to route paths to different storage backends.\n```python\nfrom deepagents import create_deep_agent\nfrom deepagents.backends import CompositeBackend, StateBackend, StoreBackend\nfrom langgraph.store.memory import InMemoryStore\n\nstore = InMemoryStore()\n\ncomposite_backend = lambda rt: CompositeBackend(\n    default=StateBackend(rt),\n    routes={\"\u002Fmemories\u002F\": StoreBackend(rt)}\n)\n\nagent = create_deep_agent(backend=composite_backend, store=store)\n\n# \u002Fdraft.txt -> ephemeral (StateBackend)\n# \u002Fmemories\u002Fuser-prefs.txt -> persistent (StoreBackend)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nConfigure CompositeBackend to route paths to different storage backends.\n```typescript\nimport { createDeepAgent, CompositeBackend, StateBackend, StoreBackend } from \"deepagents\";\nimport { InMemoryStore } from \"@langchain\u002Flanggraph\";\n\nconst store = new InMemoryStore();\n\nconst agent = await createDeepAgent({\n  backend: (config) => new CompositeBackend(\n    new StateBackend(config),\n    { \"\u002Fmemories\u002F\": new StoreBackend(config) }\n  ),\n  store\n});\n\n\u002F\u002F \u002Fdraft.txt -> ephemeral (StateBackend)\n\u002F\u002F \u002Fmemories\u002Fuser-prefs.txt -> persistent (StoreBackend)\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-composite-backend-for-hybrid>\n\n\u003Cex-cross-session-memory>\n\u003Cpython>\nFiles in \u002Fmemories\u002F persist across threads via StoreBackend routing.\n```python\n# Using CompositeBackend from previous example\nconfig1 = {\"configurable\": {\"thread_id\": \"thread-1\"}}\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Save to \u002Fmemories\u002Fstyle.txt\"}]}, config=config1)\n\nconfig2 = {\"configurable\": {\"thread_id\": \"thread-2\"}}\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Read \u002Fmemories\u002Fstyle.txt\"}]}, config=config2)\n# Thread 2 can read file saved by Thread 1\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nFiles in \u002Fmemories\u002F persist across threads via StoreBackend routing.\n```typescript\n\u002F\u002F Using CompositeBackend from previous example\nconst config1 = { configurable: { thread_id: \"thread-1\" } };\nawait agent.invoke({ messages: [{ role: \"user\", content: \"Save to \u002Fmemories\u002Fstyle.txt\" }] }, config1);\n\nconst config2 = { configurable: { thread_id: \"thread-2\" } };\nawait agent.invoke({ messages: [{ role: \"user\", content: \"Read \u002Fmemories\u002Fstyle.txt\" }] }, config2);\n\u002F\u002F Thread 2 can read file saved by Thread 1\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-cross-session-memory>\n\n\u003Cex-filesystem-backend-local-dev>\n\u003Cpython>\nUse FilesystemBackend for local development with real disk access and human-in-the-loop.\n```python\nfrom deepagents import create_deep_agent\nfrom deepagents.backends import FilesystemBackend\nfrom langgraph.checkpoint.memory import MemorySaver\n\nagent = create_deep_agent(\n    backend=FilesystemBackend(root_dir=\".\", virtual_mode=True),  # Restrict access\n    interrupt_on={\"write_file\": True, \"edit_file\": True},\n    checkpointer=MemorySaver()\n)\n\n# Agent can read\u002Fwrite actual files on disk\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nUse FilesystemBackend for local development with real disk access and human-in-the-loop.\n```typescript\nimport { createDeepAgent, FilesystemBackend } from \"deepagents\";\nimport { MemorySaver } from \"@langchain\u002Flanggraph\";\n\nconst agent = await createDeepAgent({\n  backend: new FilesystemBackend({ rootDir: \".\", virtualMode: true }),\n  interruptOn: { write_file: true, edit_file: true },\n  checkpointer: new MemorySaver()\n});\n```\n\u003C\u002Ftypescript>\n\n**Security: Never use FilesystemBackend in web servers - use StateBackend or sandbox instead.**\n\u003C\u002Fex-filesystem-backend-local-dev>\n\n\u003Cex-store-in-custom-tools>\n\u003Cpython>\nAccess the store directly in custom tools for long-term memory operations.\n```python\nfrom langchain.tools import tool, ToolRuntime\nfrom langchain.agents import create_agent\nfrom langgraph.store.memory import InMemoryStore\n\n@tool\ndef get_user_preference(key: str, runtime: ToolRuntime) -> str:\n    \"\"\"Get a user preference from long-term storage.\"\"\"\n    store = runtime.store\n    result = store.get((\"user_prefs\",), key)\n    return str(result.value) if result else \"Not found\"\n\n@tool\ndef save_user_preference(key: str, value: str, runtime: ToolRuntime) -> str:\n    \"\"\"Save a user preference to long-term storage.\"\"\"\n    store = runtime.store\n    store.put((\"user_prefs\",), key, {\"value\": value})\n    return f\"Saved {key}={value}\"\n\nstore = InMemoryStore()\n\nagent = create_agent(\n    model=\"gpt-4.1\",\n    tools=[get_user_preference, save_user_preference],\n    store=store\n)\n```\n\u003C\u002Fpython>\n\u003C\u002Fex-store-in-custom-tools>\n\n\u003Cboundaries>\n### What Agents CAN Configure\n\n- Backend type and configuration\n- Routing rules for CompositeBackend\n- Root directory for FilesystemBackend\n- Human-in-the-loop for file operations\n\n### What Agents CANNOT Configure\n\n- Tool names (ls, read_file, write_file, edit_file, glob, grep)\n- Access files outside virtual_mode restrictions\n- Cross-thread file access without proper backend setup\n\u003C\u002Fboundaries>\n\n\u003Cfix-storebackend-requires-store>\n\u003Cpython>\nStoreBackend requires a store instance.\n```python\n# WRONG\nagent = create_deep_agent(backend=lambda rt: StoreBackend(rt))\n\n# CORRECT\nagent = create_deep_agent(backend=lambda rt: StoreBackend(rt), store=InMemoryStore())\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nStoreBackend requires a store instance.\n```typescript\n\u002F\u002F WRONG\nconst agent = await createDeepAgent({ backend: (c) => new StoreBackend(c) });\n\n\u002F\u002F CORRECT\nconst agent = await createDeepAgent({ backend: (c) => new StoreBackend(c), store: new InMemoryStore() });\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-storebackend-requires-store>\n\n\u003Cfix-statebackend-files-dont-persist>\n\u003Cpython>\nStateBackend files are thread-scoped - use same thread_id or StoreBackend for cross-thread access.\n```python\n# WRONG: thread-2 can't read file from thread-1\nagent.invoke({\"messages\": [...]}, config={\"configurable\": {\"thread_id\": \"thread-1\"}})  # Write\nagent.invoke({\"messages\": [...]}, config={\"configurable\": {\"thread_id\": \"thread-2\"}})  # File not found!\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nStateBackend files are thread-scoped - use same thread_id or StoreBackend for cross-thread access.\n```typescript\n\u002F\u002F WRONG: thread-2 can't read file from thread-1\nawait agent.invoke({ messages: [...] }, { configurable: { thread_id: \"thread-1\" } });  \u002F\u002F Write\nawait agent.invoke({ messages: [...] }, { configurable: { thread_id: \"thread-2\" } });  \u002F\u002F File not found!\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-statebackend-files-dont-persist>\n\n\u003Cfix-path-prefix-for-persistence>\n\u003Cpython>\nPath must match CompositeBackend route prefix for persistence.\n```python\n# With routes={\"\u002Fmemories\u002F\": StoreBackend(rt)}:\nagent.invoke(...)  # \u002Fprefs.txt -> ephemeral (no match)\nagent.invoke(...)  # \u002Fmemories\u002Fprefs.txt -> persistent (matches route)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nPath must match CompositeBackend route prefix for persistence.\n```typescript\n\u002F\u002F With routes: { \"\u002Fmemories\u002F\": StoreBackend }:\nawait agent.invoke(...);  \u002F\u002F \u002Fprefs.txt -> ephemeral (no match)\nawait agent.invoke(...);  \u002F\u002F \u002Fmemories\u002Fprefs.txt -> persistent (matches route)\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-path-prefix-for-persistence>\n\n\u003Cfix-production-store>\n\u003Cpython>\nUse PostgresStore for production (InMemoryStore lost on restart).\n```python\n# WRONG                              # CORRECT\nstore = InMemoryStore()              store = PostgresStore(connection_string=\"postgresql:\u002F\u002F...\")\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nUse PostgresStore for production (InMemoryStore lost on restart).\n```typescript\n\u002F\u002F WRONG                                    \u002F\u002F CORRECT\nconst store = new InMemoryStore();          const store = new PostgresStore({ connectionString: \"...\" });\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-production-store>\n\n\u003Cfix-filesystem-backend-needs-virtual-mode>\n\u003Cpython>\nEnable virtual_mode=True to restrict path access (prevents ..\u002F and ~\u002F escapes).\n```python\nbackend = FilesystemBackend(root_dir=\"\u002Fproject\", virtual_mode=True)  # Secure\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-filesystem-backend-needs-virtual-mode>\n\n\u003Cfix-longest-prefix-match>\n\u003Cpython>\nCompositeBackend matches longest prefix first.\n```python\nroutes = {\"\u002Fmem\u002F\": StoreBackend(rt), \"\u002Fmem\u002Ftemp\u002F\": StateBackend(rt)}\n# \u002Fmem\u002Ffile.txt -> StoreBackend, \u002Fmem\u002Ftemp\u002Ffile.txt -> StateBackend (longer match)\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-longest-prefix-match>\n","\u003Coverview>\nDeep Agents use pluggable backends for file operations and memory:\n\n**Short-term (StateBackend)**: Persists within a single thread, lost when thread ends\n**Long-term (StoreBackend)**: Persists across threads and sessions\n**Hybrid (CompositeBackend)**: Route different paths to different backends\n\nFilesystemMiddleware provides tools: `ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`\n\u003C\u002Foverview>\n\n\u003Cbackend-selection>\n\n| Use Case | Backend | Why |\n|----------|---------|-----|\n| Temporary working files | StateBackend | Default, no setup |\n| Local development CLI | FilesystemBackend | Direct disk access |\n| Cross-session memory | StoreBackend | Persists across threads |\n| Hybrid storage | CompositeBackend | Mix ephemeral + persistent |\n\n\u003C\u002Fbackend-selection>\n\n\u003Cex-default-state-backend>\n\u003Cpython>\nDefault StateBackend stores files ephemerally within a thread.\n```python\nfrom deepagents import create_deep_agent\n\nagent = create_deep_agent()  # Default: StateBackend\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"Write notes to \u002Fdraft.txt\"}]\n}, config={\"configurable\": {\"thread_id\": \"thread-1\"}})\n# \u002Fdraft.txt is lost when thread ends\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nDefault StateBackend stores files ephemerally within a thread.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\n\nconst agent = await createDeepAgent();  \u002F\u002F Default: StateBackend\nconst result = await agent.invoke({\n  messages: [{ role: \"user\", content: \"Write notes to \u002Fdraft.txt\" }]\n}, { configurable: { thread_id: \"thread-1\" } });\n\u002F\u002F \u002Fdraft.txt is lost when thread ends\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-default-state-backend>\n\n\u003Cex-composite-backend-for-hybrid>\n\u003Cpython>\nConfigure CompositeBackend to route paths to different storage backends.\n```python\nfrom deepagents import create_deep_agent\nfrom deepagents.backends import CompositeBackend, StateBackend, StoreBackend\nfrom langgraph.store.memory import InMemoryStore\n\nstore = InMemoryStore()\n\ncomposite_backend = lambda rt: CompositeBackend(\n    default=StateBackend(rt),\n    routes={\"\u002Fmemories\u002F\": StoreBackend(rt)}\n)\n\nagent = create_deep_agent(backend=composite_backend, store=store)\n\n# \u002Fdraft.txt -> ephemeral (StateBackend)\n# \u002Fmemories\u002Fuser-prefs.txt -> persistent (StoreBackend)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nConfigure CompositeBackend to route paths to different storage backends.\n```typescript\nimport { createDeepAgent, CompositeBackend, StateBackend, StoreBackend } from \"deepagents\";\nimport { InMemoryStore } from \"@langchain\u002Flanggraph\";\n\nconst store = new InMemoryStore();\n\nconst agent = await createDeepAgent({\n  backend: (config) => new CompositeBackend(\n    new StateBackend(config),\n    { \"\u002Fmemories\u002F\": new StoreBackend(config) }\n  ),\n  store\n});\n\n\u002F\u002F \u002Fdraft.txt -> ephemeral (StateBackend)\n\u002F\u002F \u002Fmemories\u002Fuser-prefs.txt -> persistent (StoreBackend)\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-composite-backend-for-hybrid>\n\n\u003Cex-cross-session-memory>\n\u003Cpython>\nFiles in \u002Fmemories\u002F persist across threads via StoreBackend routing.\n```python\n# Using CompositeBackend from previous example\nconfig1 = {\"configurable\": {\"thread_id\": \"thread-1\"}}\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Save to \u002Fmemories\u002Fstyle.txt\"}]}, config=config1)\n\nconfig2 = {\"configurable\": {\"thread_id\": \"thread-2\"}}\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Read \u002Fmemories\u002Fstyle.txt\"}]}, config=config2)\n# Thread 2 can read file saved by Thread 1\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nFiles in \u002Fmemories\u002F persist across threads via StoreBackend routing.\n```typescript\n\u002F\u002F Using CompositeBackend from previous example\nconst config1 = { configurable: { thread_id: \"thread-1\" } };\nawait agent.invoke({ messages: [{ role: \"user\", content: \"Save to \u002Fmemories\u002Fstyle.txt\" }] }, config1);\n\nconst config2 = { configurable: { thread_id: \"thread-2\" } };\nawait agent.invoke({ messages: [{ role: \"user\", content: \"Read \u002Fmemories\u002Fstyle.txt\" }] }, config2);\n\u002F\u002F Thread 2 can read file saved by Thread 1\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-cross-session-memory>\n\n\u003Cex-filesystem-backend-local-dev>\n\u003Cpython>\nUse FilesystemBackend for local development with real disk access and human-in-the-loop.\n```python\nfrom deepagents import create_deep_agent\nfrom deepagents.backends import FilesystemBackend\nfrom langgraph.checkpoint.memory import MemorySaver\n\nagent = create_deep_agent(\n    backend=FilesystemBackend(root_dir=\".\", virtual_mode=True),  # Restrict access\n    interrupt_on={\"write_file\": True, \"edit_file\": True},\n    checkpointer=MemorySaver()\n)\n\n# Agent can read\u002Fwrite actual files on disk\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nUse FilesystemBackend for local development with real disk access and human-in-the-loop.\n```typescript\nimport { createDeepAgent, FilesystemBackend } from \"deepagents\";\nimport { MemorySaver } from \"@langchain\u002Flanggraph\";\n\nconst agent = await createDeepAgent({\n  backend: new FilesystemBackend({ rootDir: \".\", virtualMode: true }),\n  interruptOn: { write_file: true, edit_file: true },\n  checkpointer: new MemorySaver()\n});\n```\n\u003C\u002Ftypescript>\n\n**Security: Never use FilesystemBackend in web servers - use StateBackend or sandbox instead.**\n\u003C\u002Fex-filesystem-backend-local-dev>\n\n\u003Cex-store-in-custom-tools>\n\u003Cpython>\nAccess the store directly in custom tools for long-term memory operations.\n```python\nfrom langchain.tools import tool, ToolRuntime\nfrom langchain.agents import create_agent\nfrom langgraph.store.memory import InMemoryStore\n\n@tool\ndef get_user_preference(key: str, runtime: ToolRuntime) -> str:\n    \"\"\"Get a user preference from long-term storage.\"\"\"\n    store = runtime.store\n    result = store.get((\"user_prefs\",), key)\n    return str(result.value) if result else \"Not found\"\n\n@tool\ndef save_user_preference(key: str, value: str, runtime: ToolRuntime) -> str:\n    \"\"\"Save a user preference to long-term storage.\"\"\"\n    store = runtime.store\n    store.put((\"user_prefs\",), key, {\"value\": value})\n    return f\"Saved {key}={value}\"\n\nstore = InMemoryStore()\n\nagent = create_agent(\n    model=\"gpt-4.1\",\n    tools=[get_user_preference, save_user_preference],\n    store=store\n)\n```\n\u003C\u002Fpython>\n\u003C\u002Fex-store-in-custom-tools>\n\n\u003Cboundaries>\n### What Agents CAN Configure\n\n- Backend type and configuration\n- Routing rules for CompositeBackend\n- Root directory for FilesystemBackend\n- Human-in-the-loop for file operations\n\n### What Agents CANNOT Configure\n\n- Tool names (ls, read_file, write_file, edit_file, glob, grep)\n- Access files outside virtual_mode restrictions\n- Cross-thread file access without proper backend setup\n\u003C\u002Fboundaries>\n\n\u003Cfix-storebackend-requires-store>\n\u003Cpython>\nStoreBackend requires a store instance.\n```python\n# WRONG\nagent = create_deep_agent(backend=lambda rt: StoreBackend(rt))\n\n# CORRECT\nagent = create_deep_agent(backend=lambda rt: StoreBackend(rt), store=InMemoryStore())\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nStoreBackend requires a store instance.\n```typescript\n\u002F\u002F WRONG\nconst agent = await createDeepAgent({ backend: (c) => new StoreBackend(c) });\n\n\u002F\u002F CORRECT\nconst agent = await createDeepAgent({ backend: (c) => new StoreBackend(c), store: new InMemoryStore() });\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-storebackend-requires-store>\n\n\u003Cfix-statebackend-files-dont-persist>\n\u003Cpython>\nStateBackend files are thread-scoped - use same thread_id or StoreBackend for cross-thread access.\n```python\n# WRONG: thread-2 can't read file from thread-1\nagent.invoke({\"messages\": [...]}, config={\"configurable\": {\"thread_id\": \"thread-1\"}})  # Write\nagent.invoke({\"messages\": [...]}, config={\"configurable\": {\"thread_id\": \"thread-2\"}})  # File not found!\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nStateBackend files are thread-scoped - use same thread_id or StoreBackend for cross-thread access.\n```typescript\n\u002F\u002F WRONG: thread-2 can't read file from thread-1\nawait agent.invoke({ messages: [...] }, { configurable: { thread_id: \"thread-1\" } });  \u002F\u002F Write\nawait agent.invoke({ messages: [...] }, { configurable: { thread_id: \"thread-2\" } });  \u002F\u002F File not found!\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-statebackend-files-dont-persist>\n\n\u003Cfix-path-prefix-for-persistence>\n\u003Cpython>\nPath must match CompositeBackend route prefix for persistence.\n```python\n# With routes={\"\u002Fmemories\u002F\": StoreBackend(rt)}:\nagent.invoke(...)  # \u002Fprefs.txt -> ephemeral (no match)\nagent.invoke(...)  # \u002Fmemories\u002Fprefs.txt -> persistent (matches route)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nPath must match CompositeBackend route prefix for persistence.\n```typescript\n\u002F\u002F With routes: { \"\u002Fmemories\u002F\": StoreBackend }:\nawait agent.invoke(...);  \u002F\u002F \u002Fprefs.txt -> ephemeral (no match)\nawait agent.invoke(...);  \u002F\u002F \u002Fmemories\u002Fprefs.txt -> persistent (matches route)\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-path-prefix-for-persistence>\n\n\u003Cfix-production-store>\n\u003Cpython>\nUse PostgresStore for production (InMemoryStore lost on restart).\n```python\n# WRONG                              # CORRECT\nstore = InMemoryStore()              store = PostgresStore(connection_string=\"postgresql:\u002F\u002F...\")\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nUse PostgresStore for production (InMemoryStore lost on restart).\n```typescript\n\u002F\u002F WRONG                                    \u002F\u002F CORRECT\nconst store = new InMemoryStore();          const store = new PostgresStore({ connectionString: \"...\" });\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-production-store>\n\n\u003Cfix-filesystem-backend-needs-virtual-mode>\n\u003Cpython>\nEnable virtual_mode=True to restrict path access (prevents ..\u002F and ~\u002F escapes).\n```python\nbackend = FilesystemBackend(root_dir=\"\u002Fproject\", virtual_mode=True)  # Secure\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-filesystem-backend-needs-virtual-mode>\n\n\u003Cfix-longest-prefix-match>\n\u003Cpython>\nCompositeBackend matches longest prefix first.\n```python\nroutes = {\"\u002Fmem\u002F\": StoreBackend(rt), \"\u002Fmem\u002Ftemp\u002F\": StateBackend(rt)}\n# \u002Fmem\u002Ffile.txt -> StoreBackend, \u002Fmem\u002Ftemp\u002Ffile.txt -> StateBackend (longer match)\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-longest-prefix-match>\n",{"name":5,"description":7},"main","1ca81b0a7de199942400f965edd4d7544077ac5d",".claude\u002Fskills\u002Fdeep-agents-memory","https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai","https:\u002F\u002Fgithub.com\u002FCoralShades","coralshades.com.au","2026-04-18 00:45:07",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add CoralShades\u002Facm-ai --skill deep-agents-memory",{"tool":43,"command":44},"bunx","bunx skills add CoralShades\u002Facm-ai --skill deep-agents-memory",{"tool":46,"command":47},"pnpm","pnpm dlx skills add CoralShades\u002Facm-ai --skill deep-agents-memory","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdeep-agents-memory\u002FSKILL.md",true,[],[52,76,89,104,126,136],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":63,"publishedAt":25},"01M6C63HKXA890HHV47WBAX0TB","uncodixfy","Prevents generic AI\u002FCodex UI patterns when generating frontend code. Use this skill whenever generating HTML, CSS, React, Vue, Svelte, or any frontend UI code to enforce clean, human-designed aesthetics inspired by Linear, Raycast, Stripe, and GitHub instead of typical AI-generated UI.","https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai\u002Fblob\u002Fmain\u002F.qwen\u002Fskills\u002Funcodixfy\u002FSKILL.md",[58],{"categoryNo":59,"categoryName":60,"taxonomyType":61,"taxonomyTypeDesc":62},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[54,64,65,66,67,68,69,70,71,72,73,74,75],"github","frontend","css","codex","react","code","linear","ui","vue","generated","use","html",{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":25},"01M6C63FJ2GEBBGZ5XSMV40KXB","runpodctl","Runpod CLI to manage your GPU workloads.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai\u002Fblob\u002Fmain\u002F.qwen\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[78,84,85,86,87,88],"macos","cli","linux","gpu","Bash",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":25},"01M6C63DPAV46TFVQ01SFYPJ7X","langgraph-persistence","INVOKE THIS SKILL when your LangGraph needs to persist state, remember conversations, travel through history, or configure subgraph checkpointer scoping. Covers checkpointers, thread_id, time travel, Store, and subgraph persistence modes.","https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai\u002Fblob\u002Fmain\u002F.qwen\u002Fskills\u002Flanggraph-persistence\u002FSKILL.md",[],[96,97,22,98,99,100,101,102,103],"langgraph persistence","langgraph","travel","history","scoping","remember","state","configure",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":115,"publishedAt":25},"01M6C63BNS9CQEBTB8RNSSBFPA","langgraph-human-in-the-loop","INVOKE THIS SKILL when implementing human-in-the-loop patterns, pausing for approval, or handling errors in LangGraph. Covers interrupt(), Command(resume=...), approval\u002Fvalidation workflows, and the 4-tier error handling strategy.","https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai\u002Fblob\u002Fmain\u002F.qwen\u002Fskills\u002Flanggraph-human-in-the-loop\u002FSKILL.md",[110],{"categoryNo":111,"categoryName":112,"taxonomyType":113,"taxonomyTypeDesc":114},"01JBSEEDCAT000000000000038","人力资源","PROFESSION","适用职业",[116,117,97,118,119,120,121,122,123,124,125],"langgraph human in the loop","loop","workflows","error handling","validation","human-in-the-loop","command","strategy","approval","resume",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":25},"01M6C639GVYZFX3NFPV5FBDR4F","langgraph-fundamentals","INVOKE THIS SKILL when writing ANY LangGraph code. Covers StateGraph, state schemas, nodes, edges, Command, Send, invoke, streaming, and error handling.","https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai\u002Fblob\u002Fmain\u002F.qwen\u002Fskills\u002Flanggraph-fundamentals\u002FSKILL.md",[],[133,97,119,102,134,135,122,69],"langgraph fundamentals","streaming","writing",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":25},"01M6C6375N34YX2GZ3SD3R7XR2","langchain-rag","INVOKE THIS SKILL when building ANY retrieval-augmented generation (RAG) system. Covers document loaders, RecursiveCharacterTextSplitter, embeddings (OpenAI), and vector stores (Chroma, FAISS, Pinecone).","https:\u002F\u002Fgithub.com\u002FCoralShades\u002Facm-ai\u002Fblob\u002Fmain\u002F.qwen\u002Fskills\u002Flangchain-rag\u002FSKILL.md",[],[143,144,145,146,147,148,149,150,151,152],"rag","langchain rag","langchain","embeddings","vector","openai","chroma","faiss","vector stores","system"]