deep-agents-memory

Configure pluggable memory and filesystem backends for Deep Agents.

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/flemx/salesforce-langgraph-agent --skill deep-agents-memory-flemx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deep-agents-memory
Source: https://github.com/flemx/salesforce-langgraph-agent/tree/main/.agents/skills/deep-agents-memory
Command: npx skills add https://github.com/flemx/salesforce-langgraph-agent --skill deep-agents-memory-flemx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires deepagents, langgraph, langchain.

What problem does it solve? Deep Agents need file storage and memory, but choosing between ephemeral thread-scoped state, persistent cross-session storage, and real disk access is confusing and error-prone. This Skill explains how to select and configure the right backend so agent files persist exactly where and when you need them. ## Core Features & Use Cases - Backend Selection Guidance: Compares StateBackend (ephemeral), StoreBackend (persistent), FilesystemBackend (local disk), and CompositeBackend (hybrid routing) with a decision table. - Hybrid Memory Routing: Shows how to route paths like /memories/ to persistent storage while keeping working files ephemeral, using CompositeBackend with longest-prefix matching. - Custom Tool Memory Access: Demonstrates reading and writing long-term user preferences directly through the LangGraph store in custom tools. - Common Pitfall Fixes: Documents fixes for missing store instances, thread-scoped file loss, route prefix mismatches, and insecure FilesystemBackend usage. - Use Case: Build a support agent that remembers user preferences across conversations by routing /memories/ writes to a PostgresStore while keeping scratch files thread-local. ## Quick Start Ask the agent to configure a Deep Agent with a CompositeBackend that persists files under /memories/ across threads using a store.

Frequently Asked Questions about deep-agents-memory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add long-term memory to a Deep Agent?

Use StoreBackend with a store instance such as InMemoryStore or PostgresStore, passed via the store parameter to create_deep_agent. Files written through StoreBackend persist across threads and sessions, unlike the default StateBackend.

StateBackend vs StoreBackend for agent file storage?

StateBackend stores files ephemerally within a single thread and loses them when the thread ends, requiring no setup. StoreBackend persists files across threads and sessions but requires passing a store instance to the agent.

How do I route some agent files to persistent storage and keep others temporary?

Use CompositeBackend with a default StateBackend and routes mapping path prefixes like /memories/ to StoreBackend. CompositeBackend matches the longest prefix first, so /memories/temp/ can override /memories/.

Why can't my agent read files written in a previous thread?

StateBackend files are thread-scoped, so a different thread_id cannot see them. Either reuse the same thread_id or route the path to StoreBackend through CompositeBackend for cross-thread persistence.

Is FilesystemBackend safe to use in a web server?

No, FilesystemBackend should never be used in web servers; use StateBackend or a sandbox instead. For local development, enable virtual_mode=True to restrict access to the root directory and prevent path escapes.

Why does StoreBackend fail when I create my Deep Agent?

StoreBackend requires a store instance passed to create_deep_agent via the store parameter. Without it the backend cannot persist data; use InMemoryStore for development and PostgresStore for production.