Quickstart
Getting started with R2R
This basic quickstart shows how to:
- Ingest files into your R2R system
- Search over ingested files
- Request or stream a RAG (Retrieval-Augmented Generation) response
- 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:
Getting started
Start by checking that you have correctly deployed your R2R instance locally:
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:
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.
Executing a search
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:
Was this page helpful?