MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / delete_memory_internal

Method delete_memory_internal

core/src/memory/service.rs:275–291  ·  view source on GitHub ↗

Delete a memory from store and index, record history.

(
        &self,
        memory_id: &MemoryId,
        old_content: &str,
    )

Source from the content-addressed store, hash-verified

273
274 /// Delete a memory from store and index, record history.
275 async fn delete_memory_internal(
276 &self,
277 memory_id: &MemoryId,
278 old_content: &str,
279 ) -> GraphBitResult<()> {
280 // Record history BEFORE deleting (so FK constraint is satisfied).
281 // Note: with ON DELETE CASCADE, the history entry will be deleted
282 // along with the memory, so this serves as an audit log only if
283 // the cascade is disabled or history is preserved elsewhere.
284 // For now, we skip history on delete to avoid FK issues.
285
286 // Delete from store (cascades to history) and index.
287 self.store.delete_memory(memory_id).await?;
288 self.vector_index.remove(memory_id).await;
289
290 Ok(())
291 }
292}
293
294// ---------------------------------------------------------------------------

Callers 2

addMethod · 0.80
deleteMethod · 0.80

Calls 2

delete_memoryMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected