Skip to main content

Getting Started: Document Loaders

Document loaders make it easy to create documents from a variety of sources. These documents can then be loaded onto Vector Stores to load documents from a source.

All Document Loaders

Advanced

If you want to implement your own Document Loader, you must create a struct that implement the document loader interface.

// Loader is the interface for loading and splitting documents from a source.
type Loader interface {
// Loads loads from a source and returns documents.
Load(context.Context) ([]schema.Document, error)
// LoadAndSplit loads from a source and splits the documents using a text splitter.
LoadAndSplit(context.Context, textsplitter.TextSplitter) ([]schema.Document, error)
}