Favicon of R2R

R2R

A self-hosted AI retrieval system with document search, cited answers and research agents. Runs in Python or Docker and uses the MIT license.

R2R is a self-hosted AI retrieval system for developers building applications that answer questions using their own documents. It combines search, retrieval-augmented generation (RAG) and a reasoning agent behind a REST API. The project is open source under the MIT license and runs as a Python service or in Docker.

Its document handling covers text, PDFs and JSON, along with images and audio such as PNG and MP3 files. Hybrid search combines semantic matching with keyword search, so applications can look for meaning while still finding exact terms. R2R can also extract entities and relationships automatically to build knowledge graphs, giving applications another way to explore connections within their material.

For question answering, R2R retrieves relevant content and generates responses with citations. Its Deep Research API handles queries through multiple reasoning steps and can consult your knowledge base, the internet, or both. The retrieval agent brings that research capability into an application's conversations.

R2R also manages documents, user authentication and collections. Python and JavaScript SDKs give developers access to these capabilities through the same service. Self-hosting covers the retrieval system; the supplied examples use OpenAI and Anthropic models through external APIs. Internet research also reaches beyond the self-hosted knowledge base.

Similar to R2R