Metadata-Version: 2.4
Name: managed-deepagents
Version: 0.1.1
Summary: Python SDK for LangSmith Managed Deep Agents.
Project-URL: Changelog, https://github.com/langchain-ai/managed-deepagents-sdk/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/langchain-ai/managed-deepagents-sdk/issues
Project-URL: Repository, https://github.com/langchain-ai/managed-deepagents-sdk
Author: LangChain
License-Expression: MIT
License-File: LICENSE
Keywords: agents,ai,langchain,langsmith,managed-deep-agents,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1.0,>=0.28.1
Provides-Extra: dev
Requires-Dist: mypy<2.0,>=1.11; extra == 'dev'
Requires-Dist: pytest<10.0,>=8.4; extra == 'dev'
Requires-Dist: ruff<1.0,>=0.12; extra == 'dev'
Description-Content-Type: text/markdown

# managed-deepagents

Python SDK for the LangSmith Managed Deep Agents API.

Managed Deep Agents is a hosted runtime for creating, running, and operating
Deep Agents through LangSmith. This package is currently public beta software.

## Installation

```bash
pip install managed-deepagents
```

Requirements:

- Python 3.10 or newer
- A LangSmith API key with access to Managed Deep Agents

## Configuration

The client reads `LANGSMITH_API_KEY` by default.

```bash
export LANGSMITH_API_KEY="..."
```

The default API URL is `https://api.smith.langchain.com/v1/deepagents`.
You can override it with `LANGSMITH_ENDPOINT` or the `api_url` client option.

## Quickstart

```python
from managed_deepagents import Client

with Client() as client:
    agent = client.agents.create(
        name="research-assistant",
        model="anthropic:claude-sonnet-4-6",
        instructions="You are a careful research assistant.",
    )

    thread = client.threads.create(agent_id=agent["id"])

    for event in client.threads.stream(
        thread["id"],
        agent_id=agent["id"],
        messages=[{"role": "user", "content": "Summarize the latest notes."}],
        stream_mode=["values", "updates", "messages-tuple"],
    ):
        print(event.event, event.data)
```

## Async Usage

```python
from managed_deepagents import AsyncClient

async with AsyncClient() as client:
    agent = await client.agents.create(
        name="research-assistant",
        model="anthropic:claude-sonnet-4-6",
        instructions="You are a careful research assistant.",
    )
```

## Agent Files

Top-level `files` entries may be passed as raw strings; the SDK normalizes them
to file entries before sending the request. Use either `instructions` or
`files["AGENTS.md"]`, not both, because the API maps the typed prompt field to
`AGENTS.md`.

```python
agent = client.agents.create(
    name="research-assistant",
    files={
        "AGENTS.md": "You are a careful research assistant.",
        "skills/research/SKILL.md": "# Research\n\nGather context before answering.",
    },
    include_files=True,
)
```

## API Surface

Resources exposed by the client:

- `client.agents`: list, create, get, update, delete, clone, health
- `client.threads`: create, search, count, get, update, delete, create run,
  invoke, stream, bulk update, resolve interrupt
- `client.mcp_servers`: create, list, get, update, delete, register OAuth
  provider
- `client.auth_sessions`: create and get

## Errors

```python
from managed_deepagents import ManagedDeepAgentsAPIError

try:
    client.agents.get("missing-agent")
except ManagedDeepAgentsAPIError as error:
    print(error.status_code, error.code, error.detail)
```

## Links

- Repository: https://github.com/langchain-ai/managed-deepagents-sdk
- Issues: https://github.com/langchain-ai/managed-deepagents-sdk/issues
- Changelog: https://github.com/langchain-ai/managed-deepagents-sdk/blob/main/CHANGELOG.md
