# Managed Deep Agents explained in 20 minutes <!-- ref: @content/youtube/langchain/2026-08-07-managed-deep-agents-explained-in-20-minutes version: 3 updated_at: 2026-10-31T18:14:13.098Z --> From LangChain, 2026-08-07: The LangChain presenter describes an agent as three layers. The first is business logic, which only you can provide. **[Watch on YouTube](https://www.youtube.com/watch?v=yi-XZnAVFJg)** *Synthesized from the LangChain presenter on LangChain, 2026-08-07.* The speaker is a LangChain team member who announces the launch, explains the concepts, and walks through a live quick start. The transcript never gives their name, so this summary calls them "the LangChain presenter." ## Core Thesis The LangChain presenter describes an agent as three layers. The first is business logic, which only you can provide. The second is a harness that manages context and runs the model loop. The third is the production infrastructure that serves the agent to thousands or millions of users. Managed Deep Agents packages LangChain's open-source, model-agnostic **Deep Agents** harness together with LangSmith-hosted infrastructure, so a developer supplies only prompts, skills, tools and subagents and can go from a local project to a production deployment in a few CLI commands. ## Key Insights - **Three layers of an agent.** (1) Business logic: prompts, skills, tools and subagents. This is what makes one agent different from another, and no framework or model can supply it. (2) The harness: context management, orchestration, and the loop that calls the model. (3) Infrastructure: runtime, sandboxes and the rest of what production needs. - **Seven things that make deploying agents hard, according to the presenter:** - **Runtime:** durable execution and fault tolerance (a run that fails halfway resumes rather than restarting), event streaming for front ends, queuing, run cancellation, and rollbacks for bursty traffic. - **Sandboxes:** needed whenever an agent writes and runs untrusted code. - **Where context lives:** instructions, skills and RAG-style context should sit somewhere non-developers can edit. The people best placed to edit it often don't work in GitHub. - **Evals:** used to benchmark the agent, compare model choices, and test prompt changes. They are hard to build and maintain. - **Auth:** knowing who is calling the agent and what they are allowed to see and do. - **UX:** the presenter calls this "one of the most underrated" problems, meaning how you actually put the agent in front of users. - **Memory:** what the agent remembers, how that is stored, and how it is fed back into later runs. - **Architecture of Managed Deep Agents:** - **Agent loop:** the Deep Agents harness, running inside **LangSmith Deployments**. Deployments provide durable execution, fault tolerance and streaming out of the box. Your tools and middleware load into this loop. - **Context Hub:** stores instructions, skills and other context outside the code. You edit it in a UI and the agent picks up changes **without a redeploy**. - **Memory:** the agent both reads and writes memory, and memory is also stored in Context Hub so it can be audited. - **LangSmith Sandboxes:** used for writing and executing code. - **Schedules:** cron jobs built into LangSmith Deployments that start the agent with a set input at a set time. The presenter expects agents to become more proactive, running in the background on schedules or events and reporting back. - **Connectors:** remote **MCP** servers such as Slack, Notion and Linear. - **Auth layer:** identifies callers. A basic version is available if you handle identity in your own backend; a **Supabase** integration is available for tighter coupling. - **Channels:** ways to reach users where they already are. **Slack** is the first channel at launch. LangSmith Deployments also expose endpoints for building a custom web app. - **Evals:** use **Harbor**, an open-source eval format the presenter calls the industry standard. Harbor evals can be built for any Managed Deep Agents deployment. - **The agent is defined as a file system.** Running `mda init research-assistant` creates: - `.env` for model credentials, the LangSmith API key and other keys - `.gitignore` - a README - `agent.py`, which holds the core definition via `define_deep_agent(...)` - `identity.py`, which holds basic auth and access rules - `instructions.md`, the core system prompt - `pyproject.toml`, the dependencies - a `sandbox` folder for sandbox configuration - **Model strings use the format `provider:model-name`.** The demo uses OpenAI's GPT-5.5. Any model LangChain supports works, and there are advanced options for bringing your own model. - **Default sandbox scope is one sandbox per conversation thread.** You can also remove sandboxes entirely, or scope a single sandbox to the whole agent so that all threads share it. - **Python and TypeScript** are both supported. The demo uses Python. - **Live proof of the Context Hub design.** After deploying, the presenter added "Respond in Italian" to `instructions.md` in the Context Hub UI and saved it. The next "hi" sent through LangSmith Studio got an answer in Italian, with no redeploy. The presenter's point is that context kept outside the deployment is easier to edit, audit and work on as a team. ## Actionable Takeaways 1. **Prerequisites:** a LangSmith API key, the `uv` package manager, and an API key for your chosen model provider. 2. **Install the CLI:** use `uv tool install` on the Managed Deep Agents package, which includes the `mda` CLI. Then `export` your LangSmith API key. Alternatively, put the key in the project's `.env` later; `mda init` picks it up from the environment and writes it to `.env`. 3. **Scaffold the agent:** run `mda init research-assistant` and `cd` into the new directory. 4. **Configure `agent.py`:** set `name` (for example `research-assistant-123`), which also names the deployment and the graph. Set `model` as `"openai:gpt-5.5"`, or any `provider:model` string. 5. **Add keys to `.env`:** the model provider key (here, OpenAI) plus any tool keys. 6. **Rewrite `instructions.md`** with your agent's system prompt, in this case a research assistant. 7. **Add a custom tool, using Tavily search as the example:** - Add the Tavily Python client as a dependency. It will appear in `pyproject.toml`. - Add `TAVILY_API_KEY` to `.env`. - Create a `tools/` directory with an empty `__init__.py` and a `search.py` that defines `internet_search(query, max_results)`, which wraps the Tavily client. - In `agent.py`, import it with `from tools.search import internet_search` and pass it to `define_deep_agent(..., tools=[internet_search])`. 8. **Test locally:** run the dev command. It compiles the project, starts a local LangGraph dev server, and opens **LangSmith Studio**, which offers a chat interface and a graph view of the model-and-tools loop. 9. **Deploy:** run `mda deploy`. It first syncs instructions and skills to a Context Hub entry named after your agent, then creates and builds the deployment. This takes about a minute or two, and you can watch the revision build on the LangSmith Deployments page. 10. **Iterate on context without redeploying:** edit `instructions.md` and other context in the Context Hub UI. Changes take effect on the next run. 11. **Optional settings to revisit:** sandbox scope (per thread, per agent, or none), Supabase-backed identity, remote MCP connectors, the Slack channel, cron schedules, and Harbor evals. ## Notable Quotes > "This is something that you have to provide. This isn't something that any framework or any provider or any model can give you." — LangChain presenter, on business logic > "UX is really hard. This is actually one of the most underrated things I think about building agents." — LangChain presenter > "You don't have to do another redeploy. It doesn't actually live in the code, it actually is stored in the context hub." — LangChain presenter > "Managed deep agents is defined as a file system. So, this is one of the cool parts about it." — LangChain presenter > "Agents will be more and more proactive in the future. They'll run in the background whether on schedules or on events." — LangChain presenter --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*