Retrieval Configuration
Configure your retrieval system
Introduction
Search in R2R combines vector-based semantic search and knowledge graph querying to provide powerful information retrieval capabilities. The system leverages both semantic similarity and relationship-based context to deliver accurate and contextually relevant results.
R2R’s search capabilities are built on Postgres, which provides:
- Vector similarity search through the
pgvector
extension - Full-text search using
ts_rank
andwebsearch_to_tsquery
- Efficient indexing with HNSW and IVF-Flat methods
- Flexible metadata filtering using JSONB
- Feature-complete user and document management
This integrated approach ensures high performance and reliability while simplifying the overall architecture.
Server-Side Configuration
The base configuration for search capabilities is defined in your r2r.toml
file:
These settings directly impact how R2R performs search operations, as embeddings are used during semantic search. When a reranking model is specified, it becomes the default model used at runtime. See the embedding configuration for detailed parameter information.
Vector Search Configuration
Vector search can be configured both through server-side settings and runtime parameters:
For hybrid search, additional weights can be specified:
See the Search API Reference for complete parameter details.
Knowledge Graph Search Configuration
Knowledge graph search provides relationship-aware search capabilities:
See the Knowledge Graph API Reference for complete parameter details.