Overview
Integration details
| Class | Package | Local | Serializable | JS support |
|---|---|---|---|---|
| UnstructuredMarkdownLoader | langchain_community | ❌ | ❌ | ✅ |
Loader features
| Source | Document Lazy Loading | Native Async Support |
|---|---|---|
| UnstructuredMarkdownLoader | ✅ | ❌ |
Setup
To access UnstructuredMarkdownLoader document loader you’ll need to install thelangchain-community integration package and the unstructured python package.
Credentials
No credentials are needed to use this loader. To enable automated tracing of your model calls, set your LangSmith API key:Installation
Install langchain_community and unstructuredInitialization
Now we can instantiate our model object and load documents. You can run the loader in one of two modes: “single” and “elements”. If you use “single” mode, the document will be returned as a singleDocument object. If you use “elements” mode, the unstructured library will split the document into elements such as Title and NarrativeText. You can pass in additional unstructured kwargs after mode to apply different unstructured settings.
Load
Lazy Load
Load Elements
In this example we will load in theelements mode, which will return a list of the different elements in the markdown document:
example.md file. The first element is the title of the document as expected:
API reference
For detailed documentation of all UnstructuredMarkdownLoader features and configurations head to the API reference: python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.markdown.UnstructuredMarkdownLoader.htmlConnect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.