Class MemoryExtractionResult
Contains the results of a memory extraction operation performed by the LMKit.Agents.Memory.MemoryExtractor.
public sealed class MemoryExtractionResult
- Inheritance
-
MemoryExtractionResult
- Inherited Members
Examples
Reading an extraction result (returned internally by the memory pipeline; surfaced through diagnostics or custom hooks):
using LMKit.Agents.Memory;
void Report(MemoryExtractionResult result)
{
if (!result.IsSuccess)
{
Console.Error.WriteLine($"Extraction failed: {result.Error?.Message}");
return;
}
Console.WriteLine($"Stored {result.StoredMemories.Count} of {result.TotalExtracted} candidates " +
$"({result.DuplicatesSkipped} duplicates, {result.CancelledByUser} vetoed).");
foreach (var fact in result.StoredMemories)
{
Console.WriteLine($"- [{fact.Importance}] {fact.Content}");
}
}
Remarks
This class provides access to all extracted memories, including those that were stored and those that were skipped (due to cancellation or deduplication).
Properties
- CancelledByUser
Gets the number of memories that were cancelled by the BeforeMemoryStored event handler.
- DuplicatesSkipped
Gets the number of memories that were skipped due to deduplication (a similar memory already existed in the store).
- Error
Gets the error that occurred during extraction, if any.
- IsSuccess
Gets a value indicating whether the extraction completed successfully.
- StoredMemories
Gets the memories that were successfully stored in AgentMemory.
- TotalExtracted
Gets the total number of memories identified by the LLM before filtering.