# Managed Deep Agents - Instructions and Context Hub

## Executive summary

This video details how 'Instructions' define the behavior of Managed Deep Agents. These instructions are stored in a dedicated Context Hub, allowing developers to modify agent behavior directly through the UI without needing to redeploy code. The process involves syncing local changes (e.g., modifying `instructions.md`) with the production Context Hub via commands like `mda deploy`, and understanding how conflicts between local and deployed instructions can be resolved.

## Key takeaways

- Instructions Define Agent Behavior: Instructions are the core component defining an agent's behavior, typically placed within the system prompt. Changing these instructions immediately impacts the agent's output (e.g., changing response language from Italian to Spanish).
- Context Hub for Non-Code Changes: The Context Hub allows agents to be updated by modifying instructions in a UI, which automatically propagates changes to the deployed agent without requiring code redeployment.
- Syncing Local and Production Instructions: When running `MDA deploy`, if the Context Hub has been manually edited (e.g., in production), the deployment process pauses, allowing the user to choose whether to override the hub-edited instructions with the local version or vice versa.

## Technical details

- Agent System Prompt Structure: The system prompt automatically includes several elements: the core 'Instructions' (from `instructions.md`), built-in tools, and technical notes (e.g., shell paths vs. virtual paths). The deep agents harness is designed to be modular to yield faster responses.
- Deployment Workflow: To deploy or test changes locally, run `MDA dev`. To update production instructions from the Context Hub, modify them in the LangSmith UI and save. The deployment process uses an MDA metadata manifest containing a hash of the instructions.
- Conflict Resolution: If local changes (e.g., Italian) conflict with production Context Hub changes (e.g., Spanish), running `MDA deploy` prompts the user to explicitly choose whether to override the hub-edited instructions with the local version.

## Practical implications

- Allows non-developers (or product teams) to adjust agent behavior (e.g., tone, language) without requiring a full code build or deployment cycle.
- Provides a robust mechanism for managing configuration and context separate from the core application logic, improving maintainability and reducing deployment risk.

## Topics

Managed Deep Agents, Context Hub Management, Agent Orchestration, System Prompt Engineering, LangSmith UI, Context Hub Repo

Source: https://www.youtube.com/watch?v=8HIoZV7qlwA
