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="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

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.

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

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


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.1.tar.gz (10.8 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.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: managed_deepagents-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 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.1.tar.gz
Algorithm Hash digest
SHA256 95566fdca0e82976ff08078849444f8117770e403035d8bf18d8ef16f35a01fb
MD5 c781d1d51bb94998108e7bc1e771a457
BLAKE2b-256 2f76d466c2226cad252f7b9285ee119c635b599bec32467de46b9535767ad43f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for managed_deepagents-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca4839cce32312eb87c5f84a57157de670408c624bb0d118462f15c5e21a38fe
MD5 01ee6a7452fc6692a0a3297aab5d79fb
BLAKE2b-256 461e88b9a7e1873443c8933eb1a172e558797f8ca93cfca294cad10af4fb7616

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