Remote Skills

Remote Skills

LangChain and DeepAgents

Let your LangChain, LangGraph, or DeepAgents agent discover and load remote skills.

Connect your LangChain or DeepAgents application to published skills. Your agent sees their names and descriptions, then uses its native read_file tool to load the instructions and supporting files that fit the task.

Install the integration

In your existing LangChain or DeepAgents application, install the adapter and SDK. The examples use OpenAI; keep your existing model provider if you already have one configured.

npm install @remote-skills/langchain @remote-skills/client @langchain/openai

Use a server environment. In a web application, put the client and agent setup in your server route.

Connect your agent

Choose the framework you already use, then your language. Each example configures a model, connects to your skills, and prints the agent's answer. Set OPENAI_API_KEY in your server environment for this model; it is separate from credentials for a private skill host.

The team connection points to the URL serving your skills. For the Quickstart's local publisher, use http://127.0.0.1:8787 and add allowLoopbackHttp: true to the TypeScript origin configuration or allow_loopback_http=True to Python's Origin.

deepagents.ts
import { createRemoteSkills } from "@remote-skills/client";
import { remoteSkills } from "@remote-skills/langchain";
import { createDeepAgent } from "deepagents";
import { initChatModel } from "langchain";

export async function runAgent(message: string) {
  const model = await initChatModel("gpt-4.1", { modelProvider: "openai" });
  const client = createRemoteSkills({
    origins: { team: { url: "https://skills.example.com" } },
  });
  await using session = await client.session("team");
  await using remote = await remoteSkills({ session });

  const agent = createDeepAgent({ model, ...remote.deepAgentOptions });
  return await agent.invoke({
    messages: [{ role: "user", content: message }],
  });
}

const result = await runAgent("Welcome a new teammate using our greeting style.");
console.log(result.messages.at(-1)?.content);

Keep the SDK session open until the agent finishes, as these examples do. DeepAgents uses all three settings returned by deepAgentOptions or deep_agent_options() so its default subagent can discover the same skills. The composition reference covers custom subagents and LangGraph nodes.

See the agent use a skill

Send a request that matches one of your published skills. If you published the Quickstart's howdy skill, the welcome request above gives the model a reason to read /skills/howdy/SKILL.md. Look for “Howdy partner!” at the start of its printed answer. The model chooses whether to use a skill, so an unrelated request can receive a direct answer.

Only catalog metadata is loaded at setup. Reading a selected skill downloads and verifies its complete artifact; later resource reads reuse that copy and add content to the model's context only when requested.

Your agent can now discover and use remote skills through native middleware and tools. To inspect the read_file calls alongside the answer, run the chat demo, which includes a local publisher and all six compositions.

For streaming or conversations, keep the session open for the entire stream or conversation. The LangChain API reference covers lifecycle, version selection, and backend contracts. Private skills use your SDK client's existing authentication and scope settings.

The adapter supplies read-only skill tools. Loading a script does not execute it or grant additional tool permissions; your application controls those capabilities. See Trust and security for the content boundary.

On this page