liveBook · Manning

Document loader

As explained in Effective Conversational AI

A document loader is a component that reads content from a configured source or file format and represents it as documents with text and metadata.

A retrieval system cannot search a PDF, CSV, webpage, or corporate file until its contents are ingested. A document loader reads a configured source and represents each extracted piece as a document containing text and metadata. section 6.4.3

Use loaders as the first stage of an ingestion pipeline:

  • Choose a loader for the source, such as TextLoader, CSVLoader, DirectoryLoader, or an HTML loader. section 6.4.3
  • Call the loader’s load method to produce documents with text and metadata. section 6.4.3
  • Pass the loaded documents to transformers for splitting and structuring, then to retrievers for query-time retrieval. section 6.4.3

Choosing a loader

For a text file, configure TextLoader with its path; for a spreadsheet, use CSVLoader. For Microsoft Office-type documents, AzureAIDocumentIntelligenceLoader can extract content while retaining useful structure. section 6.4.3

from langchain_community.document_loaders import TextLoader

# Load text data from a file using TextLoader
loader = TextLoader("./your_data/YourText.txt")
document = loader.load()

Shows the minimal TextLoader configuration and load call; related listings cover CSV and Azure document loaders. section 6.4.3

How Effective Conversational AI covers it

How deep it goes
Defines loader responsibilities and names common implementations, but defers detailed parsing, chunking, and transformation internals.
Examples
Uses text files, CSV files, directories, PDFs, HTML, markdown, webpages, transcripts, and Microsoft Office documents.
What it assumes
Assumes a configured source and basic ingestion goal; teaches the loader-to-document step before transformers and retrievers.
What you can do after
Operate LangChain loaders to ingest configured files and hand structured documents to retrieval pipelines.
How it connects
Connects document loaders with document transformers, chunking, metadata, retrievers, and retrieval-augmented generation.

Also explained in

Compare how 3 books explain document loader →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Conversational AI. The section links point to the parts of the book it draws on.