r2r 3.6.6


pip install r2r

  Latest version

Released: Aug 17, 2025

Project Links

Meta
Author: Owen Colegrove
Requires Python: <3.13,>=3.10

Classifiers
Screenshot 2025-03-27 at 6 35 02 AM

The most advanced AI retrieval system.

Agentic Retrieval-Augmented Generation (RAG) with a RESTful API.

About

R2R is an advanced AI retrieval system supporting Retrieval-Augmented Generation (RAG) with production-ready features. Built around a RESTful API, R2R offers multimodal content ingestion, hybrid search, knowledge graphs, and comprehensive document management.

R2R also includes a Deep Research API, a multi-step reasoning system that fetches relevant data from your knowledgebase and/or the internet to deliver richer, context-aware answers for complex queries.

Usage

# Basic search
results = client.retrieval.search(query="What is DeepSeek R1?")

# RAG with citations
response = client.retrieval.rag(query="What is DeepSeek R1?")

# Deep Research RAG Agent
response = client.retrieval.agent(
  message={"role":"user", "content": "What does deepseek r1 imply? Think about market, societal implications, and more."},
  rag_generation_config={
    "model": "anthropic/claude-3-7-sonnet-20250219",
    "extended_thinking": True,
    "thinking_budget": 4096,
    "temperature": 1,
    "top_p": None,
    "max_tokens_to_sample": 16000,
  },
)

Getting Started

# Quick install and run in light mode
pip install r2r
export OPENAI_API_KEY=sk-...
python -m r2r.serve

# Or run in full mode with Docker
# 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

For detailed self-hosting instructions, see the self-hosting docs.

Demo

https://github.com/user-attachments/assets/173f7a1f-7c0b-4055-b667-e2cdcf70128b

Using the API

1. Install SDK & Setup

# Install SDK
pip install r2r  # Python
# or
npm i r2r-js    # JavaScript

2. Client Initialization

from r2r import R2RClient
client = R2RClient(base_url="http://localhost:7272")
const { r2rClient } = require('r2r-js');
const client = new r2rClient("http://localhost:7272");

3. Document Operations

# Ingest sample or your own document
client.documents.create(file_path="/path/to/file")

# List documents
client.documents.list()

Key Features

  • 📁 Multimodal Ingestion: Parse .txt, .pdf, .json, .png, .mp3, and more
  • 🔍 Hybrid Search: Semantic + keyword search with reciprocal rank fusion
  • 🔗 Knowledge Graphs: Automatic entity & relationship extraction
  • 🤖 Agentic RAG: Reasoning agent integrated with retrieval
  • 🔐 User & Access Management: Complete authentication & collection system

Community & Contributing

Our Contributors

