# Managed Deep Agents explained in 20 minutes

## Executive summary

Managed Deep Agents provides an integrated framework to simplify the entire lifecycle of building, running, and deploying AI agents into production. It addresses the complexity of agent infrastructure by bundling the open-source Deep Agents harness with necessary components like durable execution, context management (via Context Hub), sandboxes, and scheduling capabilities, allowing developers to move from local business logic directly to a scalable, managed deployment on LangSmith.

## Key takeaways

- Agent Architecture Components: An agent requires three layers: 1) Business Logic (provided by the user, e.g., prompts/tools); 2) Harness (orchestrates context and passes data to the model); and 3) Infrastructure (runtime, sandboxes, etc.). Managed Deep Agents bundles these into a seamless package.
- Production Readiness: The framework handles complex production requirements such as durable execution, fault tolerance, streaming, queueing, run cancellation, and rollbacks, which are necessary when moving agents from local development to cloud serving.
- Decoupled Context Management: Context (instructions and skills) is stored in the dedicated Context Hub. This allows non-developers to edit and maintain agent context via a UI without requiring code changes or redeployments, significantly improving collaboration.
- Deployment Workflow: The process involves initializing the project using `MDA innit research assistant`, defining components (e.g., tools in `tools/search.py`), and deploying via `MDA deploy`. This pushes context to Context Hub and creates a deployment on LangSmith.

## Technical details

- Agent Core Components: The core agent logic is defined by the user's business logic (prompts, skills, tools). The Deep Agents harness manages context orchestration. Managed Deep Agents integrates these with LangSmith Deployments for production runtime.
- Deployment Infrastructure: LangSmith Deployments provide essential runtime features: durable execution, fault tolerance, streaming, queueing, and run cancellation. The system also supports sandboxes for running untrusted code and scheduling (cron job functionality).
- Context Management Flow: Instructions and skills are stored in the Context Hub, which is separate from the agent deployment. Changes made here are automatically reflected in the deployed agent without a redeploy.
- Quick Start Commands & Structure: Prerequisites include an LSmith API key and model provider keys. The workflow involves: `MDA innit research assistant` (creates project structure), defining components in files like `agent.py`, modifying instructions, adding tools (e.g., using the Tavily client), and finally deploying with `MDA deploy`. Dependencies are managed via `pyproject.toml`.

## Practical implications

- Build engineers can establish robust CI/CD pipelines for AI agents, treating the agent's context and business logic as versioned, deployable assets.
- The separation of Context Hub from code allows non-technical domain experts to contribute and modify agent behavior without requiring a full software deployment cycle.
- Managed Deep Agents simplifies scaling by handling complex production runtime concerns (fault tolerance, streaming) out of the box.
- The use of standardized formats like Harbor for evaluations streamlines benchmarking and quality assurance in the CI process.

## Topics

AI Agent Development, LLM Orchestration, DevOps/CI/CD, Microservices Architecture, Context Management, LangChain Docs, GitHub Repository

Source: https://www.youtube.com/watch?v=yi-XZnAVFJg
