feat(FN-1741): add memory compaction feature
- Add MemoryCompaction service in core for compacting agent memory stores - Add POST /api/memory/compact route handler in dashboard server - Add compactMemory frontend API wrapper in dashboard app - Add Compact Memory button to SettingsModal UI - Add comprehensive tests for the compaction service and routes
This commit is contained in:
@@ -323,6 +323,18 @@ export function saveMemory(content: string, projectId?: string): Promise<{ succe
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Compact memory content using AI to distill it down to the most important insights.
|
||||
* Reads current memory, compacts it via AI, and writes the result back.
|
||||
* @param projectId - Optional project ID for multi-project support
|
||||
* @returns Promise resolving to the compacted memory content
|
||||
*/
|
||||
export function compactMemory(projectId?: string): Promise<{ content: string }> {
|
||||
return api<{ content: string }>(withProjectId("/memory/compact", projectId), {
|
||||
method: "POST",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Memory backend capabilities returned by the backend status API.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user