MCPcopy
hub / github.com/ModelEngine-Group/nexent / clearMemory

Function clearMemory

frontend/services/memoryService.ts:392–411  ·  view source on GitHub ↗
(
  memoryLevel: string,
  agentId?: string
)

Source from the content-addressed store, hash-verified

390}
391
392export async function clearMemory(
393 memoryLevel: string,
394 agentId?: string
395): Promise<{ deleted_count: number; total_count: number }> {
396 try {
397 const params = new URLSearchParams({ memory_level: memoryLevel });
398 if (agentId) params.append("agent_id", agentId);
399 const url = `${API_ENDPOINTS.memory.entry.clear}?${params.toString()}`;
400
401 const res = await requestJson(url, {
402 method: "DELETE",
403 headers: getAuthHeaders(),
404 });
405 const result = res || { deleted_count: 0, total_count: 0 };
406 return result;
407 } catch (e) {
408 log.error("clearMemory error", e);
409 throw e;
410 }
411}
412
413export async function deleteMemory(
414 memoryId: string,

Callers 1

useMemoryFunction · 0.90

Calls 5

getAuthHeadersFunction · 0.90
appendMethod · 0.80
toStringMethod · 0.80
errorMethod · 0.80
requestJsonFunction · 0.70

Tested by

no test coverage detected