R2R

SciPhi-AIMIT长期未更新

生产可用的智能体式 RAG 检索系统,提供 RESTful API,帮开发者快速搭建带检索增强的问答与搜索服务。

SoTA production-ready AI retrieval system. Agentic Retrieval-Augmented Generation (RAG) with a RESTful API.

v3.6.5发布于 2025-06-06 22:42 UTC8,080star +12 / 7 天654fork同步于 2026-11-10 17:32 UTC

怎么上手

由 README 提炼,执行前请确认
pip install r2r
export OPENAI_API_KEY=sk-...
python -m r2r.serve
硬件要求按 README 说明

README 未说明显存或 GPU 要求;轻量模式仅需 pip 安装并设置 OPENAI_API_KEY 即可在本地启动,完整模式通过 Docker Compose 配合 postgres 运行。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

带 RESTful API 的 Agentic RAG 检索系统,帮你把多模态文档变成可搜索可问答的知识库

生产可用的智能体式 RAG 检索系统,提供 RESTful API,帮开发者快速搭建带检索增强的问答与搜索服务。

核心能力

  • 解析 txt、pdf、json、png、mp3 等多模态文件入库
  • 语义与关键词混合检索并用倒数排名融合排序
  • 自动抽取实体与关系构建知识图谱
  • 内置推理 Agent 结合检索与联网做深度研究
  • 提供用户认证与集合级访问管理

容易踩的坑

轻量模式依赖 OPENAI_API_KEY,未设置无法启动;默认服务地址为 http://localhost:7272,客户端需对应配置;完整模式需先克隆仓库并设置 R2R_CONFIG_NAME=full 再用 Docker Compose 启动。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v3.6.5
  1. v3.6.5最新正式版2025-06-06 · 2025-06-06 22:42 UTC

    What's Changed

    New Contributors

    Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.4...v3.6.5

  2. v3.6.42025-06-02 · 2025-06-02 22:31 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.3...v3.6.4

  3. v3.6.32025-05-22 · 2025-05-22 21:25 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.2...v3.6.3

  4. v3.6.22025-05-21 · 2025-05-21 01:44 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.1...v3.6.2

  5. v3.6.12025-05-12 · 2025-05-12 21:32 UTC
    查看更新说明

    A few small bug fixes and updates to the latest generation of OpenAI models for default LLMs.

    What's Changed

    Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.0...v3.6.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    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 [email protected]: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