Documents
Ingest and manage your documents
R2R provides a powerful and flexible ingestion pipeline to process and manage various types of documents. It supports a wide range of file formats—text, documents, PDFs, images, audio, and even video—and transforms them into searchable, analyzable content.
The ingestion process includes parsing, chunking, embedding, and optionally extracting entities and relationships for knowledge graph construction.
This documentation will guide you through:
- Ingesting files, raw text, or pre-processed chunks
- Choosing an ingestion mode (
fast
,hi-res
, orcustom
) - Updating and deleting documents and chunks
Refer to the documents API and SDK reference for detailed examples for interacting with documents.
Ingesting Documents
A Document
represents ingested content in R2R. When you ingest a file, text, or chunks:
- The file (or text) is parsed into text.
- Text is chunked into manageable units.
- Embeddings are generated for semantic search.
- Content is stored for retrieval and optionally linked to the knowledge graph.
Ingestion inside R2R is asynchronous. You can monitor ingestion status and confirm when documents are ready:
An ingestion_status
of "success"
confirms the document is fully ingested. You can also check your R2R dashboard for ingestion progress and status.
For more details on creating documents, refer to the create document API.
Ingestion Modes
R2R offers three modes of ingestion to allow for maximal customization:
Unprocessed files
fast
hi-res
custom
A speed-oriented ingestion mode that prioritizes rapid processing with minimal enrichment. Summaries and some advanced parsing are skipped, making this ideal for quickly processing large volumes of documents.
Raw text
If you have pre-processed chunks from your own pipeline, you can directly ingest them. This is especially useful if you’ve already divided content into logical segments.
Pre-Processed Chunks
If you have pre-processed chunks from your own pipeline, you can directly ingest them. This is especially useful if you’ve already divided content into logical segments.
Deleting Documents and Chunks
To remove documents or chunks, call their respective delete
methods:
You can also delete documents by specifying filters using the by-filter
route.
Conclusion
R2R’s ingestion pipeline is flexible and efficient, allowing you to tailor ingestion to your needs:
- Use
fast
for quick processing. - Use
hi-res
for high-quality, multimodal analysis. - Use
custom
for advanced, granular control.
You can easily ingest documents or pre-processed chunks, update their content, and delete them when no longer needed. Combined with powerful retrieval and knowledge graph capabilities, R2R enables seamless integration of advanced document management into your applications.