register_retriever: Register a custom retriever

View source: R/rag_retrievers.R

register_retrieverR Documentation

Register a custom retriever

Description

Registers a retriever under a name. The handler should construct and return a query engine compatible with llama-index or a fallback with a 'query_fn'.

Usage

register_retriever(name, handler)

Arguments

name

Character scalar; retriever name (e.g., "my_retriever").

handler

Function with signature: function(llama_index, documents, similarity_top_k, response_mode, params) -> engine_or_list where the return value is either a Python query engine with '$query()' or a list with element 'query_fn' taking a single 'query' argument and returning a list with 'response' and 'source_nodes'. Note: Settings are configured globally via llama_index.core.Settings.


transforEmotion documentation built on Jan. 8, 2026, 5:06 p.m.