Skip to main content

Contributing to documentation

还没翻译译自英文(docs.langchain.com)本页 102 段都还没译

We welcome contributions to LangChain documentation, including new features, integrations, and improvements to existing docs.

Quick start - local development

To run a local preview of the documentation:

git clone https://github.com/langchain-ai/docs.git
cd docs

Install the pinned toolchain with mise, which reads the versions of Python, Node.js, uv, Vale, and the Mintlify CLI from .mise.toml and installs the repository's git hooks:

mise trust && mise install
make install
make dev

This starts a development server with hot reload at http://localhost:3000. Edit files in src/ and see changes immediately.

Tip

Using an AI coding agent?

  • Install the LangChain Docs MCP servers to give your agent access to up-to-date LangChain documentation and examples.

    Connect LangChain docs MCP servers

    Connect both LangChain documentation MCP servers to my coding agent so it can look up current LangChain, LangGraph, and LangSmith docs and API reference.

    Servers to add:

    Detect which agent or editor I am using (Claude Code, Cursor, Codex CLI, Claude Desktop, Deep Agents Code, VS Code, Antigravity, or another MCP-compatible client). Use the matching setup from https://docs.langchain.com/use-these-docs.md:

    • Claude Code: claude mcp add --transport http for each server (project scope by default; use --scope user only if I ask for global access).
    • Codex CLI: codex mcp add with each server URL.
    • Cursor, Deep Agents Code, VS Code, or Antigravity: merge both entries into the MCP settings JSON using the field names shown on that page for my client.
    • Claude Desktop: add both URLs under Settings > Connectors.

    Do not invent alternate MCP URLs. After configuring, confirm both servers are listed and reachable.

  • Install LangChain Skills to improve your agent's performance on LangChain ecosystem tasks, then click the Copy page button on the top right of this page and paste the raw content into your agent to have it set up your environment automatically.

    Install LangChain Skills

    Install LangChain Skills for my coding agent so it can perform better on LangChain, LangGraph, and Deep Agents tasks.

    Use the Agent Skills installer from https://github.com/langchain-ai/langchain-skills:

    npx skills add langchain-ai/langchain-skills --skill '*' --yes

    If I ask for a global install instead, use:

    npx skills add langchain-ai/langchain-skills --skill '*' --yes --global

    Detect which agent or editor I am using. If I use Claude Code and prefer the plugin path, follow the marketplace install from that repository README (/plugin marketplace add then /plugin install). Do not invent alternate skill package names or install URLs. After installing, confirm the skills are available to the agent.

  • This repository ships its own authoring skills in .agents/skills/, covering page creation, navigation placement, and redirects. Most agents read that path directly. For Claude Code, run make skills to link them.

Tip

If you are having issues with you local preview, try running mint update to ensure you're using the latest Mintlify version.

Prerequisites

Edit documentation

Quick edits on GitHub

Note

Only edit files in src/-- The build/ directory is automatically generated.

  1. Edit files in src/ following our writing standards.
  2. Run quality checks before submitting.
  3. Create a pull request for review.

Note

All pull requests must link to an issue or discussion where a solution has been approved by a maintainer. See our pull request requirements.

Create a sharable preview build (LangChain team only)

Run quality checks

Before submitting changes, ensure your code passes formatting and linting checks:

# Check broken links and anchors
make broken-links-with-anchors

# Format code automatically
make format

# Check for linting issues
make lint

# Fix markdown issues
make lint_md_fix

# Run tests to ensure your changes don't break existing functionality
make test

For more details, see the available commands section in the README.

Important

All pull requests are automatically checked by CI/CD. The same linting and formatting standards will be enforced, and PRs cannot be merged if these checks fail.

Documentation types

All documentation falls under one of four categories:

How-to guides

Task-oriented instructions for users who know what they want to accomplish.

Conceptual guides

Explanations that provide deeper understanding and insights.

Reference

Technical descriptions of APIs and implementation details.

Tutorials

Lessons that guide users through practical activities to build understanding.

Note

Where applicable, all documentation must have both Python and JavaScript/TypeScript content. For more details, see the co-locate Python and JavaScript/TypeScript content section.

How-to guides

How-to guides are task-oriented instructions for users who know what they want to accomplish. Examples of how-to guides are on the LangChain and LangGraph tabs.

Characteristics

Tips

Examples

Conceptual guides

Conceptual guide cover core concepts abstractly, providing deep understanding.

Characteristics

Tips

Examples

Reference

Reference documentation contains detailed, low-level information describing exactly what functionality exists and how to use it.

