Skip to main content

Overview

This guide shows how to build a content writing agent with Deep Agents. The agent loads brand voice and skills, delegates research to a subagent, drafts blog or social content, and generates companion images. The agent you build will:
  1. Load voice and workflow rules from brand instructions and skill folders
  2. Delegate web research to a specialized subagent with web_search
  3. Draft blog or social content following the loaded skill
  4. Generate cover or social images with Gemini and save files under the project directory
For the full runnable SDK project, see the content-builder-agent example.

Key concepts

This tutorial covers:
  • Brand instructions (instructions on Managed Deep Agents, or memory files on the SDK) for always-on voice and research rules
  • Skills for blog and social playbooks
  • Subagents for research before writing
  • Filesystem backends on the SDK path for file read and write
  • Custom tools for search and image generation

Prerequisites

API keys:
  • Anthropic (Claude) or another chat model provider
  • Google (Gemini) for image generation with gemini-2.5-flash-image
  • Tavily for web search (free tier)
  • LangSmith for tracing (optional on the SDK path; required for Managed Deep Agents)
Node.js 18 or later.

Choose your path

Start with Managed Deep Agents to run production agents without having to manage infrastructure. Alternatively, for maximum flexibility while using the same Deep Agents harness, use the Deep Agents SDK and host agents yourself, or run a custom LangSmith Deployment.
Managed Deep Agents is in public beta on LangSmith Cloud and Bring Your Own Cloud (BYOC). Use Managed Deep Agents CLI and SDK v0.10 or later for BYOC.
Managed Deep Agents scaffolds a project and hosts the runtime. Brand voice goes in instructions.md, skills stay under skills/, and you declare tools and the researcher subagent in code. Image tools write under the project directory during mda dev.

Setup

To follow along, you need:
  • Node.js and npm.
  • An API key for your model provider of choice.
1

Create the project

2

Add API keys

Add chat, image, search, and LangSmith keys to .env:
.env
GOOGLE_API_KEY is required for Gemini image generation even when the chat model is Claude.
Do not commit the .env file into version control. It contains secrets.
3

Install dependencies

Build the agent

1

Add tools

Create search and image tools. Markdown research notes use the agent filesystem (write_file). Cover and social images are written under the project directory on the host during local mda dev.Create tools/content.ts:
tools/content.ts
2

Add brand instructions

Put always-on brand voice and research requirements in instructions.md. Managed Deep Agents loads this file as the main agent system prompt (this is the SDK AGENTS.md / memory= role, not durable memory):
When you deploy, Managed Deep Agents syncs these instructions to Context Hub.
3

Add skills

Create a skills/ directory. Each skill is a folder with a SKILL.md. Managed Deep Agents discovers skills automatically; you do not pass a skills= argument.Create skills/blog-post/SKILL.md:
Create skills/social-media/SKILL.md:
4

Create the agent

Replace the scaffolded agent entry with the full file below. It creates an agent with the image tools and an inline researcher subagent (with web_search). Skills and instructions come from the project files.Replace agent.ts:
agent.ts

Run the agent

1

Run locally

mda dev opens the agent in LangSmith Studio. Send a prompt such as:
You should see the agent load skills, delegate to researcher, write markdown, and call image tools. For more information, see Develop locally with LangSmith Studio.
2

Deploy (optional)

See Deploy.

Next steps

  • Edit brand rules in instructions.md (Managed Deep Agents) or AGENTS.md (SDK)
  • Add skills under skills/<name>/SKILL.md for new content types
  • On the SDK path, add subagents in subagents.yaml and register tools in load_subagents; on Managed Deep Agents, edit the inline researcher in agent.py or agent.ts
  • Read Subagents, Skills, and Customization
  • Managed Deep Agents and Move from Deep Agents