npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@langchain/managed-deepagents

v0.1.1

Published

TypeScript SDK for LangSmith Managed Deep Agents.

Downloads

433

Readme

@langchain/managed-deepagents

TypeScript 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

npm install @langchain/managed-deepagents

Requirements:

  • Node.js 20 or newer
  • A LangSmith API key with access to Managed Deep Agents

Configuration

The client reads LANGSMITH_API_KEY by default in server-side JavaScript runtimes.

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 apiUrl client option.

For browser apps, avoid exposing long-lived API keys. Pass a custom fetch implementation that calls your own backend, or create server-side routes that own the LangSmith credentials.

Quickstart

import { Client } from "@langchain/managed-deepagents";

const client = new Client({
  apiKey: process.env.LANGSMITH_API_KEY,
});

const agent = await client.agents.create({
  name: "research-assistant",
  model: "openai:gpt-5.5",
  instructions: "You are a careful research assistant.",
});

const thread = await client.threads.create({ agent_id: agent.id });

const stream = client.threads.stream(thread.id, { agentId: agent.id });

await stream.run.start({
  input: {
    messages: [{ role: "user", content: "Summarize the latest notes." }],
  },
});

for await (const message of stream.messages) {
  for await (const token of message.text) {
    process.stdout.write(token);
  }
}

console.log(await stream.output);
await stream.close();

React useStream

The SDK includes a LangGraph client adapter for @langchain/react. Use getLangGraphClient() for React streaming so LangGraph owns the generic thread, run, and projection behavior; this SDK only translates Managed Deep Agents-specific routes, headers, and payload fields.

import { Client } from "@langchain/managed-deepagents";
import { useStream } from "@langchain/react";

const agentId = "agent-id";
const managedDeepAgents = new Client({
  apiKey: process.env.LANGSMITH_API_KEY,
});
const client = managedDeepAgents.getLangGraphClient({ agentId });

export function ManagedDeepAgentStream() {
  const stream = useStream({
    client,
    assistantId: agentId,
    fetchStateHistory: false,
  });

  return (
    <section>
      <button
        type="button"
        disabled={stream.isLoading}
        onClick={() => {
          void stream.submit({
            messages: [{ role: "user", content: "Write a short status update." }],
          });
        }}
      >
        Run agent
      </button>

      {stream.messages.map((message, index) => (
        <p key={message.id ?? index}>{String(message.content)}</p>
      ))}

      <p>State keys: {Object.keys(stream.values).join(", ")}</p>
    </section>
  );
}

Agent Files

Top-level files entries may be passed as raw strings; the SDK normalizes them to file entries before sending the request.

const agent = await 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.",
    },
  },
  { includeFiles: 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.mcpServers: create, list, get, update, delete, register OAuth provider, list tools
  • client.authSessions: create and get

Errors

import { ManagedDeepAgentsAPIError } from "@langchain/managed-deepagents";

try {
  await client.agents.get("missing-agent");
} catch (error) {
  if (error instanceof ManagedDeepAgentsAPIError) {
    console.log(error.status, 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