Title: state_migration | deepagents_code | LangChain Reference
Open Graph Title: state_migration | deepagents_code
X Title: state_migration | deepagents_code
Description: Python API reference for state_migration in deepagents_code. Part of the LangChain ecosystem.
Open Graph Description: Python API reference for state_migration in deepagents_code. Part of the LangChain ecosystem.
X Description: Python API reference for state_migration in deepagents_code. Part of the LangChain ecosystem.
Opengraph URL: https://reference.langchain.com/python/deepagents-code/state_migration
Domain: reference.langchain.com
| og:image | https://reference.langchain.com/og/python/deepagents-code/state_migration |
| og:image:width | 1200 |
| og:image:height | 630 |
| og:image:alt | state_migration | deepagents_code |
| og:type | article |
| twitter:card | summary_large_image |
| twitter:image | https://reference.langchain.com/og/python/deepagents-code/state_migration |
Links:
| LangChain Reference home page | https://reference.langchain.com/ |
| GitHub | https://github.com/langchain-ai |
| Main Docs | https://docs.langchain.com/oss/python/deepagents |
| Deep Agents | https://reference.langchain.com/python/deepagents |
| LangChain | https://reference.langchain.com/python/langchain/overview |
| LangGraph | https://reference.langchain.com/python/langgraph/overview |
| Integrations | https://reference.langchain.com/python/integrations/overview |
| LangSmith | https://reference.langchain.com/python/langsmith |
| Deep Agents Code | https://reference.langchain.com/python/deepagents-code |
| Deep Agents Code | https://reference.langchain.com/python/deepagents-code |
| deepagents-code | https://reference.langchain.com/python/deepagents-code |
| attributeDEFAULT_CONFIG_DIRDirectory for user-level Deep Agents configuration (~/.deepagents). | https://reference.langchain.com/python/deepagents-code/model_config/DEFAULT_CONFIG_DIR |
| attributeDEFAULT_STATE_DIRDirectory for app-managed internal state (~/.deepagents/.state). Holds files the app writes for its own bookkeeping — OAuth tokens, the sessions database, version-check caches, input history. Kept separate from top-level user-facing config and agent directories so listing/iterating ~/.deepagents doesn't conflate state with agents. | https://reference.langchain.com/python/deepagents-code/model_config/DEFAULT_STATE_DIR |
| attributeONBOARDING_MARKER_FILENAME: strMarker filename under ~/.deepagents/.state after onboarding has completed. | https://reference.langchain.com/python/deepagents-code/onboarding/ONBOARDING_MARKER_FILENAME |
| attributelogger | https://reference.langchain.com/python/deepagents-code/state_migration/logger |
| functionmigrate_legacy_stateMove legacy state entries from config_dir into state_dir. Idempotent: each entry is skipped when the destination already exists (the migration ran on a prior invocation) or when the source does not exist (nothing to move). Errors on individual entries are logged and swallowed so a single unmovable file does not block the rest. | https://reference.langchain.com/python/deepagents-code/state_migration/migrate_legacy_state |
| View source on GitHub | https://github.com/langchain-ai/deepagents/blob/019900734024a7665fd65bd75235c6307d5da003/libs/code/deepagents_code/state_migration.py |
Viewport: width=device-width, initial-scale=1