# Build a social media agent with Managed Deep Agents <!-- ref: @content/youtube/langchain/build-a-social-media-agent-with-managed-deep-agents tags: [managed deep agents, social media drafting, LangSmith Studio, agent skills, agent memory, Slack channels, scheduled runs] version: 2 updated_at: 2026-11-24T06:14:27.917Z --> **[Watch on YouTube](https://www.youtube.com/watch?v=OpFXXSsEIBo)** # Build a social media agent with Managed Deep Agents *Synthesized from Casper, LangChain's presenter, on LangChain, 2026-08-12.* Casper, presenting for LangChain, walks through building a social media drafting agent from an empty project folder. The agent scans Hacker News and X each morning and offers three draft posts in Slack. ## Core Thesis Casper argues that Managed Deep Agents let a developer build a recurring, memory-backed research agent quickly: define the model, tools, instructions, a skill, memory, a Slack channel and a schedule in one project, test it locally, then deploy it. The same structure would fit other recurring tasks such as technical updates, customer research or incident reports. ## Key Insights - **Setup.** The walkthrough needs Python 3.11, the uv package manager, and the Managed Deep Agents CLI installed as a uv tool. Running the init command with a project name creates the template, and the LangSmith API key goes in the .env file. - **Model choice.** The agent's model is set in agent.py. Casper switches to a smaller OpenAI model, which the transcript names as "GPT 5.6 Luna", because the task is focused research and drafting. The OpenAI key goes in .env. - **Tools.** A Hacker News search uses the free Algolia API, so it needs no credentials. The tool decorator turns a Python function into a tool, and its docstring becomes the tool description. Two optional X tools, one for the user's feed and one for post search, need an X bearer token. They are read-only, and if X fails the agent falls back to Hacker News. - **Instructions and skill.** A short top-level instructions.md sets the role. A draft-posts skill has YAML metadata whose description tells the agent when to load it. Casper writes that a skill is a modular package of instructions or subject knowledge that loads when needed. - **Memory.** Chat history does not carry over to a new thread, so a memory.py file with agent scope keeps past posts so the agent avoids repeating topics. - **Channels and schedule.** A Slack channel file connects the agent to Slack. A schedule file runs the agent at 9:00 AM on workdays in Pacific time with auto-post enabled and a fixed Slack conversation ID. - **Sandbox.** The default sandbox is removed because the agent only calls its own Python tools. - **Local testing.** Running the dev command opens the agent in LangSmith Studio, where traces, model calls, tool inputs and outputs, and memory records can be inspected before deploying. - **Deploy.** Deployment uses the deploy command. Slack is set up afterwards with a channel-add command that produces a full app manifest. The Slack signing secret and bot token go in .env, and the app is then redeployed. ## Actionable Takeaways 1. Scaffold the project with the init command, then remove the sandbox directory if the agent calls only your own tools. 2. Put tool descriptions in the function docstring, since the agent reads that text to choose tools. 3. Give each optional data source its own tool and fallback so one API failure does not stop the agent. 4. Test in LangSmith Studio locally first, because a local fix avoids a deploy cycle. 5. Use a schedule with an explicit Slack conversation ID and auto-post setting to run without a first message. ## Notable Quotes > "I use it every day to stay up to date with current discussions." — Casper > "A skill is a modular package of specialized instructions and/or subject knowledge that an agent dynamically loads when needed." — Casper > "I find Studio very useful for debugging." — Casper --- *Related: `@content/youtube/ai-jason/how-to-build-proactive-agents-self-improving-company-fully-explained` · `@content/youtube/langchain/managed-deep-agents-tools` · `@content/youtube/langchain/how-toyota-uses-deep-agents-to-speed-up-r-d-and-manufacturing-research` · `@content/youtube/every-inc/we-tested-claude-opus-5-its-frustrating-with-flashes-of-brilliance` · `@content/youtube/nate-herk/i-deleted-all-my-claude-skills-and-claude-got-smarter`* --- *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).*