Table of Contents

Property ExtractionModel

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

ExtractionModel

Gets or sets the language model used for memory extraction.

public LM ExtractionModel { get; set; }

Property Value

LM

When null (default), the agent's chat model is used for extraction. Set this to a different (potentially lighter) model to reduce extraction cost.

Examples

Example: Using a lightweight model for extraction

using LMKit.Agents;
using LMKit.Agents.Memory;
using LMKit.Model;

using var chatModel = new LM("path/to/large-chat-model.gguf");
using var extractionModel = new LM("path/to/small-model.gguf");
using var embeddingModel = new LM("path/to/embedding-model.gguf");

var memory = new AgentMemory(embeddingModel);
memory.ExtractionMode = MemoryExtractionMode.LlmBased;
memory.ExtractionModel = extractionModel;

Remarks

The model must support text generation but does not need tool calling support. Using a smaller model for extraction can significantly reduce latency and resource usage while maintaining good extraction quality.