Files
docs/reference/python

LangChain Python Reference Documentation

This directory contains the source code and build process for the Python reference documentation site, hosted at reference.langchain.com/python. This site serves references for LangChain, LangGraph, LangGraph Platform, and LangChain integration packages (such as langchain-anthropic, langchain-openai, etc.).

The site is built using MkDocs with the Material for MkDocs theme and the mkdocstrings plugin for generating API reference documentation from docstrings. See all config options in the mkdocs.yml file.

The docs/ directory contains the markdown files for the site, with the main entry point being index.md. At build time, the stubs provided in each file are substituted with the generated API reference documentation by mkdocstrings. This allows us to architect content ordering, layout, etc. in markdown, while still generating the API reference documentation automatically from the source code. Consequently, to make content changes to the API references themselves, you need to make changes in the source code (e.g., docstrings, class/method names, etc.) and then rebuild the site.


Contributing

As these docs are built from the source code, the best way to contribute is to make changes in the source code itself. This can include:

  • Improving docstrings
  • Adding missing docstrings
  • Fixing typos
  • etc.

TODO

This site is currently being migrated from a previous Sphinx-based implementation, so there are still some rough edges to be smoothed out. Here are some known issues and potential improvements:

  • Code block admonitions
  • URLs
  • Code snippet double backticks
  • See if it's possible to make our types clickable (like the Python ones)
  • Post-processing step to link out to imports from code blocks
    • Maybe there's a plugin?
  • Fix navigation.path feature/plugin in mkdocs.yml not working
  • Fix search magnifying glass icon color in dark mode
  • Consider using inherited docstrings
  • Hyperlink deprecation messages in LangGraph docs (source code)
  • Copy page support (may need to be post-processing step to generate markdown files)
  • Language switcher
  • Social cards
  • Google Analytics
  • Versioning?
  • Show keyboard shortcut in search window

Local Development

langchain-ai/ org repositories that needed to be cloned locally for local reference doc generation:

langchain
langchain-community
langchain-mcp-adapters
langchain-datastax
langchain-ai21
langchain-aws
langchain-azure
langchain-cerebras
langchain-cohere
langchain-ibm
langchain-elastic
langchain-google
langchain-milvus
langchain-mongodb
langchain-neo4j
langchain-nvidia
langchain-pinecone
langchain-postgres
langchain-redis
langchain-sema4
langchain-snowflake
langchain-together
langchain-unstructured
langchain-upstage
langchain-weaviate
langgraph
langgraph-supervisor-py
langgraph-swarm-py