DirectoryLoader
DirectoryLoader is a LangChain document-loading component that discovers files in a directory and delegates format-specific extraction to an underlying loader.
Build Python Web Apps with Streamlit
DirectoryLoader is a LangChain loader that discovers and loads files from a specified directory.
- How it is used
- Loads text files from a directory as the ingestion stage of a retrieval-augmented application.
- How deep it goes
- Defines glob selection, delegated file loading, and Document output, then defers chunking to a separate splitter.
- Examples
- Uses an articles/ folder, the **/*.txt pattern, TextLoader, and a loader.load() call.
- What you can do after
- Apply it via LangChain to turn a directory of text files into documents ready for splitting and vector storage.
Read how Build Python Web Apps with Streamlit explains DirectoryLoader →
Machine Learning Platform Engineering
DirectoryLoader is a document-loading component that recursively discovers files in directories and converts them into standardized document objects.
- How it is used
- Loads recursively organized documentation into the retrieval pipeline used to build a searchable knowledge base.
- How deep it goes
- Explains recursive traversal, file matching, loader selection, encoding, and loading, then hands documents to chunking.
- Examples
- Uses nested Markdown documentation, TextLoader, UTF-8 decoding, and a FAISS indexing pipeline as concrete examples.
- What you can do after
- Build it from scratch by loading selected files into standardized documents for chunking and vector indexing.
Read how Machine Learning Platform Engineering explains DirectoryLoader →
Also covered in
What to know first
- vector databaseA vector database is a data-management system that stores and indexes numerical vector representations and supports retrieval through similarity or distance searches.
Related concepts
- glob moduleuses · A library module that finds filesystem pathnames matching shell-style wildcard patterns.
- Documentproduces · A document is a discrete information-bearing item or structured representation of content, often including text, fields, or associated metadata.
- vector databaseuses · A vector database is a data-management system that stores and indexes numerical vector representations and supports retrieval through similarity or distance searches.
Questions about DirectoryLoader
What is DirectoryLoader?
DirectoryLoader is a LangChain document-loading component that discovers files in a directory and delegates format-specific extraction to an underlying loader.
Which Manning books explain DirectoryLoader?
Build Python Web Apps with Streamlit and Machine Learning Platform Engineering.
What should I know before learning DirectoryLoader?
Manning books that teach DirectoryLoader usually introduce vector database first.
What is DirectoryLoader part of?
DirectoryLoader is part of unstructured package. The Unstructured package is an open-source library for extracting, partitioning, and preprocessing content from complex documents and other data formats.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

