Skip to main content
Readers convert raw sources (files, URLs, strings) into Document objects that can be chunked, embedded, and stored. Definable includes readers for plain text, PDF, and web content.
These are Knowledge readers (definable.knowledge.reader) for the RAG document ingestion pipeline. If you need to extract text from files attached to agent messages (PDF, DOCX, XLSX, audio) before LLM processing, see File Readers instead.

Auto-Detection

By default, Knowledge detects the correct reader from the source:

TextReader

Reads plain text files (.txt, .md, .rst, .csv, .log).
Also handles raw text strings:

PDFReader

Reads PDF files page by page.
Requires the pypdf package. Install it with pip install pypdf.

URLReader

Fetches and extracts text content from web pages.
The reader fetches the page, strips HTML tags, and extracts clean text content.
Requires httpx (included) and beautifulsoup4. Install with pip install beautifulsoup4.

Specifying a Reader

Override auto-detection by passing a reader explicitly:

Async Reading

All readers support async:

Creating a Custom Reader

Subclass Reader and implement read() and optionally can_read():
Register it with your knowledge base:

Reader Interface

All readers implement: