As LangChain continues to grow, the surface area of documentation required to cover it continues to grow too. This page provides guidelines for anyone writing documentation for LangChain, as well as some of our philosophies around organization and structure.
PhilosophyLangChain's documentation aspires to follow the Diataxis framework. Under this framework, all documentation falls under one of four categories:
Each category serves a distinct purpose and requires a specific approach to writing and structuring the content.
TaxonomyKeeping the above in mind, we have sorted LangChain's docs into categories. It is helpful to think in these terms when contributing new documentation:
Getting startedThe getting started section includes a high-level introduction to LangChain, a quickstart that tours LangChain's various features, and logistical instructions around installation and project setup.
It contains elements of How-to guides and Explanations.
Use casesUse cases are guides that are meant to show how to use LangChain to accomplish a specific task (RAG, information extraction, etc.). The quickstarts should be good entrypoints for first-time LangChain developers who prefer to learn by getting something practical prototyped, then taking the pieces apart retrospectively. These should mirror what LangChain is good at.
The quickstart pages here should fit the How-to guide category, with the other pages intended to be Explanations of more in-depth concepts and strategies that accompany the main happy paths.
note
The below sections are listed roughly in order of increasing level of abstraction.
Expression LanguageLangChain Expression Language (LCEL) is the fundamental way that most LangChain components fit together, and this section is designed to teach developers how to use it to build with LangChain's primitives effectively.
This section should contains Tutorials that teach how to stream and use LCEL primitives for more abstract tasks, Explanations of specific behaviors, and some References for how to use different methods in the Runnable interface.
ComponentsThe components section covers concepts one level of abstraction higher than LCEL. Abstract base classes like BaseChatModel
and BaseRetriever
should be covered here, as well as core implementations of these base classes, such as ChatPromptTemplate
and RecursiveCharacterTextSplitter
. Customization guides belong here too.
This section should contain mostly conceptual Tutorials, References, and Explanations of the components they cover.
note
As a general rule of thumb, everything covered in the Expression Language
and Components
sections (with the exception of the Composition
section of components) should cover only components that exist in langchain_core
.
The integrations are specific implementations of components. These often involve third-party APIs and services. If this is the case, as a general rule, these are maintained by the third-party partner.
This section should contain mostly Explanations and References, though the actual content here is more flexible than other sections and more at the discretion of the third-party provider.
note
Concepts covered in Integrations
should generally exist in langchain_community
or specific partner packages.
The Guides and Ecosystem sections should contain guides that address higher-level problems than the sections above. This includes, but is not limited to, considerations around productionization and development workflows.
These should contain mostly How-to guides, Explanations, and Tutorials.
API referencesLangChain's API references. Should act as References (as the name implies) with some Explanation-focused content as well.
Sample developer journeyWe have set up our docs to assist a new developer to LangChain. Let's walk through the intended path:
This is only an ideal of course - sections will inevitably reference lower or higher-level concepts that are documented in other sections.
GuidelinesHere are some other guidelines you should think about when writing and organizing documentation.
Linking to other sectionsBecause sections of the docs do not exist in a vacuum, it is important to link to other sections as often as possible to allow a developer to learn more about an unfamiliar topic inline.
This includes linking to the API references as well as conceptual sections!
ConcisenessIn general, take a less-is-more approach. If a section with a good explanation of a concept already exists, you should link to it rather than re-explain it, unless the concept you are documenting presents some new wrinkle.
Be concise, including in code samples.
General style#
, ##
, ###
, etc.) to organize the content hierarchically.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4