selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
R2R logo

Self-host R2R

v3.6.5

Agentic RAG retrieval engine with a REST API

ReleaseOpen SourceMIT
Updated11 months ago
LanguagePython
Setup difficultyModerate
Stars
8 045
Ports
8000 (API server port inside the provided Docker image (R2R_PORT).), 7272 (Port the RESTful API is accessed on locally (base_url in SDK examples).)
Install with Docker Compose

What is R2R?

R2R is an open-source AI retrieval system built around a RESTful API, aimed at developers adding retrieval-augmented generation to their own applications. It ingests multimodal content (text, PDF, JSON, images, audio), searches with hybrid semantic + keyword retrieval using reciprocal rank fusion, extracts entities and relationships into knowledge graphs, and offers a Deep Research API that performs multi-step reasoning over your knowledge base and/or the internet. Document management and a complete user authentication and access-management system are included. You can run it quickly in light mode with pip install r2r and python -m r2r.serve, or in full mode via Docker Compose with Postgres, configuring LLM provider keys such as OpenAI and Anthropic through environment variables. Python and JavaScript SDKs talk to the API. Official documentation lives at r2r-docs.sciphi.ai, which returned 404 when checked, and the repository was last pushed in November 2025.

Should you self-host R2R?

R2R scores 59/100 on selfhost.directory (how scoring works) and ranks #6 of 7 in RAG. It has 8 045 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. It is MIT-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is WeKnora (83/100, 35 728 stars). It scores higher overall, so compare the two before you pick. See R2R vs WeKnora side by side.

Features

  • Agentic RAG / deep research
  • Document Management
  • Hybrid Search
  • Knowledge Graph Extraction
  • Multimodal ingestion
  • REST API
  • Retrieval-augmented generation (RAG)
  • User & access management

R2R README

How to install R2R

Install R2R with Docker Compose

Environment variables
R2R_CONFIG_NAME, OPENAI_API_KEY

git clone git@github.com:SciPhi-AI/R2R.git && cd R2R

export R2R_CONFIG_NAME=full OPENAI_API_KEY=sk-...

docker compose -f compose.full.yaml --profile postgres up -d

Full mode with a Postgres profile.

How to configure R2R

  • ANTHROPIC_API_KEYUncomment to enable the Anthropic LLM provider.

    Uncomment to enable the Anthropic LLM provider.

  • OPENAI_API_KEYEnvironment variable for the OpenAI LLM provider key.

    Environment variable for the OpenAI LLM provider key.

  • R2R_CONFIG_NAMEConfiguration profile to run, e.g. `full` for Docker full mode.

    Configuration profile to run, e.g. `full` for Docker full mode.

    values: full

  • R2R_HOST0.0.0.0Host the server binds to (Dockerfile ARG/ENV).

    Host the server binds to (Dockerfile ARG/ENV).

  • R2R_PORT8000Port the server listens on (Dockerfile ARG/ENV).

    Port the server listens on (Dockerfile ARG/ENV).

  • R2R_POSTGRES_DBNAMEPostgres database name.

    Postgres database name.

  • R2R_POSTGRES_HOSTHost of the Postgres database.

    Host of the Postgres database.

  • R2R_POSTGRES_PASSWORDPassword for the Postgres database.

    Password for the Postgres database.

  • R2R_POSTGRES_PORTPort of the Postgres database.

    Port of the Postgres database.

  • R2R_POSTGRES_USERUser for the Postgres database.

    User for the Postgres database.

  • R2R_PROJECT_NAMEProject name used with the Postgres database.

    Project name used with the Postgres database.

  • VERTEX_API_KEYUncomment to enable the Vertex LLM provider.

    Uncomment to enable the Vertex LLM provider.

  • XAI_API_KEYUncomment to enable the xAI LLM provider.

    Uncomment to enable the xAI LLM provider.

R2R releases & version history

More in RAG

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…