
R2R
SciPhi AI · Coding · Productivity
R2R is an open-source AI retrieval system from SciPhi AI that turns documents into a queryable knowledge base with hybrid search, knowledge graphs, and an agentic RAG API.

About R2R
What Is R2R
R2R (Reason to Retrieve) is a production-ready RAG framework built by SciPhi AI. Retrieval augmented generation is the core idea here: pull the right passages from your own files, then let a model answer from them. R2R takes the messy parts of a RAG pipeline, document parsing, chunking, embedding, retrieval, and grounded answer generation, and packages them behind a single RESTful API. You point it at your files, and it handles the rest.
The system targets teams that want private knowledge search without rebuilding infrastructure from scratch. It ingests common formats like text, PDF, and JSON, plus images and audio, then lets you ask questions against that material with citations attached to each answer.
R2R is open source under the MIT license, so you can stand up a self-hosted RAG service on your own hardware or in Docker. That matters when your documents contain data you can't send to a third-party service.
Getting Started
- Install the SDK with
pip install r2rfor Python ornpm i r2r-jsfor JavaScript. - Start the server locally with
python -m r2r.serve, or launch the full Docker stack withdocker compose -f compose.full.yaml --profile postgres up -d. - Create documents in the client, for example
client.documents.create(file_path="/path/to/file"), to trigger ingestion. - Run a query with
client.retrieval.search(query="...")or a cited answer withclient.retrieval.rag(query="..."). - For complex questions, call the agent endpoint with
client.retrieval.agent(...)to let the reasoning loop plan its own retrieval steps.
Product Information
A quick look at R2R's pricing, supported platforms, and performance.
Best for
The users, tasks, and scenarios where this tool fits best.
Users
- Developers building a knowledge-base assistant
- Small teams with sensitive documents
- Researchers prototyping a GraphRAG idea
Tasks
- Asking questions across a mixed document library
- Building cited answers for internal search
- Connecting retrieval to an agent workflow
Scenarios
- Standing up a private document Q&A service on company hardware
- Feeding a customer-support bot that cites its sources
- Exploring relationships across a large archive
Key features
Multimodal Ingestion
R2R parses .txt, .pdf, .json, .png, .mp3, and more through one pipeline. Audio gets transcribed and web links get scraped, so you don't write a separate preprocessor for every file type. You drop files in, and the system handles parsing, chunking, and indexing.
Hybrid Search
Retrieval combines vector similarity with keyword matching through reciprocal rank fusion. Semantic search catches paraphrases, keyword search catches exact terms, and the merge favors whichever signal is stronger for that query. This reduces both the missed hits of pure vectors and the blind spots of pure keywords.
Knowledge Graphs
During ingestion, R2R extracts entities and relationships to build a graph alongside your vectors. You can run community detection to spot topic clusters and traverse relationships, for example to find every entity linked to a given company. Graphs stay isolated per collection, which keeps tenants separate.
Agentic RAG and Deep Research API
The agent mode goes past retrieve-then-generate and plans multiple steps. It decides when to fetch more context, can reach beyond your knowledge base, and can allocate extra thinking budget to a model. Each answer carries citations, so you can trace how it reached a conclusion.
User and Collection Management
Built-in authentication and a collection system handle multi-tenant access. Collections isolate documents and graphs, so different teams or customers see only their own material. Access control is enforced at the API level.
RESTful API with Python and JavaScript SDKs
Every capability is exposed through a documented RESTful API, with official Python and JavaScript clients. You can wire R2R into an existing application without adopting a new framework, and configuration happens through a single file.
Pros and cons
Pros
- Open source under the MIT license, so you can inspect, modify, and self-host it without a vendor lock-in.
- Production features ship by default, including authentication, collections, and observability, which saves months of backend work.
- Hybrid search and knowledge graphs together cover both exact-term and relationship-based queries.
- Official Python and JavaScript SDKs make integration straightforward for most application stacks.
Cons
- Self-hosting means you own deployment, updates, and scaling, which is real work for teams without infrastructure experience.
- Running full mode needs Docker, PostgreSQL, and an OpenAI API key, so the light setup is limited for quick testing.
- The docs site has been unstable, which can slow down troubleshooting until you find current references.
Frequently asked questions
R2R builds private document search and question-answering on top of your own files. It handles ingestion, retrieval, and grounded answer generation, so you can ship a knowledge assistant without assembling the pipeline yourself.
Related content
Explore related tools, skills, and articles for R2R.
R2R Alternatives
Base Code
Base44 (Wix) · Coding · ProductivityBase Code is a shared cloud development environment from Base44. Teammates describe changes to an existing GitHub codebase in chat, preview them live and send them back as pull requests.
Google EmbeddingGemma 2
Google DeepMind · Writing · Image · CodingGoogle EmbeddingGemma 2 is a 740M-parameter open model that turns text, code, images, audio, and video frames into vectors in one 768-dimension space, running on phones and laptops.
GitGlow
GitGlow · Coding · ProductivityGitGlow is a local-first desktop Git client that lets independent developers review their own code and their AI agents' changes in one place before shipping.
