轻量模式依赖 OPENAI_API_KEY,未设置无法启动;默认服务地址为 http://localhost:7272,客户端需对应配置;完整模式需先克隆仓库并设置 R2R_CONFIG_NAME=full 再用 Docker Compose 启动。
R2R
SciPhi-AIMIT长期未更新生产可用的智能体式 RAG 检索系统,提供 RESTful API,帮开发者快速搭建带检索增强的问答与搜索服务。
SoTA production-ready AI retrieval system. Agentic Retrieval-Augmented Generation (RAG) with a RESTful API.
pip install r2r
export OPENAI_API_KEY=sk-...
python -m r2r.serveREADME 未说明显存或 GPU 要求;轻量模式仅需 pip 安装并设置 OPENAI_API_KEY 即可在本地启动,完整模式通过 Docker Compose 配合 postgres 运行。
带 RESTful API 的 Agentic RAG 检索系统,帮你把多模态文档变成可搜索可问答的知识库
生产可用的智能体式 RAG 检索系统,提供 RESTful API,帮开发者快速搭建带检索增强的问答与搜索服务。
核心能力
- 解析 txt、pdf、json、png、mp3 等多模态文件入库
- 语义与关键词混合检索并用倒数排名融合排序
- 自动抽取实体与关系构建知识图谱
- 内置推理 Agent 结合检索与联网做深度研究
- 提供用户认证与集合级访问管理
容易踩的坑
- v3.6.5最新正式版2025-06-06 · 2025-06-06 22:42 UTC
What's Changed
- Context for rag tool and extended thinking with non-claude models by @nPeppon in https://github.com/SciPhi-AI/R2R/pull/2210
- Ensure that passed collection ID is set in chunk creation by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2209
- r2r k8s manifests with kustomize by @qdrddr in https://github.com/SciPhi-AI/R2R/pull/2150
New Contributors
- @nPeppon made their first contribution in https://github.com/SciPhi-AI/R2R/pull/2210
- @qdrddr made their first contribution in https://github.com/SciPhi-AI/R2R/pull/2150
Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.4...v3.6.5
- v3.6.42025-06-02 · 2025-06-02 22:31 UTC
查看更新说明
What's Changed
- update CharacterTextSplitter to correct package by @zhengwj533 in https://github.com/SciPhi-AI/R2R/pull/2199
- Fix setting non-default project name by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2201
- Remove mp4 reference by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2205
- Fix incorrect project name by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2206
- add prompt args by @zhengwj533 in https://github.com/SciPhi-AI/R2R/pull/2202
Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.3...v3.6.4
- v3.6.32025-05-22 · 2025-05-22 21:25 UTC
查看更新说明
What's Changed
- Fix community summary errors where openai returns non xml entity strings by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2196
- Fix middleware for containers by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2197
Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.2...v3.6.3
- v3.6.22025-05-21 · 2025-05-21 01:44 UTC
查看更新说明
What's Changed
- fix(ollama): correct API base URL for Ollama integration by @minatoaquaMK2 in https://github.com/SciPhi-AI/R2R/pull/2186
- Update Unstructured, make partition request async by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2187
- Allow for Dynamic Project Names by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2191
- Bump LiteLLM by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2190
- Update search_file_knowledge.py to fix filtering issue by @saifbeiruty in https://github.com/SciPhi-AI/R2R/pull/2192
- Remove SciPhi Cloud references by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2193
- Clean up orchestration and utils layout by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2194
- More workflow refactors, cleanups by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2195
New Contributors
- @minatoaquaMK2 made their first contribution in https://github.com/SciPhi-AI/R2R/pull/2186
- @saifbeiruty made their first contribution in https://github.com/SciPhi-AI/R2R/pull/2192
Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.1...v3.6.2
- 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
- fix: update Supabase token retrieval to remove unnecessary await by @suysoftware in https://github.com/SciPhi-AI/R2R/pull/2166
- Fix Firecrawl API call, web_page_search_results by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2180
- Update models, add check for empty chunks by @NolanTrem in https://github.com/SciPhi-AI/R2R/pull/2185
Full Changelog: https://github.com/SciPhi-AI/R2R/compare/v3.6.0...v3.6.1
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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
- Join our Discord for support and discussion
- Submit feature requests or bug reports
- Open PRs for new features, improvements, or documentation