Build, scale, and manage user-facing Retrieval-Augmented Generation applications with the R2R CLI.

R2R CLI Documentation

Installation

Before starting, make sure you have completed the R2R installation.

The R2R CLI is automatically installed as part of the R2R Python package. No additional installation steps are required.

Getting Started

  1. Ensure R2R is running correctly by checking the health status:
$r2r health

You should see output similar to:

{"status":"ok"}
  1. Ingest a sample file to test the ingestion process:
$r2r ingest-sample-file

This will download and ingest a sample text file from the R2R GitHub repository. You can verify the ingestion was successful by checking the documents overview:

$r2r documents-overview
  1. Perform a search on the ingested document:
$r2r search --query "What did Aristotle contribute to philosophy?"

This will search the ingested document for relevant information to answer the query.

  1. Generate a response using RAG (Retrieval-Augmented Generation):
$r2r rag --query "What were Aristotle's main contributions to logic?"

This will perform a search on the ingested document and use the retrieved information to generate a complete response to the query.

Additional Documentation

For more detailed information on specific functionalities of the R2R CLI, please refer to the following documentation:

  • Document Ingestion: Learn how to add, retrieve, and manage documents using the CLI.
  • Search & RAG: Explore various querying techniques and Retrieval-Augmented Generation capabilities.
  • Knowledge Graphs: Learn how to create and enrich knowledge graphs, and perform GraphRAG.
  • Server Management: Manage your R2R server, including health checks, logs, and updates.