8.0
热点
AI SCORE
开源项目2024-06-26 21:27
R2R V2:生产级开源 RAG 引擎
Hacker News · github.com#RAG#开源#生产级
Editor brief · 编辑速览
开源 RAG 框架发布升级版本,整合生产级功能(检索、向量存储、缓存等),对构建 AI 应用的开发者直接可用。
最先进的 AI 检索系统。通过 RESTful API 提供 Agentic Retrieval-Augmented Generation(RAG)。
通过 RESTful API 提供 Agentic Retrieval-Augmented Generation(RAG)。
R2R 是一套先进的 AI 检索系统,支持 Retrieval-Augmented Generation(RAG),并具备可用于生产环境的功能。R2R 围绕 RESTful API 构建,提供多模态内容摄取、混合搜索、知识图谱和全面的文档管理能力。
R2R 还提供 Deep Research API。这是一套多步骤推理系统,能够从你的知识库和/或互联网中获取相关数据,针对复杂查询给出信息更丰富、更具上下文感知能力的回答。
# 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,
},
)
# 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
详细的自托管说明请参阅自托管文档。
# Install SDK
pip install r2r # Python
# or
npm i r2r-js # JavaScript
from r2r import R2RClient
client = R2RClient(base_url="http://localhost:7272")
const { r2rClient } = require('r2r-js');
const client = new r2rClient("http://localhost:7272");
# Ingest sample or your own document
client.documents.create(file_path="/path/to/file")
# List documents
client.documents.list()
📁 多模态摄取:解析 .txt、.pdf、.json、.png、.mp3 等格式
🔍 混合搜索:结合语义搜索与关键词搜索,并使用倒数排名融合
🔗 知识图谱:自动提取实体及其关系
🤖 Agentic RAG:与检索能力集成的推理 Agent
🔐 用户与访问管理:完整的身份认证与 Collection 系统
加入我们的 Discord,获取支持并参与讨论。
提交功能请求或错误报告。
针对新功能、功能改进或文档提交 PR。