MCPcopy Create free account
hub / github.com/Roy3838/Observer / updateAgentImageMemory

Function updateAgentImageMemory

app/src/utils/agent_database.ts:352–367  ·  view source on GitHub ↗
(agentId: string, images: string[])

Source from the content-addressed store, hash-verified

350
351// Update agent image memory (replaces entire array)
352export async function updateAgentImageMemory(agentId: string, images: string[]): Promise<void> {
353 const db = await openDB();
354
355 const tx = db.transaction(IMAGE_MEMORY_STORE, 'readwrite');
356 const store = tx.objectStore(IMAGE_MEMORY_STORE);
357
358 await new Promise<void>((resolve, reject) => {
359 const request = store.put({
360 id: agentId,
361 images
362 });
363 request.onsuccess = () => resolve();
364 request.onerror = () => reject(request.error);
365 });
366 dispatchMemoryUpdate(agentId);
367}
368
369// Append images to agent's image memory
370export async function appendAgentImageMemory(agentId: string, images: string[]): Promise<void> {

Callers 4

handleDeleteImageFunction · 0.90
handleSaveAllAgentsFunction · 0.90
appendAgentImageMemoryFunction · 0.85
clearAgentImageMemoryFunction · 0.85

Calls 2

dispatchMemoryUpdateFunction · 0.90
openDBFunction · 0.85

Tested by

no test coverage detected