langchain-ai avatar

Deep Agents Memory

A solid reference for setting up memory and file persistence in Deep Agents. The skill covers the three main backend types: StateBackend for ephemeral storage within a thread, StoreBackend for cross-session persistence, and CompositeBackend for routing different paths to different storage types. The examples show practical patterns like routing /memories/ to persistent storage while keeping working files ephemeral. The FilesystemBackend section includes proper security warnings about never using it in web servers. Most useful when you need to understand the tradeoffs between storage backends or set up hybrid storage patterns where some data persists and other data doesn't.

skills.sh installs
19.8K
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add langchain-ai/langchain-skills --skill deep-agents-memory --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Use CaseBackendWhy
Temporary working filesStateBackendDefault, no setup
Local development CLIFilesystemBackendDirect disk access
Cross-session memoryStoreBackendPersists across threads
Hybrid storageCompositeBackendMix ephemeral + persistent
Default StateBackend stores files ephemerally within a thread.
from deepagents import create_deep_agent

Sponsors

Details

Repository
github.com/langchain-ai/langchain-skills
Category
AI & Agent Building

More from langchain-ai/langchain-skills

All 15
1github avatarplaywright-generate-testgithub/awesome-copilotGenerate a Playwright test based on a scenario using Playwright MCP18.2Kskills.sh installs
2github avatargithub-issuesgithub/awesome-copilotCreate, update, and manage GitHub issues using MCP tools. Use this skill when users want to create bug reports, feature requests, or task issues, update existin17.7Kskills.sh installs
3github avatarconventional-commitgithub/awesome-copilotPrompt and workflow for generating conventional commit messages using a structured XML format. Guides users to create standardized, descriptive commit messages 17.3Kskills.sh installs
4apify avatarapify-ultimate-scraperapify/agent-skillsUniversal AI-powered web scraper for any platform. Scrape data from Instagram, Facebook, TikTok, YouTube, LinkedIn, X/Twitter, Google Maps, Google Search, Googl16.7Kskills.sh installs
5agentspace-so avatargpt-image-2agentspace-so/runcomfy-agent-skillsImage generation and editing with OpenAI's GPT Image 2, optimized for embedded text, logos, and layout precision.16Kskills.sh installs
6github avatarsql-code-reviewgithub/awesome-copilotUniversal SQL code review assistant that performs comprehensive security, maintainability, and code quality analysis across all SQL databases (MySQL, PostgreSQL15.6Kskills.sh installs