René's URL Explorer Experiment


Title: memory_guard | deepagents_code | LangChain Reference

Open Graph Title: memory_guard | deepagents_code

X Title: memory_guard | deepagents_code

Description: Python API reference for memory_guard in deepagents_code. Part of the LangChain ecosystem.

Open Graph Description: Python API reference for memory_guard in deepagents_code. Part of the LangChain ecosystem.

X Description: Python API reference for memory_guard in deepagents_code. Part of the LangChain ecosystem.

Opengraph URL: https://reference.langchain.com/python/deepagents-code/memory_guard

direct link

Domain: reference.langchain.com

og:imagehttps://reference.langchain.com/og/python/deepagents-code/memory_guard
og:image:width1200
og:image:height630
og:image:altmemory_guard | deepagents_code
og:typearticle
twitter:cardsummary_large_image
twitter:imagehttps://reference.langchain.com/og/python/deepagents-code/memory_guard

Links:

LangChain Reference home pagehttps://reference.langchain.com/
GitHubhttps://github.com/langchain-ai
Main Docshttps://docs.langchain.com/oss/python/deepagents
Deep Agentshttps://reference.langchain.com/python/deepagents
LangChainhttps://reference.langchain.com/python/langchain/overview
LangGraphhttps://reference.langchain.com/python/langgraph/overview
Integrationshttps://reference.langchain.com/python/integrations/overview
LangSmithhttps://reference.langchain.com/python/langsmith
Deep Agents Codehttps://reference.langchain.com/python/deepagents-code
Deep Agents Codehttps://reference.langchain.com/python/deepagents-code
deepagents-codehttps://reference.langchain.com/python/deepagents-code
attributeloggerhttps://reference.langchain.com/python/deepagents-code/memory_guard/logger
functionextract_onboarding_name_blockReturn the managed onboarding name block (markers included) if present.https://reference.langchain.com/python/deepagents-code/onboarding/extract_onboarding_name_block
functionstrip_onboarding_name_markersRemove every onboarding-name marker occurrence from text. A partial edit can leave a lone start or end marker behind. Stripping all marker strings before re-inserting the managed block keeps re-insertion from producing orphaned markers that would confuse extract_onboarding_name_block.https://reference.langchain.com/python/deepagents-code/onboarding/strip_onboarding_name_markers
classManagedMemoryGuardMiddlewareRevert agent edits to the managed onboarding-name memory block. Guards the managed onboarding-name block in a fixed set of memory files. A write_file/edit_file that leaves the managed block untouched passes through; one that alters or drops it has the block restored (other edits kept) and returns an error. A delete targeting a guarded file (or a parent directory that contains one) is rejected outright before the tool runs when the file holds a managed block or exists but cannot be read. If the restore itself fails, an error is still returned so the failure is never silent.https://reference.langchain.com/python/deepagents-code/memory_guard/ManagedMemoryGuardMiddleware
View source on GitHubhttps://github.com/langchain-ai/deepagents/blob/bd9bafaad3f51d426563aa24658bbb3a089d4825/libs/code/deepagents_code/memory_guard.py

Viewport: width=device-width, initial-scale=1


URLs of crawlers that visited me.