A good reference should:

  • Describe what exists (all parameters, options, return values)
  • Be comprehensive and structured for easy lookup
  • Serve as the authoritative source for technical details

Contributing to references

LangChain reference best practices

When to create new reference documentation

Tutorials

Tutorials are longer form step-by-step guides that builds upon itself and takes users through a specific practical activity to build understanding. Tutorials are typically found on the Learn tab.

Note

We generally do not merge new tutorials from outside contributors without an acute need. If you feel that a certain topic is missing from docs or is not sufficiently covered, please open a new issue.

Characteristics

Tips

Examples

Writing standards

Note

Standards for pages on reference.langchain.com live with that site’s build pipeline, not in this repo. Use the reference documentation issue template for questions or fixes about generated API reference content.

Mintlify components

Use Mintlify components to enhance readability:

  • <Note> for helpful supplementary information
  • <Warning> for important cautions and breaking changes
  • <Tip> for best practices and advice
  • <Info> for neutral contextual information
  • <Check> for success confirmations
  • <Steps> for an overview of sequential procedures. Not for long lists of steps or tutorials.
  • <Tabs> for platform-specific content.
  • <AccordionGroup> and <Accordion> for nice-to-have information that can be collapsed by default (e.g., full code examples).
  • <CardGroup> and <Card> for highlighting content.
  • <CodeGroup> for multiple language examples.
  • Always specify language tags on code blocks (e.g., ```python, ```javascript).
  • Titles for code blocks (e.g. Success, Error Response)

Mermaid diagrams

When adding mermaid diagrams, use the LangChain brand color palette for node styling. Copy classDef lines from any existing diagram, or use the reference table in AGENTS.md.

RoleFillStrokeText
process#E5F4FF#006DDD#030710
trigger#F6FFDB#6E8900#2E3900
decision#FDF3FF#7E65AE#504B5F
output#EBD0F0#885270#441E33
alert#F8E8E6#B27D75#634643
neutral#F2FAFF#40668D#2F4B68

Do not use Tailwind defaults, Material Design colors, or other off-brand palettes.

Page structure

Every documentation page must begin with YAML frontmatter:

---
title: "Clear, specific title"
sidebarTitle: "Short title for the sidebar (optional)"
---

Co-locate Python and JavaScript/TypeScript content

All documentation must be written in both Python and JavaScript/TypeScript when possible. To do so, we use a custom in-line syntax to differentiate between sections that should appear in one or both languages:

:::python
Python-specific content. In real docs, the preceding backslash (before `python`) is omitted.
:::

:::js
JavaScript/TypeScript-specific content. In real docs, the preceding backslash (before `js`) is omitted.
:::

Content for both languages (not wrapped)

This will generate two outputs (one for each language) at /oss/python/concepts/foo.mdx and /oss/javascript/concepts/foo.mdx. Each outputted page will need to be added to the /src/docs.json file to be included in the navigation.

Note

We don't want a lack of parity to block contributions. If a feature is only available in one language, it's okay to have documentation only in that language until the other language catches up. In such cases, please include a note indicating that the feature is not yet available in the other language.

If you need help translating content between Python and JavaScript/TypeScript, please ask in the community slack or tag a maintainer in your PR.

Quality standards

General guidelines

Avoid duplication

Link frequently

Be concise

Accessibility requirements

Ensure documentation is accessible to all users:

  • Structure content for easy scanning with headers and lists
  • Use specific, actionable link text instead of "click here"
  • Include descriptive alt text for all images and diagrams

Cross-referencing

Use consistent cross-references to connect docs with API reference documentation.

From docs to API reference:

Use the @[] syntax to link to API reference pages:

See @[`ChatAnthropic`] for all configuration options.

The @[`bind_tools`][ChatAnthropic.bind_tools] method accepts...

The build pipeline transforms these into proper markdown links based on the current language scope (Python or JavaScript). For example, @[ChatAnthropic] becomes a link to the Python or JS API reference page depending on which version of the docs is being built, but only if an entry exists in the link_map.py file! See below for details.

How autolinks work

Localization

Where a feature exists in both SDKs, document it for Python and JavaScript/TypeScript together. If only one language is supported yet, ensure the feature and references to it are only visible for that language.

In-code documentation

Examples must be correct, copy-pasteable where possible, and tested before you open a pull request. Mark non-runnable snippets clearly (for example, pseudocode or illustrative fragments).

Get help

Our goal is to have the simplest developer setup possible. Should you experience any difficulty getting setup, please ask in the community slack or open a forum post. Internal team members can reach out in the #documentation Slack channel.