Table of Contents

Property ClearHistoryBeforeExecution

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

ClearHistoryBeforeExecution

Gets or sets a value indicating whether to clear conversation history before execution.

public bool ClearHistoryBeforeExecution { get; set; }

Property Value

bool

Examples

Stateless execution:

using LMKit.Model;
using LMKit.Agents;

using var model = new LM("path/to/model.gguf");
var agent = new Agent(model);

// First interaction
agent.Run("My name is Alice.");

// Clear history for a fresh start
var freshOptions = new AgentExecutionOptions
{
    ClearHistoryBeforeExecution = true
};

// This won't remember the name
var result = agent.Run("What is my name?", freshOptions);
// Agent will not know the name was Alice

Remarks

When true, the conversation starts fresh with only the system prompt. This is useful for stateless interactions where previous context should not influence the response. Default is false.