RetrievalSettings

data class RetrievalSettings(val storage: SearchStorage<TextDocument, SimilaritySearchRequest>, val queryExtractor: QueryExtractor = LastUserMessageQueryExtractor(), val searchStrategy: SearchStrategy = SimilaritySearchStrategy(), val promptAugmenter: PromptAugmenter = SystemPromptAugmenter(), val enableAutomaticRetrieval: Boolean = true, val namespace: String? = null)(source)

Settings controlling how memory records are retrieved and injected into prompts (RAG).

Parameters

storage

The retrieval storage to search for relevant memory records.

queryExtractor

The extractor that defines how to derive the search query from the prompt. Defaults to LastUserMessageQueryExtractor, which uses the last user message content.

searchStrategy

The strategy that defines how to search the retrieval store.

promptAugmenter

The augmenter that defines how retrieved context is inserted into the prompt.

enableAutomaticRetrieval

When true (default), retrieval and prompt augmentation happen automatically before each LLM call. When false, the storage and strategy are still accessible for manual use inside graph strategy nodes via ai.koog.agents.longtermmemory.feature.withLongTermMemory.

namespace

Namespace (table/collection name) for a request.

Constructors

Link copied to clipboard
constructor(storage: SearchStorage<TextDocument, SimilaritySearchRequest>, queryExtractor: QueryExtractor = LastUserMessageQueryExtractor(), searchStrategy: SearchStrategy = SimilaritySearchStrategy(), promptAugmenter: PromptAugmenter = SystemPromptAugmenter(), enableAutomaticRetrieval: Boolean = true, namespace: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard