> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Work toward a goal over time

> Let an agent decide when work needs follow-up and schedule its own progress checks until the work is done.

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.

> [!NOTE]
>
> Managed Deep Agents is in **public [beta](https://docs.langchain.com/langsmith/release-stages.md)** on [LangSmith Cloud](https://docs.langchain.com/langsmith/cloud.md) and [Bring Your Own Cloud (BYOC)](https://docs.langchain.com/langsmith/byoc.md). Use Managed Deep Agents CLI and SDK v0.10 or later for BYOC.

> [!NOTE]
>
> This Python example requires `managed-deepagents>=0.10.4` 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.](https://mintcdn.com/langchain-5e9cc07a/bdTAbHGS6Uo5z-4d/langsmith/images/managed-deep-agents-goals-light.png?fit=max\&auto=format\&n=bdTAbHGS6Uo5z-4d\&q=85\&s=7fcd22120dfd5d0aadf4c5bc80f5ea2e)

## Add the schedule tools

Give the agent two [tools](https://docs.langchain.com/langsmith/python/managed-deep-agents-tools.md) that wrap [runtime schedules](https://docs.langchain.com/langsmith/python/managed-deep-agents-schedules.md#create-schedules-at-runtime). `check_progress` starts an agent-owned recurring check in the current channel thread, and `stop_checking` deletes it:

```python tools/goals.py theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain.tools import tool
from managed_deepagents import ManagedDeepAgentRuntime

OWNER = {"type": "agent"}


@tool
async def check_progress(goal: str, cron: str, runtime: ManagedDeepAgentRuntime) -> str:
    """Check back on unfinished work in this thread on a cron schedule, until you stop it."""
    item = await runtime.schedules.create(
        owner=OWNER,
        cron=cron,
        new_thread=False,
        prompt=f"Check progress on this goal: {goal}",
    )
    return f"Checking progress with schedule {item['id']}."


@tool
async def stop_checking(schedule_id: str, runtime: ManagedDeepAgentRuntime) -> str:
    """Stop checking progress on a goal that is met or abandoned."""
    await runtime.schedules.delete(schedule_id, owner=OWNER)
    return f"Stopped schedule {schedule_id}."
```

Register the tools alongside the quickstart model and web search tool:

```python agent.py theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from managed_deepagents import define_deep_agent

from tools.goals import check_progress, stop_checking

agent = define_deep_agent(
    name="goal-agent",
    model="openai:gpt-6.1-sol",
    tools=[{"type": "web_search"}, check_progress, stop_checking],
)
```

## 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:

```markdown instructions.md theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
## Follow through

Finish every request in the current turn when possible. If the work depends on
something outside your control, such as an approval, review, or publication,
define what "done" looks like and pick a check interval. Call check_progress
and end your turn instead of waiting.

On each check, inspect the current state with your tools rather than assuming.
Move the work forward if you can; otherwise, note who needs to act. When the
goal is met or blocked permanently, report the outcome and call stop_checking.
```

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](https://docs.langchain.com/langsmith/python/managed-deep-agents-quickstart.md) agent gives you web search for tracking public events. Add a [Slack channel](https://docs.langchain.com/langsmith/python/managed-deep-agents-channels-slack.md) (same-thread agent-owned schedules require a channel), [deploy the agent](https://docs.langchain.com/langsmith/python/managed-deep-agents-deploy.md), 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](https://docs.langchain.com/langsmith/python/managed-deep-agents-mcp-connectors.md) 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](https://docs.langchain.com/langsmith/python/managed-deep-agents-memory.md) 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](https://docs.langchain.com/langsmith/python/managed-deep-agents-schedules.md#schedule-limits)).

## See also

* [Schedules](https://docs.langchain.com/langsmith/python/managed-deep-agents-schedules.md): create and manage runtime schedules.
* [Tools](https://docs.langchain.com/langsmith/python/managed-deep-agents-tools.md): write custom tools.
* [Watch mode](https://docs.langchain.com/langsmith/python/managed-deep-agents-watch-mode.md): schedule one-time check-ins from Slack.

***

[Connect these docs](https://docs.langchain.com/use-these-docs.md) to your agent of choice via MCP for real-time answers.

[Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/managed-deep-agents-goal-oriented.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
