Document Ingestion and Management
Ingest Files
Ingest files or directories into your R2R system:Response
Response
dict
The response from the R2R system after ingesting the files.
list[str]
required
A list of file paths or directory paths to ingest. If a directory path is provided, all files within the directory and its subdirectories will be ingested.
Optional[list[dict]]
An optional list of metadata dictionaries corresponding to each file. If provided, the length should match the number of files being ingested.
Optional[list[Union[UUID, str]]]
An optional list of document IDs to assign to the ingested files. If provided, the length should match the number of files being ingested.
Optional[list[str]]
An optional list of version strings for the ingested files. If provided, the length should match the number of files being ingested.
Optional[Union[dict, ChunkingConfig]]
The ingestion config override parameter enables developers to customize their R2R chunking strategy at runtime.
Update Files
Update existing documents:Response
Response
dict
The response from the R2R system after updating the files.
list[str]
required
A list of file paths to update.
Optional[list[Union[UUID, str]]]
required
A list of document IDs corresponding to the files being updated. When not provided, an attempt is made to generate the correct document id from the given user id and file path.
Optional[list[dict]]
An optional list of metadata dictionaries for the updated files.
Documents Overview
Retrieve high-level document information, restricted to user files, except when called by a superuser where it will then return results from over all users:Response
Response
list[dict]
A list of dictionaries containing document information.
Optional[list[Union[UUID, str]]]
An optional list of document IDs to filter the overview.
Document Chunks
Fetch chunks for a particular document:Response
Response
list[dict]
A list of dictionaries containing chunk information.
str
required
The ID of the document to retrieve chunks for.
Delete Documents
Delete a document by its ID:Response
Response
dict
The response from the R2R system after successfully deleting the documents.
list[dict]
required
A list of logical filters to perform over input documents fields which identifies the unique set of documents to delete (e.g.,
{"document_id": {"$eq": "9fbe403b-c11c-5aae-8ade-ef22980c3ad1"}}). Logical operations might include variables such as "user_id" or "title" and filters like neq, gte, etc.
