R2R Local System Installation

This guide will walk you through installing and running R2R on your local system without using Docker. This method allows for more customization and control over individual components.

Local installation of R2R is challenging due to the numerous services it integrates. We strongly recommend using Docker to get started quickly.

If you choose to proceed with a local installation, be prepared to set up and configure the following services:

  1. Postgres with pgvector: A relational database with vector storage capabilities.
  2. Unstructured.io: A complex system for file ingestion.
  3. Neo4j: A graph database system.
  4. Hatchet: A RabbitMQ-based orchestration system.

Alternatively, you can use cloud versions of these services, but you’ll be responsible for enrolling in them and providing the necessary environment variables.

Each of these components has its own requirements, potential compatibility issues, and configuration complexities. Debugging issues in a local setup can be significantly more challenging than using a pre-configured Docker environment.

Unless you have a specific need for a local installation and are comfortable with advanced system configuration, we highly recommend using the Docker setup method for a smoother experience.

Prerequisites

Before starting, ensure you have the following installed and/or available in the cloud:

  • Python 3.8 or higher
  • pip (Python package manager)
  • Git
  • Postgres
  • Unstructured file ingestion
  • Neo4j
  • Hatchet workflow orchestration

Install the R2R CLI & Python SDK

First, install the R2R CLI and Python SDK:

pip install r2r

Environment Setup

R2R requires connections to various services. Set up the following environment variables based on your needs:

Python Development Mode

For those looking to develop R2R locally:

  1. Install Poetry: Follow instructions on the official Poetry website.

  2. Clone and install dependencies:

    git clone [email protected]:SciPhi-AI/R2R.git
    cd R2R/py
    poetry install -E core
    
  3. Setup environment: Follow the steps listed in the Environment Setup section above. Additionally, you may introduce a local .env file to make development easier, and you can customize your local r2r.toml to suit your specific needs.

Running R2R

After setting up your environment, you can start R2R using the following command:

# requires full unstructured installation
r2r serve --config-name=default

For local LLM usage:

r2r serve --config-name=local_llm

Next Steps

After successfully installing R2R:

  1. Verify Installation: Ensure all components are running correctly by accessing the R2R API at http://localhost:7272/v2/health.

  2. Quick Start: Follow our R2R Quickstart Guide to set up your first RAG application.

  3. In-Depth Tutorial: For a more comprehensive understanding, work through our R2R Walkthrough.

  4. Customize Your Setup: Configure R2R components with the Configuration Guide.

If you encounter any issues during installation or setup, please use our Discord community or GitHub repository to seek assistance.