> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-rbacpe-1762465003-c2183e4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Contributing to documentation

Accessible documentation is a vital part of LangChain. We welcome both documentation for new features/[integrations](/oss/python/contributing/publish-langchain#adding-documentation), as well as community improvements to existing docs.

<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](https://github.com/langchain-ai/docs/issues).
</Note>

All documentation falls under one of four categories:

<CardGroup cols={2}>
  <Card title="Conceptual guides" icon="lightbulb" href="#conceptual-guides">
    Explanations that provide deeper understanding and insights
  </Card>

  <Card title="References" icon="book" href="#references">
    Technical descriptions of APIs and implementation details
  </Card>

  <Card title="Tutorials (Learn)" icon="graduation-cap" href="/oss/python/learn">
    Lessons that guide users through practical activities to build understanding
  </Card>

  <Card title="How-to guides" icon="wrench">
    Task-oriented instructions for users who know what they want to accomplish
  </Card>
</CardGroup>

***

## Getting started

### Quick edit: fix a typo

For simple changes like fixing typos, you can edit directly on GitHub without setting up a local development environment:

<Info>
  **Prerequisites:**

  * A [GitHub](https://github.com/) account
  * Basic familiarity of the [fork-and-pull workflow](https://graphite.dev/guides/understanding-git-fork-pull-request-workflow) for contributing
</Info>

<Steps>
  <Step title="Find the page">
    Navigate to any documentation page, scroll to the bottom of the page, and click the link "Edit the source of this page on GitHub"
  </Step>

  <Step title="Fork the repository">
    GitHub will prompt you to fork the repository to your account. Make sure to fork into your <Tooltip tip="If you clone to an organization, maintainers are unable to make edits.">personal account</Tooltip>
  </Step>

  <Step title="Make your changes">
    Correct the typo directly in GitHub's web editor
  </Step>

  <Step title="Commit your changes">
    Click `Commit changes...` and give your commit a descriptive title like `fix(docs): summary of change`. If applicable, add an [extended description](https://www.gitkraken.com/learn/git/best-practices/git-commit-message#git-commit-message-structure)
  </Step>

  <Step title="Create pull request">
    GitHub will redirect you to create a pull request. Give it a title (often the same as the commit) and follow the PR template checklist, if present
  </Step>
</Steps>

<Note>
  Docs PRs are typically reviewed within a few days. Keep an eye on your PR to address any feedback from maintainers. Do not bump the PR unless you have new information to provide - maintainers will address it as their availability permits.
</Note>

### Full development IDE setup

For larger changes or ongoing contributions, it's important to set up a local development environment on your machine. Our documentation build pipeline offers local preview and live reload as you edit, important for ensuring your changes appear as intended before submitting.

Please review the steps to set up your environment outlined in the docs repo [`README.md`](https://github.com/langchain-ai/docs?tab=readme-ov-file#contributing).

***

## Documentation types

<Note>
  Where applicable, all documentation must have translations in both Python and JavaScript/TypeScript. See [our localization guide](#localization) for details.
</Note>

### Conceptual guides

Conceptual guide cover core concepts abstractly, providing deep understanding.

<AccordionGroup>
  <Accordion title="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
  </Accordion>

  <Accordion title="Tips">
    * Explain design decisions - *"why does concept X exist?"*
    * Use analogies and reference alternatives
    * Avoid blending in too much reference content
    * Link to related tutorials and how-to guides
    * Focus on the **"why"** rather than the "how"
  </Accordion>

  <Accordion title="Examples">
    <Columns cols={3}>
      <Card title="Memory" href="/oss/python/concepts/memory" icon="brain" />

      <Card title="Context" href="/oss/python/concepts/context" icon="file-lines" />
    </Columns>
  </Accordion>
</AccordionGroup>

### References

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

<Card title="Python reference" href="https://reference.langchain.com/python/" icon="python" arrow />

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

<AccordionGroup>
  <Accordion title="Contributing to references">
    See the contributing guide for [Python reference docs](https://github.com/langchain-ai/docs/blob/main/reference/python/README.md).
  </Accordion>

  <Accordion title="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
  </Accordion>

  <Accordion title="When to create new reference documentation">
    * New integrations or providers need dedicated reference pages
    * Complex configuration options require detailed explanation
    * API changes introduce new parameters or behavior
    * Community frequently asks questions about specific functionality
  </Accordion>
</AccordionGroup>

***

## Writing standard

<Warning>
  Reference documentation has different standards - see the [reference docs contributing guide](https://github.com/langchain-ai/docs/blob/main/reference/python/README.md) for details.
</Warning>

### Mintlify components

Use appropriate [Mintlify components](https://mintlify.com/docs/text) to enhance readability:

<Tabs>
  <Tab title="Callouts">
    * `<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
  </Tab>

  <Tab title="Structure">
    * `<Steps>` for sequential procedures
    * `<Tabs>` for platform-specific content
    * `<AccordionGroup>` and `<Accordion>` for progressive disclosure
    * `<CardGroup>` and `<Card>` for highlighting content
  </Tab>

  <Tab title="Code">
    * `<CodeGroup>` for multiple language examples
    * Always specify language tags on code blocks
    * Titles for code blocks (e.g. `Success`, `Error Response`)
  </Tab>
</Tabs>

### Page structure

Every documentation page must begin with YAML frontmatter:

```yaml theme={null}
---
title: "Clear, specific title"
---
```

### 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:

```mdx theme={null}
:::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)
```

<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.
</Note>

<Note>
  If you need help translating content between Python and JavaScript/TypeScript, please ask in the [community slack](https://www.langchain.com/join-community) or tag a maintainer in your PR.
</Note>

### Localization

We are working to add support for other languages, thanks to our LangChain Ambassadors!

***

## Quality standards

### General guidelines

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>
</AccordionGroup>

### 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

### Testing and validation

Before submitting documentation:

<Steps>
  <Step title="Test all code">
    Run all code examples to ensure they work correctly
  </Step>

  <Step title="Check formatting">
    ```bash theme={null}
    make lint
    make format
    ```
  </Step>

  <Step title="Build locally">
    ```bash theme={null}
    docs build
    ```

    Verify the build completes without errors
  </Step>

  <Step title="Review links">
    Check that all internal links work correctly
  </Step>
</Steps>

***

## In-code documentation

### Language and style

<Info>
  Use [Google-style docstrings](https://google.github.io/styleguide/pyguide.html) with complete type hints for all public functions.
</Info>

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.
</Warning>

Requirements for code examples:

<Steps>
  <Step title="Completeness">
    Include complete, runnable examples that users can copy and execute without errors
  </Step>

  <Step title="Realism">
    Use realistic data instead of placeholder values like "foo" or "example"
  </Step>

  <Step title="Error handling">
    Show proper error handling and edge case management
  </Step>

  <Step title="Documentation">
    Add explanatory comments for complex logic
  </Step>
</Steps>

Example of a well-documented function:

```python theme={null}
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]
```

## Getting help

Our goal is to have the simplest developer setup possible. Should you experience any difficulty getting setup, please ask in the [community slack](https://www.langchain.com/join-community) or open a [forum post](https://forum.langchain.com/).

<Check>
  You now have everything you need to contribute high-quality documentation to LangChain! 🎤🦜
</Check>

***

<Callout icon="pen-to-square" iconType="regular">
  [Edit the source of this page on GitHub.](https://github.com/langchain-ai/docs/edit/main/src/oss/contributing/documentation.mdx)
</Callout>

<Tip icon="terminal" iconType="regular">
  [Connect these docs programmatically](/use-these-docs) to Claude, VSCode, and more via MCP for    real-time answers.
</Tip>
