Table of Contents

Property QueryGenerationMode

Namespace
LMKit.Retrieval
Assembly
LM-Kit.NET.dll

QueryGenerationMode

Gets or sets the mode used to generate retrieval queries from user input.

public QueryGenerationMode QueryGenerationMode { get; set; }

Property Value

QueryGenerationMode

The query generation mode. Default is Original.

Examples

using var chat = new RagChat(ragEngine, chatModel);

// Use multi-query retrieval for higher recall
chat.QueryGenerationMode = QueryGenerationMode.MultiQuery;

Remarks

When set to Original, the user's question is used as-is for retrieval, matching the behavior of single-turn queries.

When set to Contextual, follow-up questions are automatically reformulated into self-contained queries using the conversation history before retrieval. This improves retrieval accuracy for multi-turn conversations where questions contain references to previous exchanges (e.g., pronouns, ellipsis, or implicit topics).

On the first turn of a conversation (no prior history), the original question is always used regardless of this setting.

See Also
Share