Table of Contents

Interface IMemoryService

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

Provides access to the JD.AI per-project memory directory at ~/.jdai/memory/{projectId}/. Each project has a MEMORY.md file for long-term context and a memory/YYYY/MM/ subtree for daily turn logs.

public interface IMemoryService

Properties

MemoryRoot

The root memory directory (~/.jdai/memory/).

string MemoryRoot { get; }

Property Value

string

Methods

AppendToDailyLogAsync(string, string, CancellationToken)

Appends a single entry to the daily log for the current UTC date. Entries are written to memory/{projectId}/memory/YYYY/MM/yyyy-MM-dd.md.

Task AppendToDailyLogAsync(string projectId, string entry, CancellationToken ct = default)

Parameters

projectId string
entry string
ct CancellationToken

Returns

Task

GetDailyLogAsync(string, DateTimeOffset, CancellationToken)

Reads the daily log for a specific date. Returns null if the file does not exist.

Task<string?> GetDailyLogAsync(string projectId, DateTimeOffset logDate, CancellationToken ct = default)

Parameters

projectId string
logDate DateTimeOffset
ct CancellationToken

Returns

Task<string>

GetMemoryContentAsync(string, CancellationToken)

Reads the long-term memory file for a project. Returns an empty string if the file does not exist.

Task<string> GetMemoryContentAsync(string projectId, CancellationToken ct = default)

Parameters

projectId string
ct CancellationToken

Returns

Task<string>

WriteMemoryContentAsync(string, string, CancellationToken)

Updates the long-term MEMORY.md file for a project.

Task WriteMemoryContentAsync(string projectId, string content, CancellationToken ct = default)

Parameters

projectId string
content string
ct CancellationToken

Returns

Task