Contributing to documentation
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.gitcd docsInstall 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 installmake installmake devThis 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:
docs-langchain: https://docs.langchain.com/mcpreference-langchain: https://reference.langchain.com/mcp
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 httpfor each server (project scope by default; use--scope useronly if I ask for global access). - Codex CLI:
codex mcp addwith 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 '*' --yesIf I ask for a global install instead, use:
npx skills add langchain-ai/langchain-skills --skill '*' --yes --globalDetect 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 addthen/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, runmake skillsto 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
Recommended: run mise trust && mise install to get every pinned version at once. .mise.toml is the canonical pin for the toolchain, and its postinstall hook wires up the pre-commit and pre-push hooks.
Required:
- Python 3.13+
- uv 0.9.26 or later - Python package manager
- Node.js 22.x and npm. Mintlify does not support Node 25 or later
- Make
- Git
Optional:
- markdownlint-cli -
npm install -g markdownlint-cli - Mintlify MDX VSCode extension
Edit documentation
Quick edits on GitHub
For typos or small changes, edit directly on GitHub without local setup:
- Click Edit this page on GitHub at the bottom of any page.
- Fork to your personal account.
- Make changes in GitHub's web editor.
- Create a pull request.
Note
Only edit files in src/-- The build/ directory is automatically generated.
- Edit files in
src/following our writing standards. - Run quality checks before submitting.
- 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)
When you create or update a PR, a preview branch/ID is automatically generated. A comment will be left on the PR with the ID.
- Copy the preview branch's ID from the comment
- In the Mintlify dashboard, click Create preview deployment
- Enter the preview branch's ID and click Create deployment
- Select the preview and click Visit to view
To redeploy with latest changes, click Redeploy on the dashboard.
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 testFor 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:
Task-oriented instructions for users who know what they want to accomplish.
Explanations that provide deeper understanding and insights.
Technical descriptions of APIs and implementation details.
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
- Task-focused: Focus on a specific task or problem
- Step-by-step: Break down the task into smaller steps
- Hands-on: Provide concrete examples and code snippets
Tips
- Focus on the how rather than the why
- Use concrete examples and code snippets
- Break down the task into smaller steps
- Link to related conceptual guides and references
Examples
Conceptual guides
Conceptual guide cover core concepts abstractly, providing deep understanding.
Characteristics
- Understanding-focused: Explain why things work as they do
- Broad perspective: Higher and wider view than other types
- Design-oriented: Explain decisions and trade-offs
- Context-rich: Use analogies and comparisons
Tips
- Focus on the "why" rather than the "how"
- Provides supplementary information not necessarily required for feature usage
- Can use analogies and reference alternatives
- Avoid blending in too much reference content
- Link to related tutorials and how-to guides
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
The generated API reference at reference.langchain.com is built and deployed outside this repository. To report bugs, missing packages, or broken pages there, open a reference documentation issue.
LangChain reference best practices
- Be consistent; follow existing patterns for provider-specific documentation
- Include both basic usage (code snippets) and common edge cases/failure modes
- Note when features require specific versions
When to create new reference documentation
- New integrations that meet the hosted-guide eligibility criteria (50,000+ monthly downloads or featured)
- Complex configuration options require detailed explanation
- API changes introduce new parameters or behavior
- Community frequently asks questions about specific functionality
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
- Practical: Focus on practical activities to build understanding.
- Step-by-step: Break down the activity into smaller steps.
- Hands-on: Provide sequential, working code snippets.
- Supplementary: Provide additional context and information not necessarily required for feature usage.
Tips
- Code snippets should be sequential and working if the user follows the steps in order.
- Provide some context for the activity, but link to related conceptual guides and references for more detailed information.
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:
CalloutsStructureCode
<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.
| Role | Fill | Stroke | Text |
|---|---|---|---|
| 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
Multiple pages covering the same material are difficult to maintain and cause confusion. There should be only one canonical page for each concept or feature. Link to other guides instead of re-explaining.
Link frequently
Documentation sections don't exist in a vacuum. Link to other sections frequently to allow users to learn about unfamiliar topics. This includes linking to API references and conceptual sections.
Be concise
Take a less-is-more approach. If another section with a good explanation exists, link to it rather than re-explain, unless your content presents a new angle.
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
The @[] syntax is processed by handle_auto_links.py. It looks up link keys in link_map.py, which contains dictionary mappings for both Python and JavaScript scopes.
Supported formats:
| Syntax | Result |
|---|---|
@[ChatAnthropic] | Link with "ChatAnthropic" as the displayed text |
@[`ChatAnthropic`] | Link with `ChatAnthropic` (code formatted) as text |
@[text][ChatAnthropic] | Link with "text" as text and ChatAnthropic as the key in the link map |
\@[ChatAnthropic] | Escaped: renders as literal @[ChatAnthropic] (no link – what's being used on this page!) |
Adding new links:
If a link isn't found in the map, it will be left unchanged in the output. To add a new autolink:
- Open
pipeline/preprocessors/link_map.py - Add an entry to the appropriate scope (
pythonorjs) inLINK_MAPS - The key is the link name used in
@[key]or@[text][key], the value is the path relative to the reference host
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.