Backend 654 installs

deep-agents-memory

by langchain-ai/langchain-skills

INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent),…

Skill content

Pluggable memory and file backends for Deep Agents with ephemeral, persistent, and hybrid routing options.

- Four backend types: StateBackend (thread-scoped, ephemeral), StoreBackend (cross-session persistent), FilesystemBackend (real disk access for local dev), and CompositeBackend (route different paths to different backends)

- FilesystemMiddleware provides six file operation tools: ls, read_file, write_file, edit_file, glob, grep

- CompositeBackend uses longest-prefix matching to route paths; files in matched routes persist across threads, others remain ephemeral

- StoreBackend requires a store instance (InMemoryStore for dev, PostgresStore for production); FilesystemBackend requires virtual_mode=True to prevent directory escape attacks

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

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