Skip to main content

Python SDK for LangSmith Managed Deep Agents.

Project description

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

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.

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

from managed_deepagents import Client

with Client() as client:
    agent = client.agents.create(
        name="research-assistant",
        model="openai:gpt-5.5",
        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

from managed_deepagents import AsyncClient

async with AsyncClient() as client:
    agent = await client.agents.create(
        name="research-assistant",
        model="openai:gpt-5.5",
        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.

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: list, 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, list tools
  • client.auth_sessions: create and get

Errors

from managed_deepagents import ManagedDeepAgentsAPIError

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

Links

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

managed_deepagents-0.1.2.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

managed_deepagents-0.1.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file managed_deepagents-0.1.2.tar.gz.

File metadata

  • Download URL: managed_deepagents-0.1.2.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for managed_deepagents-0.1.2.tar.gz
Algorithm Hash digest
SHA256 49cb4d0e2117cf358d8a6966aec436420d476b40de0e2ad79897f89deb7345aa
MD5 d9fac0df6a86133895a3a6d29ed36bb6
BLAKE2b-256 3b59ebacbec87df711ee35f4b723088b81912f49d4df6398eab52c35e85d3337

See more details on using hashes here.

File details

Details for the file managed_deepagents-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for managed_deepagents-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3c5e4ebf8118a2e98ca553f01e157756f9ca0f229fb4296da2ee30a20808bbb
MD5 2a34cc124fa1be2188cc2e8b6efd7dc2
BLAKE2b-256 6eb24a5f429692339fa2714e47fd6c7864a95319559c2ed9a8e4e41947fafc36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page