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

Function updateAgentImageMemory

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

Source from the content-addressed store, hash-verified

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

Callers 3

handleDeleteImageFunction · 0.90
appendAgentImageMemoryFunction · 0.85
clearAgentImageMemoryFunction · 0.85

Calls 2

dispatchMemoryUpdateFunction · 0.90
openDBFunction · 0.85

Tested by

no test coverage detected