Quickstart

Getting started with R2R is easy.

1

Create an Account

Create an account with SciPhi Cloud. It’s free!

For those interested in deploying R2R locally, please refer here.

2

Install the SDK or CLI

R2R offers a CLI, as well as a Python and JavaScript SDK to interact with.

$pip install r2r
3

Environment

After signing into SciPhi Cloud, navigate to the homepage and click Create New Key (for the self-hosted quickstart, refer here):

API Key

Next, store your R2R API key in your local CLI, or set the local environment variable R2R_API_KEY. Be sure to include the entire API key `pk_...sk_...`.

$r2r set-api-key pk....sk_..... ### for authenticated deployments, e.g. SciPhi Cloud
># or do `export R2R_API_KEY=pk....sk_....`
4

Ingesting files

When you ingest files into R2R, the server accepts the task, processes and chunks the file, and generates a summary of the document.

$r2r documents create --file-path=</path/to/file>

Example output:

[{'message': 'Ingestion task queued successfully.', 'task_id': '2b16bb55-4f47-4e66-a6bd-da9e215b9793', 'document_id': '9fbe403b-c11c-5aae-8ade-ef22980c3ad1'}]
6

RAG

Generate a RAG response:

$r2r retrieval search --query="who was aristotle?"

Example output:

Search Results:
{'chunk_search_results': ... }
Completion:
{'results': [
{
'id': 'chatcmpl-9eXL6sKWlUkP3f6QBnXvEiKkWKBK4',
'choices': [
{
'finish_reason': 'stop',
'index': 0,
'logprobs': None,
'message': {
'content': "Aristotle (384–322 BC) was an Ancient Greek
philosopher and polymath whose writings
covered a broad range of subjects including
the natural sciences…

Additional Features

R2R offers the additional features below to enhance your document management and user experience.

Graphs

R2R provides powerful entity and relationshipo extraction capabilities that enhance document understanding and retrieval. These can leveraged to construct knowledge graphs inside R2R. The system can automatically identify entities, build relationships between them, and create enriched knowledge graphs from your document collection.

Users and Collections

R2R provides a complete set of user authentication and management features, allowing you to implement secure and feature-rich authentication systems or integrate with your preferred authentication provider. Further, collections exist to enable efficient access control and organization of users and documents.

Next Steps

Now that you have a basic understanding of R2R’s core features, you can explore more advanced topics:

Built with