Table of Contents

Class MemoryConsolidator

Namespace
JD.AI.Core.Memory
Assembly
JD.AI.Core.dll

Background consolidation service that periodically reads recent daily logs and updates the long-term MEMORY.md file for each project.

public sealed class MemoryConsolidator : IDisposable
Inheritance
MemoryConsolidator
Implements
Inherited Members

Constructors

MemoryConsolidator(IMemoryService, TimeSpan?)

Creates a consolidator that runs in the background, updating MEMORY.md files every checkInterval.

public MemoryConsolidator(IMemoryService memory, TimeSpan? checkInterval = null)

Parameters

memory IMemoryService

The memory service to read/write.

checkInterval TimeSpan?

How often to check for consolidation (default: 1 hour).

Methods

ConsolidateAsync(CancellationToken)

Triggers an immediate consolidation for all known projects. Called internally on the background schedule; safe to invoke manually.

public Task ConsolidateAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task

ConsolidateProjectAsync(string, CancellationToken)

Consolidates a single project's daily logs into its MEMORY.md file. Reads logs from the last 7 days and appends a summary section.

public Task ConsolidateProjectAsync(string projectId, CancellationToken ct = default)

Parameters

projectId string
ct CancellationToken

Returns

Task

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()