Interface IMemoryService
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
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
projectIdstringentrystringctCancellationToken
Returns
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
projectIdstringlogDateDateTimeOffsetctCancellationToken
Returns
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
projectIdstringctCancellationToken
Returns
WriteMemoryContentAsync(string, string, CancellationToken)
Updates the long-term MEMORY.md file for a project.
Task WriteMemoryContentAsync(string projectId, string content, CancellationToken ct = default)
Parameters
projectIdstringcontentstringctCancellationToken