1. Project Overview & Quickstart (langchain-ai/langchain)
LangChain is a framework for building agents and LLM-powered applications. It helps you chain together interoperable components and third-party integrations to simplify AI application development โ all while future-proofing decisions as the underlying technology evolves.
[!TIP]
Just getting started? Check out Deep Agents โ a higher-level package built on LangChain for agents that have built-in capabilities for common usage patterns such as planning, subagents, file system usage, and more.
Quickstart
uv add langchainfrom langchain.chat_models import init_chat_model
model = init_chat_model("openai:gpt-5.5")
result = model.invoke("Hello, world!")If you're looking for more advanced customization or agent orchestration, check out LangGraph, our framework for building controllable agent workflows.
For an equivalent JS/TS library, check out LangChain.js.
[!TIP]
For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.
LangChain ecosystem
While the LangChain framework can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools when building LLM applications.
- Deep Agents โ Build agents that can plan, use subagents, and leverage file systems for complex tasks
- LangGraph โ Build agents that can reliably handle complex tasks with our low-level agent orchestration framework
- Integrations โ Chat & embedding models, tools & toolkits, and more
- LangSmith โ Agent evals, observability, and debugging for LLM apps
- LangSmith Deployment โ Deploy and scale agents with a purpose-built platform for long-running, stateful workflows
Why use LangChain?
LangChain helps developers build applications powered by LLMs through a standard interface for models, embeddings, vector stores, and more.
- Real-time data augmentation โ Easily connect LLMs to diverse data sources and external/internal systems, drawing from LangChain's vast library of integrations with model providers, tools, vector stores, retrievers, and more
- Model interoperability โ Swap models in and out as your engineering team experiments to find the best choice for your application's needs. As the industry frontier evolves, adapt quickly โ LangChain's abstractions keep you moving without losing momentum
- Rapid prototyping โ Quickly build and iterate on LLM applications with LangChain's modular, component-based architecture. Test different approaches and workflows without rebuilding from scratch, accelerating your development cycle
- Production-ready features โ Deploy reliable applications with built-in support for monitoring, evaluation, and debugging through integrations like LangSmith. Scale with confidence using battle-tested patterns and best practices
- Vibrant community and ecosystem โ Leverage a rich ecosystem of integrations, templates, and community-contributed components. Benefit from continuous improvements and stay up-to-date with the latest AI developments through an active open-source community
- Flexible abstraction layers โ Work at the level of abstraction that suits your needs โ from high-level chains for quick starts to low-level components for fine-grained control. LangChain grows with your application's complexity
Resources
- Documentation โ conceptual overviews and guides
- LangChain ecosystem overview โ how LangChain, LangGraph, and Deep Agents fit together
- API reference โ complete reference for all public classes, functions, and types
- Discussions โ community forum for technical questions, ideas, and feedback
- LangChain Academy โ comprehensive, free courses on LangChain libraries and products, made by the LangChain team
- Contributing Guide โ how to contribute and find good first issues
- Code of Conduct โ community guidelines and standards
2. Official Technical Reference & Guides (langchain-ai/docs)
LangChain Docs
๐ฆ Welcome! This repository contains the documentation build pipeline for LangChain projects.
- ๐
docs.langchain.comis our docs home, centralizing LangChain, LangGraph, LangSmith, and LangChain Labs (Deep Agents, Open SWE, Open Agent Platform). This site is hosted on Mintlify. - ๐ ๏ธ
reference.langchain.comhosts generated API reference for LangChain, LangGraph, LangSmith, and integration packages. That site is not built from this repository (no reference build scripts or output live here). - ๐ฌ
chat.langchain.comis an AI-powered assistant that can answer questions about LangChain documentation.
Table of contents:
Contribute
To run a local preview of the documentation:
git clone https://github.com/langchain-ai/docs.gitcd docsmake installmake devFor more information on how to contribute to LangChain documentation, follow the steps outlined in the contributing guide. The contributing guide also explains our documentation types and their writing and quality standards.
For detailed information about setting up your development environment and contributing to documentation, see the documentation contributing guide.
To report issues with reference.langchain.com (missing pages, broken links, or generated API content), open a reference documentation issue on this repo so maintainers can route it.
Reference
Repository structure
# --- docs.langchain.com ----------------------------------------------
build/ # Built docs (DO NOT EDIT)
packages.yml # Package metadata (indexes, tables, downloads; not the API reference build)
pipeline/ # Build pipeline source code
scripts/ # Helper scripts
src/ # Source documentation files (< EDIT CONTENT HERE)
langsmith/ # LangSmith docs
oss/ # LangChain, LangGraph, Deep Agents, and integrations docs
docs.json # Mintlify site configuration and navigation
tests/ # Test files for the pipeline
Makefile # Build targets
pyproject.toml # Dependencies`docs.langchain.com`
The Mintlify docs pipeline is structured with .mdx source files in /src and build artifacts in /build. Mintlify deploys from the /build folder, which is generated by preprocessing logic.
[!IMPORTANT]
Never edit/builddirectly.
The /src/docs.json file is used to configure the Mintlify site navigation and settings. Refer to the Mintlify documentation for detailed syntax and component usage.
Documentation changes follow a PR workflow where all tests must pass before merging. See the contributing guidelines for more details.
`reference.langchain.com`
API reference is generated and deployed outside this repo. Browse Python and JavaScript/TypeScript reference there. If something is wrong with that site, use the reference docs issue template.
File formats
- Markdown files (
.md,.mdx) - Standard documentation content - Snippets (
src/snippets/) - Reusable MDX content that can be imported into multiple pages. Important: Snippets undergo special link preprocessing. When writing links in snippets, be careful about path segments. - Jupyter notebooks (
.ipynb) - Converted to markdown during build, though these are not recommended for new content! Your PR will likely be rejected if you attempt to add a Jupyter notebook unless asked to by a maintainer. - Assets - Images and other files are copied to the build directory
Available commands
Make commands:
make dev- Start development mode with file watching and live rebuildmake build- Build documentation to./builddirectorymake broken-links- Check for broken links in documentationmake broken-links-with-anchors- Check for broken links + check links with anchorsmake install- Install all dependenciesmake clean- Remove build artifactsmake test- Run the test suitemake lint- Check code style and formattingmake format- Auto-format codemake lint_md- Lint markdown filesmake lint_md_fix- Lint and fix markdown filesmake help- Show all available commands
docs CLI tool:
The docs command (installed as uv run docs) provides additional functionality:
docs migrate- Convert MkDocs markdown/notebook files to Mintlify format--dry-run- Preview changes without writing files--output- Specify output location (default: in-place)- Supports
.md,.markdown,.ipynbfiles
docs migrate-docusaurus- Convert Docusaurus markdown/notebook files to Mintlify format--dry-run- Preview changes without writing files--output- Specify output location (default: in-place)- Supports
.md,.markdown,.mdx,.ipynbfiles - Converts Docusaurus-specific syntax (admonitions, tabs, imports, etc.)
docs mv <old_path> <new_path>- Move files and update cross-references--dry-run- Preview changes without moving files
These can be used directly using the Makefile or via the docs CLI tool:
docs dev- Start development mode with file watching and hot reload- Automatically rebuilds changed files from
src/tobuild/ - Launches Mintlify dev server at http://localhost:3000
- Provides automatic browser refresh when files change
--skip-build- Skip initial build and use existing build directory
- Automatically rebuilds changed files from
docs build- Build documentation files--watch- Watch for file changes after building
Linting
After running make install, you can use make lint_prose to ensure your writing meets our style guide rules.
Codespell
make lint runs uv run codespell src to check source documentation for common spelling errors.
Codespell is configured in pyproject.toml under [tool.codespell]:
- Add custom accepted words to
src/.codespellignore. This file is referenced byignore-words = "src/.codespellignore". - Exclude generated files, vendor content, or other paths that should not be spell checked by adding glob patterns to the
skipsetting. - Keep skip patterns scoped. Prefer adding accepted words to
src/.codespellignorewhen the word is valid documentation content, and useskipwhen the file or directory should not be checked at all.
You can also follow these steps to enable vale with VS Code or Cursor:
- Install the Vale extension (Vale by Chris Chinchilla)
- Install Vale CLI:
brew install vale(macOS) or see Vale installation for other platforms - Navigate to the Vale extension settings:
- Set
Vale CLI: Configto the absolute path to.vale.ini(in the root of this repo) - Set
Vale CLI: Min Alert Leveltosuggestion(many rules are coded as suggestions)
- Set
If you cannot use the VS Code UI to configure Vale, add these settings to your settings.json:
"vale.valeCLI.config": "/path/to/docs/.vale.ini",
"vale.valeCLI.minAlertLevel": "suggestion"Note: The extension requires Vale on your PATH. If annotations don't appear (e.g., when Cursor is launched from the Dock), launch Cursor from a terminal so it inherits your PATH, or ensure Homebrew is in your shell profile.
Troubleshooting
General Mintlify errors
In some cases, we use new features that are only available in the latest Mintlify CLI. If you encounter errors, ensure you have the latest version installed:
mint update
# or
npm install mint`docs dev` not working / running
Re-do the steps to set up your dev environment, ensuring you have activated the virtual environment and installed all dependencies.
[!IMPORTANT]
Most of the time,mint updatesolves anydocs dev/make devissues!
Mintlify `.venv` parsing error
Problem: Running mint broken-links or other Mintlify commands from the project root causes parsing errors like:
Unable to parse .venv/lib/python3.13/site-packages/soupsieve-2.7.dist-info/licenses/LICENSE.md
- 3:48: Unexpected character '@' (U+0040) in nameRoot Cause: Mintlify tries to parse all files in the directory, including Python virtual environment files that contain invalid MDX syntax.
Solutions (in order of preference):
Use the safe Make commands (recommended):
bashmake broken-links-with-anchors # Builds docs first, then checks internal linksRun Mintlify commands from the build directory:
bashcd build # Change to build directory where final docs are mint broken-links # Now safe to run
Why this works: The solution ensures Mintlify commands run from the build/ directory where the final documentation is generated, which is the correct place to check for broken links. This avoids scanning the Python virtual environment in the project root.
Prevention: Always use the provided Make commands instead of running raw mint commands from the project root.
Warning: page doesn't exist
If adding a new group, ensure the root index.mdx is included in the pages array 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.