3.6.6 Aug 17, 2025
3.6.5 Jun 06, 2025
3.6.4 Jun 02, 2025
3.6.3 May 22, 2025
3.6.2 May 21, 2025
3.6.1 May 12, 2025
3.6.0 May 08, 2025
3.5.19 May 05, 2025
3.5.18 May 01, 2025
3.5.17 Apr 28, 2025
3.5.16 Apr 25, 2025
3.5.15 Apr 23, 2025
3.5.14 Apr 18, 2025
3.5.13 Apr 17, 2025
3.5.12 Apr 16, 2025
3.5.11 Apr 10, 2025
3.5.10 Apr 07, 2025
3.5.9 Mar 31, 2025
3.5.8 Mar 28, 2025
3.5.7 Mar 28, 2025
3.5.6 Mar 25, 2025
3.5.5 Mar 21, 2025
3.5.4 Mar 21, 2025
3.5.3 Mar 19, 2025
3.5.2 Mar 18, 2025
3.5.1 Mar 18, 2025
3.5.0 Mar 16, 2025
3.4.6 Mar 14, 2025
3.4.5 Mar 13, 2025
3.4.4 Mar 05, 2025
3.4.3 Feb 25, 2025
3.4.2 Feb 21, 2025
3.4.1 Feb 11, 2025
3.4.0 Feb 09, 2025
3.3.41 Feb 09, 2025
3.3.40 Feb 09, 2025
3.3.32 Feb 01, 2025
3.3.31 Jan 25, 2025
3.3.29 Jan 16, 2025
3.3.28 Jan 15, 2025
3.3.27 Jan 11, 2025
3.3.24 Jan 08, 2025
3.3.23 Jan 08, 2025
3.3.22 Jan 08, 2025
3.3.21 Jan 07, 2025
3.3.19 Jan 04, 2025
3.3.18 Dec 18, 2024
3.3.17 Dec 17, 2024
3.3.16 Dec 17, 2024
3.3.15 Dec 17, 2024
3.3.13 Dec 11, 2024
3.3.11 Dec 11, 2024
3.3.10 Dec 10, 2024
3.3.9 Dec 10, 2024
3.3.8 Dec 10, 2024
3.3.7 Dec 07, 2024
3.3.6 Dec 07, 2024
3.3.5 Dec 06, 2024
3.3.4 Dec 06, 2024
3.3.3 Dec 06, 2024
3.3.2 Dec 05, 2024
3.3.1 Dec 04, 2024
3.3.0 Dec 04, 2024
3.2.41 Nov 06, 2024
3.2.40 Nov 02, 2024
3.2.39 Nov 01, 2024
3.2.38 Oct 31, 2024
3.2.37 Oct 31, 2024
3.2.36 Oct 30, 2024
3.2.35 Oct 28, 2024
3.2.34 Oct 24, 2024
3.2.33 Oct 24, 2024
3.2.32 Oct 24, 2024
3.2.31 Oct 24, 2024
3.2.30 Oct 23, 2024
3.2.17 Oct 22, 2024
3.2.16 Oct 18, 2024
3.2.15 Oct 17, 2024
3.2.14 Oct 16, 2024
3.2.13 Oct 15, 2024
3.2.12 Oct 11, 2024
3.2.11 Oct 11, 2024
3.2.10 Oct 09, 2024
3.2.9 Oct 08, 2024
3.2.8 Oct 05, 2024
3.2.6 Oct 05, 2024
3.2.5 Oct 04, 2024
3.2.4 Oct 04, 2024
3.2.3 Oct 04, 2024
3.2.2 Oct 03, 2024
3.2.1 Oct 03, 2024
3.2.0 Oct 02, 2024
3.1.53 Sep 26, 2024
3.1.52 Sep 24, 2024
3.1.51 Sep 24, 2024
3.1.50 Sep 24, 2024
3.1.48 Sep 24, 2024
3.1.47 Sep 23, 2024
3.1.46 Sep 23, 2024
3.1.45 Sep 23, 2024
3.1.44 Sep 21, 2024
3.1.43 Sep 21, 2024
3.1.42 Sep 21, 2024
3.1.41 Sep 21, 2024
3.1.40 Sep 21, 2024
3.1.38 Sep 19, 2024
3.1.37 Sep 19, 2024
3.1.36 Sep 19, 2024
3.1.35 Sep 18, 2024
3.1.34 Sep 18, 2024
3.1.33 Sep 18, 2024
3.1.32 Sep 18, 2024
3.1.31 Sep 18, 2024
3.1.30 Sep 17, 2024
3.1.29 Sep 16, 2024
3.1.28 Sep 13, 2024
3.1.27 Sep 12, 2024
3.1.26 Sep 12, 2024
3.1.25 Sep 12, 2024
3.1.24 Sep 12, 2024
3.1.23 Sep 11, 2024
3.1.22 Sep 11, 2024
3.1.21 Sep 11, 2024
3.1.20 Sep 11, 2024
3.1.19 Sep 11, 2024
3.1.17 Sep 10, 2024
3.1.16 Sep 10, 2024
3.1.14 Sep 07, 2024
3.1.13 Sep 06, 2024
3.1.12 Sep 06, 2024
3.1.2 Sep 06, 2024
3.1.1 Sep 06, 2024
3.1.0 Sep 06, 2024
3.0.8 Aug 29, 2024
3.0.7 Aug 28, 2024
3.0.6 Aug 27, 2024
3.0.5 Aug 27, 2024
0.3.4 Aug 24, 2024
0.3.3 Aug 24, 2024
0.3.2 Aug 24, 2024
0.3.1 Aug 24, 2024
0.3.0 Aug 23, 2024
0.2.85 Aug 13, 2024
0.2.84 Aug 08, 2024
0.2.83 Aug 08, 2024
0.2.82 Aug 06, 2024
0.2.81 Aug 06, 2024
0.2.80 Aug 06, 2024
0.2.79 Aug 05, 2024
0.2.78 Aug 03, 2024
0.2.77 Aug 03, 2024
0.2.76 Aug 02, 2024
0.2.75 Jul 31, 2024
0.2.74 Jul 31, 2024
0.2.73 Jul 28, 2024
0.2.72 Jul 27, 2024
0.2.71 Jul 27, 2024
0.2.70 Jul 24, 2024
0.2.69 Jul 24, 2024
0.2.68 Jul 22, 2024
0.2.67 Jul 22, 2024
0.2.66 Jul 22, 2024
0.2.65 Jul 22, 2024
0.2.64 Jul 22, 2024
0.2.62 Jul 19, 2024
0.2.61 Jul 18, 2024
0.2.60 Jul 14, 2024
0.2.59 Jul 12, 2024
0.2.58 Jul 12, 2024
0.2.57 Jul 12, 2024
0.2.56 Jul 12, 2024
0.2.55 Jul 11, 2024
0.2.54 Jul 11, 2024
0.2.53 Jul 11, 2024
0.2.52 Jul 09, 2024
0.2.51 Jul 03, 2024
0.2.50 Jul 01, 2024
0.2.49 Jul 01, 2024
0.2.47 Jul 01, 2024
0.2.46 Jun 30, 2024
0.2.45 Jun 29, 2024
0.2.43 Jun 29, 2024
0.2.42 Jun 29, 2024
0.2.41 Jun 29, 2024
0.2.40 Jun 29, 2024
0.2.39 Jun 27, 2024
0.2.38 Jun 25, 2024
0.2.37 Jun 23, 2024
0.2.36 Jun 23, 2024
0.2.35 Jun 22, 2024
0.2.33 Jun 21, 2024
0.2.32 Jun 21, 2024
0.2.31 Jun 21, 2024
0.2.22 Jun 16, 2024
0.2.21 Jun 15, 2024
0.2.20 Jun 15, 2024
0.2.19 Jun 15, 2024
0.2.18 Jun 13, 2024
0.2.17 Jun 13, 2024
0.2.16 Jun 13, 2024
0.2.15 Jun 13, 2024
0.2.12 Jun 07, 2024
0.2.11 Jun 06, 2024
0.2.4 Jun 02, 2024
0.2.3 May 30, 2024
0.2.2 May 30, 2024
0.2.1 May 30, 2024
0.2.0 May 23, 2024
0.1.35 Apr 17, 2024
0.1.34 Apr 10, 2024
0.1.33 Apr 10, 2024
0.1.32 Apr 10, 2024
0.1.31 Apr 05, 2024
0.1.29 Apr 04, 2024
0.1.28 Mar 29, 2024
0.1.27 Mar 25, 2024
0.1.26 Mar 12, 2024
0.1.25 Mar 11, 2024
0.1.24 Mar 09, 2024
0.1.23 Mar 03, 2024
0.1.22 Feb 29, 2024
0.1.21 Feb 27, 2024
0.1.2 Feb 27, 2024
0.1.1 Feb 26, 2024
0.1.0 Feb 21, 2024

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
aiofiles (<25.0.0,>=24.1.0)
alembic (<2.0.0,>=1.13.3)
fastapi (<0.116.0,>=0.115.11)
httpx (>=0.27.0)
openai (>=1.99.0)
python-dotenv (<2.0.0,>=1.0.1)
psycopg-binary (<4.0.0,>=3.2.3)
requests (<3.0.0,>=2.31.0)
tiktoken (<0.9.0,>=0.8.0)
toml (<0.11.0,>=0.10.2)
types-requests (<3.0.0,>=2.31.0)
types-aiofiles (<25.0.0,>=24.1.0.20240626)
typing-extensions (<5.0.0,>=4.12.2)
pydantic (>=2.10.6)
python-json-logger (>=3.2.1)
filetype (>=1.2.0)