skillfed

langchain-unstructured

An integration package connecting Unstructured and LangChain

langchain-unstructured v1.0.1 297.1K downloads/30d#7,890 on PyPI22
Permissive license MIT Active released

What it is and what it does

langchain-unstructured is a LangChain integration that bridges document loading with Unstructured's file partitioning capabilities. It wraps the UnstructuredLoader class to extract and chunk content from files—PDFs, documents, and other formats—either by calling the hosted Unstructured API (with an API key) or by using local partitioning. The loader automatically detects file types and supports post-processing parameters like chunking strategies (e.g., "by_title") to segment documents into text chunks suitable for retrieval-augmented generation (RAG) and other LLM workflows.

The package depends on langchain-core for the LangChain framework integration and unstructured-client for API communication. It requires Python 3.10 or later and is actively maintained. Users configure it by setting an environment variable or passing credentials directly, then instantiate the loader with file paths and optional partitioning parameters, and call load() to retrieve a list of document objects with content and metadata.

Use it for:

  • Extract and chunk PDF documents for RAG pipelines in LangChain applications.
  • Batch load multiple document files with automatic format detection and structured partitioning.
  • Preprocess documents with configurable chunking strategies before feeding them to language models.
  • Integrate document parsing into LangChain workflows without writing custom file-handling code.
  • Process documents either via a remote API or locally, depending on infrastructure and latency requirements.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Integrates LangChain with Unstructured to partition and load documents from files, supporting both API-based and local processing with configurable chunking strategies.

Yes. Low install friction, active maintenance, permissive MIT license, and no known vulnerabilities make this a straightforward choice for LangChain users needing document loading and partitioning. Install it if you are building RAG systems or document-processing pipelines with LangChain and want Unstructured's file handling without custom integration code.

Install

langchain-unstructured on PyPI

pip

pip install langchain-unstructured

uv

uv add langchain-unstructured

poetry

poetry add langchain-unstructured

Installing langchain-unstructured

Before you install

Low friction install with just two runtime dependencies. Actively maintained as of August 2026, with recent commits and no archived status.

License in practice

MIT license permits commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install langchain-unstructured unstructured-client
export UNSTRUCTURED_API_KEY="your-api-key"

from langchain_unstructured import UnstructuredLoader
loader = UnstructuredLoader(
    file_path=["example.pdf"],
    api_key="your-api-key",
    partition_via_api=True
)
docs = loader.load()
print(docs[0].page_content)

Requires UNSTRUCTURED_API_KEY environment variable or explicit api_key parameter for API-based partitioning; local partitioning may require additional unstructured library installation.

Verify before relying

  • Whether local partitioning mode (without API) requires separate unstructured package installation beyond what is listed as runtime deps.
  • Performance characteristics and latency when processing large files or batches via the Unstructured API.
  • Supported file formats beyond PDF mentioned in the excerpt.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0.0,>=3.10.0)
Install friction low — pure-Python wheel
Runtime dependencies 2 — langchain-core, unstructured-client
Maintenance actively maintained — 230 days since the last release
Last repo commit
First released
Downloads 297,077/month — #7,890 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: langchain_unstructured-1.0.1-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

document loader langchainunstructured file parsingpdf extraction langchaindocument chunking ragfile partitioning apilangchain document integrationunstructured integration
document-loadingrag-pipelinelangchain-integration

More Text Processing packages