deep-agents-memory

Configure memory backends and filesystem persistence for Deep Agents.

Updated Jan 10, 2026
One-click install
npx skills add https://github.com/orezek/monorepo_template --skill deep-agents-memory-orezek
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: deep-agents-memory
Source: https://github.com/orezek/monorepo_template/tree/main/.agents/skills/deep-agents-memory
Command: npx skills add https://github.com/orezek/monorepo_template --skill deep-agents-memory-orezek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deep Agents lose their working files when a thread ends, and developers struggle to choose and configure the right storage backend for ephemeral versus persistent memory. This Skill provides concrete patterns for wiring StateBackend, StoreBackend, FilesystemBackend, and CompositeBackend so agents retain the right data across threads and sessions. ## Core Features & Use Cases - Backend Selection Guidance: Decision table mapping use cases (temporary files, local CLI development, cross-session memory, hybrid storage) to the correct backend. - CompositeBackend Routing: Route path prefixes like /memories/ to persistent StoreBackend while keeping other paths ephemeral, with longest-prefix-match semantics. - Custom Tool Store Access: Read and write long-term memory directly inside custom tools via ToolRuntime and a LangGraph store. - Use Case: Build a coding assistant that saves user style preferences to /memories/style.txt in one thread and reads them back in a later thread, while keeping scratch drafts ephemeral. ## Quick Start Ask the agent to configure a Deep Agent with CompositeBackend so files under /memories/ persist across threads using StoreBackend and an InMemoryStore.

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?▼

Add long-term memory by configuring a StoreBackend routed through CompositeBackend and passing a store instance like InMemoryStore to create_deep_agent. Files written under the routed prefix, such as /memories/, persist across threads and sessions.

What is the difference between StateBackend and StoreBackend in deepagents?▼

StateBackend stores files ephemerally within a single thread, so data is lost when the thread ends. StoreBackend persists files across threads and sessions, but requires passing a store instance such as InMemoryStore or PostgresStore to the agent.

Why does StoreBackend fail when creating a Deep Agent?▼

StoreBackend fails because it requires a store instance that was not provided. Fix it by passing store=InMemoryStore() (or PostgresStore in production) alongside the backend lambda in create_deep_agent.

Can a Deep Agent read files written by a different thread?▼

Cross-thread file access only works with StoreBackend routing, since StateBackend files are thread-scoped. Write to a path matching a CompositeBackend route like /memories/ so a second thread with a different thread_id can read it.

Is FilesystemBackend safe to use in a web server?▼

FilesystemBackend is not safe for web servers; use StateBackend or a sandbox instead. It is intended for local CLI development, and you should enable virtual_mode=True to restrict path access and prevent directory escapes.