Thuta Learning
AdvancedAIadvanced

Document Loaders

Relax. We'll talk through this in plain words — no textbook voice.

Document Loaders load data from external sources (text files, PDFs, websites) into documents.

python
from langchain_community.document_loaders import TextLoader

loader = TextLoader("my_document.txt")
documents = loader.load()

print(documents[0].page_content[:100]) # Print first 100 chars
You should see
(This loads the text inside my_document.txt as a LangChain Document object.)
Document Loaders | Thuta Learning