Overview
Configure your R2R retrieval pipeline
Introduction
Retrieval in R2R is a sophisticated system that leverages ingested data to provide powerful search and Retrieval-Augmented Generation (RAG) capabilities. It combines vector-based semantic search, knowledge graph querying, and language model generation to deliver accurate and contextually relevant results.
Key Configuration Areas
To configure the retrieval system in R2R, you’ll need to focus on several areas in your r2r.toml
file:
These settings directly impact how R2R performs retrieval operations:
- The
[database]
section configures the vector database used for semantic search and document management. - The
[embedding]
section defines the model and parameters for converting text into vector embeddings. - The
[database]
section, when configured, enables knowledge graph-based retrieval. - The
[completion]
section sets up the language model used for generating responses in the RAG pipeline.
Customization and Advanced Features
R2R’s retrieval system is highly customizable, allowing you to:
- Implement hybrid search combining vector-based and knowledge graph queries
- Customize search filters, limits, and query generation
- Add custom pipes to the search and RAG pipelines
- Implement reranking for improved result relevance
Structured Outputs
R2R supports structured outputs for RAG responses, allowing you to define specific response formats using Pydantic models. This ensures consistent, type-safe responses that can be easily validated and processed programmatically.
Here’s a simple example of using structured outputs with Pydantic models:
Pipeline Architecture
Retrieval in R2R is implemented as a pipeline and consists of the main components shown below:
Next Steps
For more detailed information on configuring specific components of the ingestion pipeline, please refer to the following pages: