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, healthclient.threads: create, search, count, get, update, delete, create run, invoke, stream, bulk update, resolve interruptclient.mcp_servers: create, list, get, update, delete, register OAuth providerclient.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95566fdca0e82976ff08078849444f8117770e403035d8bf18d8ef16f35a01fb
|
|
| MD5 |
c781d1d51bb94998108e7bc1e771a457
|
|
| BLAKE2b-256 |
2f76d466c2226cad252f7b9285ee119c635b599bec32467de46b9535767ad43f
|
File details
Details for the file managed_deepagents-0.1.1-py3-none-any.whl.
File metadata
- Download URL: managed_deepagents-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca4839cce32312eb87c5f84a57157de670408c624bb0d118462f15c5e21a38fe
|
|
| MD5 |
01ee6a7452fc6692a0a3297aab5d79fb
|
|
| BLAKE2b-256 |
461e88b9a7e1873443c8933eb1a172e558797f8ca93cfca294cad10af4fb7616
|