Title: managed_tools | deepagents_code | LangChain Reference
Open Graph Title: managed_tools | deepagents_code
X Title: managed_tools | deepagents_code
Description: Python API reference for managed_tools in deepagents_code. Part of the LangChain ecosystem.
Open Graph Description: Python API reference for managed_tools in deepagents_code. Part of the LangChain ecosystem.
X Description: Python API reference for managed_tools in deepagents_code. Part of the LangChain ecosystem.
Opengraph URL: https://reference.langchain.com/python/deepagents-code/managed_tools
Domain: reference.langchain.com
| og:image | https://reference.langchain.com/og/python/deepagents-code/managed_tools |
| og:image:width | 1200 |
| og:image:height | 630 |
| og:image:alt | managed_tools | deepagents_code |
| og:type | article |
| twitter:card | summary_large_image |
| twitter:image | https://reference.langchain.com/og/python/deepagents-code/managed_tools |
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 |
| attributeOFFLINE: strDisable network downloads of managed binaries (e.g. ripgrep). Parsed by is_env_truthy: accepts 1, true, yes, on as enabled. When truthy, managed_tools.ensure_ripgrep will not attempt to download a binary and falls back to the existing missing-tool notification + slow Python regex path. | https://reference.langchain.com/python/deepagents-code/_env_vars/OFFLINE |
| attributeRIPGREP_INSTALLER: strSelect how ripgrep is provisioned: managed (default) or system. managed downloads the pinned, SHA-256-verified upstream binary into ~/.deepagents/bin (no sudo). system skips that download so power users can rely on their distro package / existing toolchain instead; the install script's system mode keeps the brew/apt/cargo path. A system rg already on PATH is reused under either setting. Unrecognized values fall back to managed. See managed_tools.ripgrep_installer. | https://reference.langchain.com/python/deepagents-code/_env_vars/RIPGREP_INSTALLER |
| attributelogger | https://reference.langchain.com/python/deepagents-code/managed_tools/logger |
| attributeRIPGREP_VERSION: strPinned upstream ripgrep release. Bump alongside RIPGREP_ASSETS. | https://reference.langchain.com/python/deepagents-code/managed_tools/RIPGREP_VERSION |
| attributeRIPGREP_ASSETS: dict[tuple[str, str], tuple[str, str]](sys.platform, normalized arch) -> (asset filename, sha256 hex). | https://reference.langchain.com/python/deepagents-code/managed_tools/RIPGREP_ASSETS |
| attributeBIN_DIR: PathDirectory holding managed binaries. Prepended to PATH on startup. | https://reference.langchain.com/python/deepagents-code/managed_tools/BIN_DIR |
| attributeRipgrepInstaller: Literal['managed', 'system']The two recognized ripgrep installer modes. | https://reference.langchain.com/python/deepagents-code/managed_tools/RipgrepInstaller |
| attributeINSTALLER_MANAGED: RipgrepInstallerDefault installer mode: fetch the pinned, checksummed upstream binary. | https://reference.langchain.com/python/deepagents-code/managed_tools/INSTALLER_MANAGED |
| attributeINSTALLER_SYSTEM: RipgrepInstallerInstaller mode that defers ripgrep to the system package manager / PATH. | https://reference.langchain.com/python/deepagents-code/managed_tools/INSTALLER_SYSTEM |
| functionis_env_truthyReturn whether env var name is set to a recognizably truthy value. Unlike bool(os.environ.get(name)), this does not treat "0" or "false" as enabled. Use this for on/off flags where the user would reasonably expect VAR=0 to mean "disabled". | https://reference.langchain.com/python/deepagents-code/_env_vars/is_env_truthy |
| functionmanaged_rg_pathReturn the managed ripgrep binary path (.exe on Windows). | https://reference.langchain.com/python/deepagents-code/managed_tools/managed_rg_path |
| functionis_offlineReturn whether managed-tool downloads are disabled via env var. | https://reference.langchain.com/python/deepagents-code/managed_tools/is_offline |
| functionripgrep_installerReturn the configured ripgrep installer mode. Reads RIPGREP_INSTALLER and normalizes it to INSTALLER_MANAGED or INSTALLER_SYSTEM, falling back to INSTALLER_MANAGED for unset or unrecognized values. The strip().lower() normalization must stay in sync with the case block in scripts/install.sh so both layers agree on the parsed mode. | https://reference.langchain.com/python/deepagents-code/managed_tools/ripgrep_installer |
| functionprefers_system_ripgrepReturn whether the user opted into the system ripgrep installer. In system mode ripgrep is provisioned by the OS package manager or an existing PATH entry rather than the managed download. | https://reference.langchain.com/python/deepagents-code/managed_tools/prefers_system_ripgrep |
| functionprepend_managed_bin_to_pathIdempotently prepend BIN_DIR to os.environ["PATH"]. Safe to call on every startup. Callers do not need to check whether the directory exists — adding a non-existent directory to PATH is harmless and matches behavior of common version managers. | https://reference.langchain.com/python/deepagents-code/managed_tools/prepend_managed_bin_to_path |
| functionensure_ripgrepEnsure a usable rg binary is available, installing if necessary. Resolution order: If the system installer is selected, return a non-managed rg found on PATH, or None when only the managed binary is present. If a managed rg exists and matches RIPGREP_VERSION, return it. Otherwise, if a system rg is on PATH and no managed binary exists, return its resolved path. This is gated on the absence of a managed binary: once a managed rg exists, the pinned version always wins, so a stale managed binary is re-fetched rather than deferring to a system rg and the resolved version stays deterministic. If offline, on an unsupported platform, or no asset matches the platform/arch, return None so callers fall back to the existing notification + slow path. Otherwise download → SHA-256 verify → extract → install → prepend BIN_DIR to PATH → return the installed path. On a checksum mismatch, raises ChecksumMismatchError so callers can surface a loud notice; other failures log and return None. A stale managed binary is never proactively deleted. The atomic replace in _install_ripgrep_sync overwrites it on success, and on failure the user is strictly better off keeping the older copy than being left with no rg at all. | https://reference.langchain.com/python/deepagents-code/managed_tools/ensure_ripgrep |
| classChecksumMismatchErrorRaised when a downloaded archive fails SHA-256 verification. Distinct from generic install failure so callers can surface a loud, user-visible notice — a checksum mismatch is a supply-chain anomaly (CDN poisoning, MITM, tampered mirror) and must not be silently treated like "you're offline". | https://reference.langchain.com/python/deepagents-code/managed_tools/ChecksumMismatchError |
| View source on GitHub | https://github.com/langchain-ai/deepagents/blob/019900734024a7665fd65bd75235c6307d5da003/libs/code/deepagents_code/managed_tools.py |
Viewport: width=device-width, initial-scale=1