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

Function updateAgentMemory

app/src/utils/agent_database.ts:303–318  ·  view source on GitHub ↗
(agentId: string, memory: string)

Source from the content-addressed store, hash-verified

301
302// Update agent memory
303export async function updateAgentMemory(agentId: string, memory: string): Promise<void> {
304 const db = await openDB();
305
306 const tx = db.transaction(MEMORY_STORE, 'readwrite');
307 const store = tx.objectStore(MEMORY_STORE);
308
309 await new Promise<void>((resolve, reject) => {
310 const request = store.put({
311 id: agentId,
312 memory
313 });
314 request.onsuccess = () => resolve();
315 request.onerror = () => reject(request.error);
316 });
317 dispatchMemoryUpdate(agentId);
318}
319
320// Get agent image memory
321export async function getAgentImageMemory(agentId: string): Promise<string[]> {

Callers 6

handleSaveFunction · 0.90
handleClearFunction · 0.90
handleCreateMemoryFunction · 0.90
handleImportFunction · 0.85
saveAgentFunction · 0.85
importAgentFromFileFunction · 0.85

Calls 2

dispatchMemoryUpdateFunction · 0.90
openDBFunction · 0.85

Tested by

no test coverage detected