Skip to main content
This basic quickstart shows how to:
  1. Ingest files into your R2R system
  2. Search over ingested files
  3. Request or stream a RAG (Retrieval-Augmented Generation) response
  4. Use the RAG Agent for more complex, interactive queries
Be sure to complete the installation instructions before continuing with this guide. If you prefer to dive straight into the API details, select a choice from below:

API Reference

Python SDK

Javascript SDK

Getting started

Start by checking that you have correctly deployed your R2R instance locally:
SciPhi Cloud includes a generous free tier and is the quickest way to get up and running with R2R. Check out the documentation here to skip the local installation!

Ingesting file(s) and directories

The remainder of this quickstart will proceed with CLI commands, but all of these commands are easily reproduced inside of the Javascript or Python SDK. Ingest your selected files or directories:
For testing: Use the sample file(s) included inside the R2R project:
Example output:
When no document ID(s) are provided to the ingest_files endpoint, a unique document ID is automatically generated for each ingested document from the input filepath and user id.
We can monitor the ingestion status by querying the documents overview endpoint:
Example output:
Ingestion is complete when all documents are in a success or failed state. Perform a search query:
The search query will use basic similarity search to find the most relevant documents. You can use advanced search methods like hybrid search or knowledge graph search depending on your use case. Example output:

RAG Response

Generate a RAG response:
Example output:

Stream a RAG Response

Stream a RAG response:
Example output (streamed):

Using the RAG Agent

The RAG Agent provides a more interactive and intelligent way to query your knowledge base. It can formulate its own questions, search for information, and provide informed responses based on the retrieved context.

Basic RAG Agent Usage

Here’s how to use the RAG Agent for a simple query: