Files
docs/reference/python
dependabot[bot] b507a59132 chore(deps): bump the uv group across 2 directories with 2 updates (#3050)
Bumps the uv group with 1 update in the / directory:
[langgraph](https://github.com/langchain-ai/langgraph).
Bumps the uv group with 1 update in the /reference/python directory:
[pypdf](https://github.com/py-pdf/pypdf).

Updates `langgraph` from 1.0.9 to 1.0.10rc1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langgraph/releases">langgraph's
releases</a>.</em></p>
<blockquote>
<h2>langgraph==1.0.10rc1</h2>
<p>Changes since 1.0.9</p>
<ul>
<li>release: Candidate (<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6947">#6947</a>)</li>
<li>Merge commit from fork</li>
<li>chore: add tests to confirm expected subgraph persistence behavior
(<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6943">#6943</a>)</li>
<li>fix(langgraph): correct ParentCommand bubbling when checkpoint_ns
includes numeric task segments (<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6864">#6864</a>)</li>
<li>chore: add <code>make type</code> target for type checking (<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6748">#6748</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/a04ec5d6f00fa6583b2d98dfe789da741204b767"><code>a04ec5d</code></a>
release: Candidate (<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6947">#6947</a>)</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/50df7d423abebcb5a192f0a59c2952c68cb0df8c"><code>50df7d4</code></a>
Merge commit from fork</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/c4a4a4647343d802d0ab909439806076bae15bd6"><code>c4a4a46</code></a>
chore: add tests to confirm expected subgraph persistence behavior (<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6943">#6943</a>)</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/f178eb821e52906e1705c9cc02533bb88854b409"><code>f178eb8</code></a>
fix(langgraph): correct ParentCommand bubbling when checkpoint_ns
includes nu...</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/48167d7fec9c25228426c92ba83d8650b77de0f3"><code>48167d7</code></a>
chore(deps): bump the all-dependencies group in /libs/cli with 2 updates
(<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6920">#6920</a>)</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/806878a421458e99f9882e666ff35a41ad1bb561"><code>806878a</code></a>
chore(deps): bump the all-dependencies group in
/libs/checkpoint-postgres wit...</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/8087e6a42c62c2049a5fb3f99372a8c601d07e08"><code>8087e6a</code></a>
docs(sdk-py): update auth docstrings to default-deny pattern (<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6933">#6933</a>)</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/8fbdb144876ec9ca75943c7addb452a2bb634304"><code>8fbdb14</code></a>
release(sdk-py): 0.3.9 (<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6932">#6932</a>)</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/5093802f319119be674c02269f9874df04558419"><code>5093802</code></a>
chore(deps): bump the all-dependencies group in /libs/checkpoint with 2
updat...</li>
<li><a
href="https://github.com/langchain-ai/langgraph/commit/b89ef60b91e019c3cb4422af1e3cc216804ccb20"><code>b89ef60</code></a>
feat(sdk-py): add extract parameter to threads.search() (<a
href="https://redirect.github.com/langchain-ai/langgraph/issues/6880">#6880</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/langchain-ai/langgraph/compare/1.0.9...1.0.10rc1">compare
view</a></li>
</ul>
</details>
<br />

Updates `pypdf` from 6.7.5 to 6.8.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/py-pdf/pypdf/releases">pypdf's
releases</a>.</em></p>
<blockquote>
<h2>Version 6.8.0, 2026-03-09</h2>
<h2>What's new</h2>
<h3>Security (SEC)</h3>
<ul>
<li>Limit allowed <code>/Length</code> value of stream (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3675">#3675</a>)
by <a
href="https://github.com/stefan6419846"><code>@​stefan6419846</code></a></li>
</ul>
<h3>New Features (ENH)</h3>
<ul>
<li>Add /IRT (in-reply-to) support for markup annotations (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3631">#3631</a>)
by <a
href="https://github.com/costajohnt"><code>@​costajohnt</code></a></li>
</ul>
<h3>Documentation (DOC)</h3>
<ul>
<li>Avoid using <code>PageObject.replace_contents</code> on PdfReader
(<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3669">#3669</a>)
by <a
href="https://github.com/stefan6419846"><code>@​stefan6419846</code></a></li>
<li>Document how to disable jbig2dec calls by <a
href="https://github.com/stefan6419846"><code>@​stefan6419846</code></a></li>
</ul>
<p><a href="https://github.com/py-pdf/pypdf/compare/6.7.5...6.8.0">Full
Changelog</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md">pypdf's
changelog</a>.</em></p>
<blockquote>
<h2>Version 6.8.0, 2026-03-09</h2>
<h3>Security (SEC)</h3>
<ul>
<li>Limit allowed <code>/Length</code> value of stream (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3675">#3675</a>)</li>
</ul>
<h3>New Features (ENH)</h3>
<ul>
<li>Add /IRT (in-reply-to) support for markup annotations (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3631">#3631</a>)</li>
</ul>
<h3>Documentation (DOC)</h3>
<ul>
<li>Avoid using <code>PageObject.replace_contents</code> on PdfReader
(<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3669">#3669</a>)</li>
<li>Document how to disable jbig2dec calls</li>
</ul>
<p><a href="https://github.com/py-pdf/pypdf/compare/6.7.5...6.8.0">Full
Changelog</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/py-pdf/pypdf/commit/a869eceb57e1f98d118e8b73c6169bdc519cbc57"><code>a869ece</code></a>
REL: 6.8.0</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/3c550b3196adeba1506a26e57c09c09fac75e9aa"><code>3c550b3</code></a>
SEC: Limit allowed <code>/Length</code> value of stream (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3675">#3675</a>)</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/5dae0e28bec83a5c9a3df2ace26dc77c633b4f72"><code>5dae0e2</code></a>
MAINT: Document and test XMP security (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3674">#3674</a>)</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/b9f66ab4338ce14e5f07a73f51f09ed08fa1fe7a"><code>b9f66ab</code></a>
DEV: Change to <code>loadfile</code> strategy for PyPy in CI (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3671">#3671</a>)</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/071118b08286bed057bb1608cc507d76722cc6f9"><code>071118b</code></a>
MAINT: Remove excessive logging in extract_links while not clear (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3670">#3670</a>)</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/43add641726c2819a465cd0d5c05818aa697f81e"><code>43add64</code></a>
DEV: Timeout PyPy tests after one minute</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/4228dd2f52e5f70b95c8058c4fc8c6ac291ebbc1"><code>4228dd2</code></a>
DOC: Avoid using <code>PageObject.replace_contents</code> on PdfReader
(<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3669">#3669</a>)</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/0e9792df262f782884ea5e1b75ea1138655a1fe7"><code>0e9792d</code></a>
ENH: Add /IRT (in-reply-to) support for markup annotations (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3631">#3631</a>)</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/ede6db99d007f27540e62867c762746df7a6ed0e"><code>ede6db9</code></a>
DOC: Document how to disable jbig2dec calls</li>
<li><a
href="https://github.com/py-pdf/pypdf/commit/6d0fa2fc0b6e54d9d6f61ffa52d057c8b5ff032f"><code>6d0fa2f</code></a>
MAINT: Move and rename _xobj_image_helpers.py (<a
href="https://redirect.github.com/py-pdf/pypdf/issues/3661">#3661</a>)</li>
<li>See full diff in <a
href="https://github.com/py-pdf/pypdf/compare/6.7.5...6.8.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain-ai/docs/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-10 22:25:26 -04:00
..
2025-11-25 18:53:32 -05:00
2025-11-25 18:53:32 -05:00
2025-11-25 18:53:32 -05:00

LangChain Python Reference Documentation

This directory contains the source code and build process for the Python reference documentation site, hosted at reference.langchain.com/python. This site serves references for LangChain, LangGraph, LangSmith, and LangChain integration packages (such as langchain-anthropic, langchain-openai, etc.).

The site is built using MkDocs with the Material for MkDocs theme and the mkdocstrings plugin for generating API reference documentation from docstrings. See all config options in the mkdocs.yml file.

The docs/ directory contains the markdown files for the site, with the main entry point being index.md. At build time, the stubs provided in each file are substituted with the generated API reference documentation by mkdocstrings. This allows us to architect content ordering, layout, etc. in markdown, while still generating the API reference documentation automatically from the source code. Consequently, to make content changes to the API references themselves, you need to make changes in the source code (e.g., docstrings, class/method names, etc.) and then rebuild the site.


Contributing

As these docs are built from the source code, the best way to contribute is to make changes in the source code itself. This can include:

  • Improving docstrings
  • Adding missing docstrings
  • Fixing typos
  • etc.

You will notice that at the top of each page are two icons: one to view the page source, and the other to edit the page. The "view source" icon takes you to the markdown file for that page, while the "edit page" icon takes you to the relevant source code file in GitHub. Use these links to help you navigate to the right place to make your contributions.


Cross-reference in your project

If you maintain a project that depends on LangChain or LangGraph and would like to reference classes, methods, functions, and more from these docs, you can do so! These pages include an objects.inv file that certain docs platforms, such as MkDocs, can use to automatically create links to these docs.

To reference these docs in your project, add the following to your mkdocs.yml file:

mkdocstrings:
handlers:
    python:
    import:
        - https://reference.langchain.com/python/objects.inv
        - ... # any other inventories you want to include

TODO

This site is currently being migrated from a previous Sphinx-based implementation, so there are still some rough edges to be smoothed out. Here are some known issues and potential improvements:


Paths

For packages that live in the langchain-ai/langchain monorepo, the path to the package should exist at https://reference.langchain.com/python/{PACKAGE}/ where PACKAGE is the package name as defined in the pyproject.toml file, with hyphens replaced by underscores. For example, the langchain-openai package should be documented at https://reference.langchain.com/python/langchain_openai/.

Local Development

Setup

This project supports two installation modes:

  1. Development mode (pyproject.dev.toml) - Uses local editable installs from cloned repositories
  2. Production mode (pyproject.toml) - Uses git sources directly

Development Workflow

For local development with live source code:

# 1. Ensure repos are cloned in the expected structure (see below)

# 2. Switch to development mode and install
make dev-install

# 3. Serve the docs locally
make serve-docs

# Check current configuration anytime
make config-status

When you edit source code in the local repositories, changes will be reflected immediately since packages are installed as editable.

How it works: The make dev-install command:

  1. Switches pyproject.toml to use local editable installs (via switch-config.sh)
  2. Backs up the production config to pyproject.prod.toml
  3. Installs all packages from local repos with uv sync

Production/CI Workflow

For production builds or CI:

# Switch to production mode and install
make prod-install

# Build the documentation
make build

How it works: The make prod-install command:

  1. Restores pyproject.toml to use git sources
  2. Installs all packages from git with uv sync

Manual Configuration Switching

You can also use the script directly:

# Switch to development mode
./switch-config.sh dev

# Switch to production mode
./switch-config.sh prod

# Check current mode
./switch-config.sh status

Required Repository Structure

The pyproject.dev.toml file expects repositories to be cloned in this structure:

/some-parent-folder/
  ├── docs/                  # This repository
  │   └── reference/python/
  ├── langchain/             # Main LangChain monorepo
  ├── langgraph/             # Main LangGraph monorepo
  ├── langchain-community/
  ├── langchain-mcp-adapters/
  ├── langchain-datastax/
  ├── langchain-ai21/
  ├── langchain-aws/
  ├── langchain-azure/
  ├── langchain-cerebras/
  ├── langchain-cohere/
  ├── langchain-ibm/
  ├── langchain-elastic/
  ├── langchain-google/
  ├── langchain-milvus/
  ├── langchain-neo4j/
  ├── langchain-nvidia/
  ├── langchain-pinecone/
  ├── langchain-postgres/
  ├── langchain-redis/
  ├── langchain-sema4/
  ├── langchain-snowflake/
  ├── langchain-tavily/      # (External org)
  ├── langchain-together/
  ├── langchain-unstructured/
  ├── langchain-upstage/
  ├── langchain-weaviate/
  ├── langgraph-supervisor-py/
  └── langgraph-swarm-py/

langchain-mongodb is not included as it is maintained and hosted separately by the MongoDB team.

If you only need to work on specific packages, you can comment out the others in pyproject.dev.toml.

Build a subset of the whole reference site

For faster development and testing of specific sections, use the serve_subset.py script to serve only a subset of the documentation:

# Serve only the LangGraph documentation
python serve_subset.py langgraph

# Use a custom port
python serve_subset.py langgraph --port 8080

# Build without dirty reload (clean build)
python serve_subset.py langgraph --clean

MkDocs/mkdocstrings Python Cross-Reference Linking Syntax

Basic Syntax

The general format for cross-references in mkdocstrings is:

[display text][python.path.to.object]

If you want the object name as the display text, use backticks:

[`object_name`][python.path.to.object]

Linking to Different Python Objects

Modules

[`langchain.agents`][langchain.agents]

# or

[agents module][langchain.agents]

Classes

[`ChatOpenAI`][langchain_openai.ChatOpenAI]

# or

[the ChatOpenAI class][langchain_openai.ChatOpenAI]

Functions

[`init_chat_model`][langchain.chat_models.init_chat_model]

# or

[initialization function][langchain.chat_models.init_chat_model]

Methods

[`invoke`][langchain_openai.ChatOpenAI.invoke]

# or

[the invoke method][langchain_openai.ChatOpenAI.invoke]

Class Attributes

[`temperature`][langchain_openai.ChatOpenAI.temperature]

# or

[the temperature attribute][langchain_openai.ChatOpenAI.temperature]

Function/Method Parameters

Note: Parameter linking requires the parameter_headings option to be enabled in the mkdocstrings config (in mkdocs.yml). This generates permalinks and TOC entries for each parameter, so don't disable it.

Use (parameter_name) syntax to link to specific parameters:

[`model_provider`][langchain.chat_models.init_chat_model(model_provider)]

# or

[the model_provider parameter][langchain.chat_models.init_chat_model(model_provider)]

For method parameters:

[`max_tokens`][langchain_openai.ChatOpenAI.invoke(max_tokens)]

For class __init__ parameters (when using merge_init_into_class):

[`temperature`][langchain_openai.ChatOpenAI(temperature)]

For variadic parameters:

[`*args`][package.module.function(*args)]
[`**kwargs`][package.module.function(**kwargs)]

Return Values

Not directly linkable, but you can link to the return type class:

Returns a [`ChatResult`][langchain_core.outputs.ChatResult] object.

Nested Classes

[`Config`][langchain_core.runnables.Runnable.Config]

Advanced Patterns

Linking Within Same Module

If you're documenting within the same module, you can use relative paths:

See also [`.other_method`][.other_method]

Linking to Exceptions

Raises [`ValueError`][ValueError] if input is invalid.
Raises [`CustomError`][my_package.exceptions.CustomError]

Linking to Type Aliases

[`RunnableConfig`][langchain_core.runnables.config.RunnableConfig]
def create_agent(
    model: BaseChatModel,
    tools: Sequence[BaseTool],
) -> AgentExecutor:
    """
    Create an agent executor.

    Args:
        model: A [`BaseChatModel`][langchain_core.language_models.BaseChatModel]
            instance. You can use [`init_chat_model`][langchain.chat_models.init_chat_model]
            to initialize from a string identifier (see the
            [`model_provider`][langchain.chat_models.init_chat_model(model_provider)]
            parameter for available providers).
        tools: A sequence of [`BaseTool`][langchain_core.tools.BaseTool] instances.
            Use the [`@tool`][langchain_core.tools.tool] decorator to create tools.

    Returns:
        An [`AgentExecutor`][langchain.agents.AgentExecutor] instance.
    """

Best Practices

1. Use Backticks for Code Identifiers

✅ [`init_chat_model`][langchain.chat_models.init_chat_model]
❌ [init_chat_model][langchain.chat_models.init_chat_model]

2. Use Full Paths for Clarity

✅ [`BaseChatModel`][langchain_core.language_models.BaseChatModel]
❌ [`BaseChatModel`][BaseChatModel]  # May not resolve correctly

Only link to public, exported APIs that users should interact with. Avoid linking to internal implementation details (e.g., objects prefixed with _).

4. Use Descriptive Text for Complex References

✅ See the [`model_provider`][langchain.chat_models.init_chat_model(model_provider)]
   parameter for available providers.
❌ See [`model_provider`][langchain.chat_models.init_chat_model(model_provider)].

Build and manually check the generated HTML to ensure links resolve correctly.

Quick Reference Table

Object Type Syntax Example
Module [text][module.path] [`agents`][langchain.agents]
Class [text][module.Class] [`ChatOpenAI`][langchain_openai.ChatOpenAI]
Function [text][module.function] [`init_chat_model`][langchain.chat_models.init_chat_model]
Method [text][module.Class.method] [`invoke`][langchain_openai.ChatOpenAI.invoke]
Attribute [text][module.Class.attr] [`temperature`][langchain_openai.ChatOpenAI.temperature]
Function Param [text][module.function(param)] [`model_provider`][langchain.chat_models.init_chat_model(model_provider)]
Method Param [text][module.Class.method(param)] [`max_tokens`][langchain_openai.ChatOpenAI.invoke(max_tokens)]
Class Param [text][module.Class(param)] [`temperature`][langchain_openai.ChatOpenAI(temperature)]

To test if a link will work:

  1. Check the object is in __init__.py exports
  2. Verify the import path: from module.path import Object
  3. Build docs with --strict mode
  4. Check the generated HTML for broken links
mkdocs build --strict
mkdocs serve  # Preview at http://127.0.0.1:8000/

This syntax works with the mkdocstrings plugin for MkDocs using the Python handler. Adjust paths according to your package structure and exports.


Page Titles: Navigation, Frontmatter, and H1 Headings

MkDocs uses multiple sources for page titles, each serving a different purpose. Here's how to understand how they interact:

Three Types of Titles

1. Navigation Title (in mkdocs.yml)

Defined in the nav section of mkdocs.yml:

nav:
  - Deployment:
    - SDK: langsmith/deployment/sdk.md
  • Purpose: Label in the sidebar navigation
  • Usage: page.title in templates (see below)
  • Scope: Navigation menu

2. Frontmatter Title (in the .md file)

Defined in YAML frontmatter at the top of each markdown file:

---
title: LangSmith Deployment SDK
---
  • Purpose: SEO metadata, HTML <title> tag
  • Usage: page.meta.title in templates (see below)
  • Scope: Browser tab, search engines, social sharing

3. H1 Heading (in the .md file)

The first # heading in the markdown content:

# LangSmith Deployment SDK reference
  • Purpose: Page heading visible to users
  • Usage: Rendered as <h1> in the page content!
  • Scope: Main page content area

How They Interact

Using the langsmith/deployment/sdk.md file as an example:

# In mkdocs.yml
nav:
  - Deployment:
    - SDK: langsmith/deployment/sdk.md
# In langsmith/deployment/sdk.md
---
title: LangSmith Deployment SDK
---

# LangSmith Deployment SDK reference

Result:

  • Navigation sidebar: Shows "SDK" (from nav)
  • Browser tab/HTML <title>: Shows "LangSmith Deployment SDK | LangChain Reference" (from frontmatter + site name)
  • Page heading: Shows "LangSmith Deployment SDK reference" (from H1)

HTML <title> Tag Priority

The HTML <title> tag (what appears in browser tabs) follows this priority system in overrides/main.html:

  1. If page.meta.title exists (from YAML frontmatter):

  2. <title>{{ page.meta.title }} | {{ config.site_name }}</title>
    

    Example: LangSmith Deployment SDK | LangChain Reference

  3. Else if page.title exists (from nav or inferred from filename):

  4. <title>{{ page.title | striptags }} | {{ config.site_name }}</title>
    

    Example: SDK | LangChain Reference

  5. Otherwise (homepage fallback):

  6. <title>{{ config.site_name }}</title>
    

    Example: LangChain Reference

Best Practices

# mkdocs.yml - short, concise navigation label
nav:
  - Deployment:
    - SDK: langsmith/deployment/sdk.md
# File: langsmith/deployment/sdk.md
---
title: LangSmith Deployment SDK  # SEO-friendly, descriptive
---

# LangSmith Deployment SDK reference  # Clear page heading

Why?

  • Nav title ("SDK"): Short and scannable in sidebar
  • Frontmatter title ("LangSmith Deployment SDK"): Descriptive for SEO and browser tabs
  • H1 heading ("LangSmith Deployment SDK reference"): Clear context when viewing the page

Don't make nav titles too long:

nav:
  - Deployment:
    # ❌ Too verbose for navigation
    - LangSmith Deployment SDK Reference Documentation: langsmith/deployment/sdk.md

If the H1 is identical to the nav title, consider omitting it from the .md file to avoid redundancy. The nav title will render as the H1 automatically.

Similarly, if two pages have the same nav title, differentiate them with distinct frontmatter titles for SEO. Defer to the core LangChain packages as canonical. For instance,:

  • langchain/agents/
  • langgraph/agents/

Each would share the same nav title "Agents". To differentiate, use a frontmatter title "Agents (LangGraph)". The LangChain page would use "Agents" as the frontmatter title since it's the primary source.

If you wish for both the page heading and browser title to be different from the nav title, set both the frontmatter title and H1 accordingly, e.g.:

# File: langchain_classic/chat_models.md
---
title: Chat models (Classic)
---

# Chat models (Classic)

Icons

Icons from Material for MkDocs are available for use in documentation with integrated search. This includes thousands of icons from popular icon sets like Material Design Icons, FontAwesome, Octicons, and more.

See the Material for MkDocs Icons Reference for the complete icon catalog and usage instructions.


In-code documentation

Language and style

Note

Use Google-style docstrings with complete type hints for all public functions. This documentation is parsed using Griffe.

Follow these standards for all documentation:

  • Voice: Use second person ("you") for instructions
  • Tense: Use active voice and present tense
  • Clarity: Write clear, direct language for technical audiences
  • Consistency: Use consistent terminology throughout
  • Conciseness: Keep sentences concise while providing necessary context

Code examples

Warning

Always test code examples before publishing. Never include real API keys or secrets.

Requirements for code examples:

  • Completeness: Include complete, runnable examples that users can copy and execute without errors
  • Realism: Use realistic data instead of placeholder values like "foo" or "example"
  • Error handling: Show proper error handling and edge case management
  • Documentation: Add explanatory comments for complex logic

Example of a well-documented function:

def filter_unknown_users(users: list[str], known_users: set[str]) -> list[str]:
    """Filter out users that are not in the known users set.

    Args:
        users: List of user identifiers to filter.
        known_users: Set of known/valid user identifiers.

    Returns:
        List of users that are not in the known_users set.

    Raises:
        ValueError: If users list contains invalid identifiers.
    """
    return [user for user in users if user not in known_users]