Skip to main content
Some work cannot finish in one turn: a contract waits for signature, a pull request waits on review, or an announcement has not been published yet. A goal-oriented agent does what it can immediately, then schedules its own follow-up checks when progress depends on outside events. On each check, it moves the work forward and stops the schedule once the goal is met.
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.
This TypeScript example requires managed-deepagents version 0.10.4 or later and the matching mda CLI.
Mock Slack thread in #deals-ops showing Goal Agent checking a vendor contract, scheduling daily progress checks with check_progress, reporting a mid-week update, and calling stop_checking once countersigned. Mock Slack thread in #deals-ops showing Goal Agent checking a vendor contract, scheduling daily progress checks with check_progress, reporting a mid-week update, and calling stop_checking once countersigned.

Add the schedule tools

Give the agent two tools that wrap runtime schedules. check_progress starts an agent-owned recurring check in the current channel thread, and stop_checking deletes it: With managed-deepagents 0.10.4, use npm: pnpm can resolve incompatible LangChain versions. Install the tools’ dependencies:
tools/goals.ts
Register the tools alongside the quickstart model and web search tool:
agent.ts

Write the instructions

Use instructions.md to tell the agent when to schedule follow-ups on its own, and customize the examples and check cadence to match your workflow:
instructions.md
Each check runs in the same thread, keeping the original request, prior updates, and the schedule ID needed by stop_checking. For Slack conversations, each check replies in the same Slack thread.

Try it

Starting from the quickstart agent gives you web search for tracking public events. Add a Slack channel (same-thread agent-owned schedules require a channel), deploy the agent, and ask in Slack: “Tell me when LangChain publishes its next release.” The agent searches first, schedules recurring checks if the release is not out yet, and stops once it appears. Requests it can answer immediately finish without a schedule.

Extend the pattern

  • Connect MCP servers for your tools, such as GitHub, Linear, or a CRM, so the agent can track goals like getting a pull request merged or a contract signed and nudge owners along the way.
  • Save each goal to memory so the agent can list and report on every open goal.
  • Set a minimum interval in check_progress to keep costs predictable: each check is a model run.
  • Prune finished or abandoned goals: agent-owned schedules share a default limit of 20 per agent across all conversations (see Schedule limits).

See also

  • Schedules: create and manage runtime schedules.
  • Tools: write custom tools.
  • Watch mode: schedule one-time check-ins from Slack.