This repository encompasses the comprehensive documentation for LangChain's products and services, hosted on the Mintlify platform. The documentation is divided into sections for each product. This is a shared set of guidelines to ensure consistency and quality across all content.
These instructions apply to manually authored documentation only. They do NOT apply to:
- Files in
**/reference/**directories (auto-generated API reference documentation) - Build artifacts and generated files
For reference documentation, see .github/instructions/reference-docs.instructions.md.
- You can push back on ideas-this can lead to better documentation. Cite sources and explain your reasoning when you do so
- ALWAYS ask for clarification rather than making assumptions
- NEVER lie, guess, or make up information
- Format: MDX files with YAML frontmatter. Mintlify syntax.
- Config: docs.json for navigation, theme, settings
- Components: Mintlify components
- Document just enough for user success - not too much, not too little
- Prioritize accuracy and usability of information
- Make content evergreen when possible
- Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason. Reference existing content when possible
- Check existing patterns for consistency
- Start by making the smallest reasonable changes
- Refer to the docs.json schema when building the docs.json file and site navigation
- If adding a new group, ensure the root
index.mdxis included in thepagesarray like:
{
"group": "New group",
"pages": ["new-group/index", "new-group/other-page"]
}If the trailing /index (no extension included) is omitted, the Mintlify parser will raise a warning even though the site will still build.
- title: Clear, descriptive, concise page title
- description: Concise summary for SEO/navigation
We have implemented custom code language fences for Python and JavaScript/TypeScript. They are used to tag content that is specific to that language. Use either :::python or :::js to tag content that is specific to that language. Both are closed with the ::: fence.
If any code fences like this exist on the code page, then two outputs (one for each language) will be created. For example, if this syntax is on the page in /concepts/foo.mdx, two pages will be created at /python/concepts/foo.mdx and /javascript/concepts/foo.mdx.
For implementation details, see pipeline/preprocessors/markdown_preprocessor.py.
Snippet files in src/snippets/ are reusable MDX content that can be imported into multiple pages. These snippets undergo special link preprocessing during the build process that converts absolute /oss/ links to relative paths.
Important: When writing links in snippets, be careful about path segments. Read the docstrings and comments in pipeline/core/builder.py method _process_snippet_markdown_file (lines 807-872) to understand how snippet link preprocessing works and why certain path structures are required.
This project uses the Tabler icon library ("icons": { "library": "tabler" } in docs.json). When adding or updating icons:
- Use Tabler icon names only. Browse available icons at https://tabler.io/icons
- Tabler uses lowercase kebab-case (e.g.,
home,settings,alert-triangle,player-play) - Brand icons require the
brand-prefix (e.g.,brand-github,brand-python,brand-openai) - For providers or brands without a Tabler icon, use a local SVG file in
src/images/providers/withcurrentColorfor theme adaptability (e.g.,icon="/images/providers/anthropic-icon.svg") - Common Tabler names that differ from FontAwesome:
home(nothouse),tool/tools(notwrench),player-play(notplay),bulb(notlightbulb),alert-triangle(notexclamation-triangle),school(notgraduation-cap)
In general, follow the Google Developer Documentation Style Guide. You can also access this style guide through the Vale-compatible implementation.
- Second-person voice ("you")
- Prerequisites at start of procedural content
- Test all code examples before publishing
- Match style and formatting of existing pages
- Include both basic and advanced use cases
- Language tags on all code blocks
- Alt text on all images
- Root relative paths for internal links
- Correct spelling
- Correct grammar
- Sentence-case for headings
- Ensure American English spelling
- Do not skip frontmatter on any MDX file
- Do not use absolute URLs for internal links
- Do not review code blocks (denoted by ```), as they are often not full snippets
- Do not include untested code examples
- Do not make assumptions - always ask for clarification
- Do not include localization in relative links (e.g.,
/python/or/javascript/) - these are resolved automatically by the build pipeline - Do not use model aliases (e.g., "claude-sonnet-4-5") in code examples; always use full model names / identifiers (e.g., "claude-sonnet-4-5-20250929")
- Do not use FontAwesome icon names — this project uses the Tabler icon library. Verify icon names at https://tabler.io/icons
- Do not use nested double quotes in Mintlify component attributes (e.g.,
default='["a", "b"]'). This causes escape characters to render in the frontend. Instead, use single quotes inside double quotes:default="['a', 'b']"
For questions, refer to the Mintlify docs (either via MCP, if available), or at the Mintlify documentation.
- Describe the "why" of the changes, why the proposed solution is the right one.
- Highlight areas of the proposed changes that require careful review.
- Always add a disclaimer to the PR description mentioning how AI agents are involved with the contribution.