Use the LangSmith Python and TypeScript SDKs to manage agent repos and skill repos in the Context Hub programmatically. Push new versions from CI, pull the latest or a pinned commit at runtime to inject context into your agent, and use additional methods to check existence, list and search repos, and delete what you no longer need.Documentation Index
Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
Use this file to discover all available pages before exploring further.
Context Hub methods require
langsmith>=0.7.35 (Python) and langsmith>=0.5.23 (TypeScript).Setup
-
Install packages:
-
Configure environment variables. If you already have
LANGSMITH_API_KEYset in your environment, skip this step. Otherwise, create one in Settings > API Keys > Create API Key in LangSmith, then set it as an environment variable:
Python async: All methods shown on this page are also available on
AsyncClient (imported from langsmith) with identical signatures—just await each call. The TypeScript SDK is async by default; there is no separate async client.Push an agent
Create a new agent repo or commit a new version of an existing one. If the repo doesn’t exist yet, it is created with the metadata you provide (description, readme, tags, is_public). If it already exists,
those fields are patched only when explicitly passed.
The method returns a URL pointing to the new commit in the LangSmith UI:
Push a skill
Identical surface topush_agent, but commits to a skill repo. Use
this for reusable capabilities that other agents can depend on:
Link to other repos
Instead of inlining file content, an entry infiles can be a link to
another agent or skill repo, which lets you compose contexts without duplicating
content across repos. For example, an agent that delegates to a shared skill.
If you omit commit_id, LangSmith links to the latest commit of that repo when you push this commit. If the linked repo updates later, LangSmith propagates that update to parent repos that reference it.
Push parameters
Bothpush_agent / pushAgent and push_skill / pushSkill accept the following parameters:
| Parameter | Type | Description |
|---|---|---|
identifier | string | The repo’s identifier. |
files | dict[str, Entry | None] | Map of file path to Entry. Pass None / null to delete a path in this commit. |
parent_commit / parentCommit | string (optional) | Parent commit hash prefix for optimistic concurrency. Must be 8–64 characters when provided. If it doesn’t match the latest commit, the API returns a 409 conflict. |
description | string (optional) | Repo description. Set on creation or patched on update. |
readme | string (optional) | Repo readme content. |
tags | string[] (optional) | Repo tags. |
is_public / isPublic | boolean (optional) | Whether the repo is publicly discoverable. |
Pull an agent
Pull a snapshot of an agent repo. By default the latest commit is returned; pass a commit hash or tag viaversion (or embed it in the identifier as owner/name:version) to pull a specific version:
Identifier formats: the
identifier argument accepts three forms:name: resolves against the current workspace owner.owner/name: fully qualified.owner/name:version: pinned to a specific commit hash or tag.
version argument overrides any version embedded in the
identifier. If neither is provided, the latest commit is returned.Pull a skill
Pull a snapshot of a skill repo. Works identically topull_agent but returns a SkillContext:
Pull parameters
Bothpull_agent / pullAgent and pull_skill / pullSkill accept the following parameters:
| Parameter | Type | Description |
|---|---|---|
identifier | string | The repo’s identifier. May include an inline version: owner/name:version. |
version | string (optional) | Commit hash or tag to pull. Overrides any version embedded in the identifier. |
pull_agent returns an AgentContext; pull_skill returns a SkillContext.
Check whether a repo exists
Use these methods to check whether an agent or skill repo exists in your workspace before pushing or pulling:List agents and skills
List repos of either type, with optional filters for visibility, archived state, and a search query:| Parameter | Type | Description |
|---|---|---|
limit | int (Python only) | Maximum number of repos to return per page. Defaults to 100. |
offset | int (Python only) | Number of repos to skip. Defaults to 0. |
is_public / isPublic | boolean (optional) | Filter to only public (or only private) repos. |
is_archived / isArchived | boolean (optional) | Filter by archived state. Defaults to False. |
query | string (optional) | Search query across repo handle, owner handle, description, and tags. |
Python’s
list_agents / list_skills return a paginated response object with explicit
limit and offset for manual pagination. TypeScript’s listAgents / listSkills
return an AsyncIterableIterator that handles pagination automatically as you
consume it.Delete an agent or skill
Delete an agent or skill repo from your workspace:Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

