Managing & Deleting Data (GDPR)

To comply with GDPR and CCPA, Libro provides granular APIs to manage and delete user memories.

Deleting Specific Memories

You can delete a specific memory by ID or by a semantic query string using the forget() API.

JavaScript SDK

// Delete by ID
await ctx.forget({ userId: "user_123", memoryId: "uuid-1234" });

// Delete all memories matching a string
await ctx.forget({ userId: "user_123", query: "credit card number" });

Python SDK

# Delete by ID
client.forget(user_id="user_123", memory_id="uuid-1234")

# Delete by query
client.forget(user_id="user_123", query="credit card number")

Updating Memories

You can update the text or metadata of an existing memory. If the text changes, Libro automatically recalculates the 768-dim embedding via the sidecar service.

JavaScript SDK

await ctx.update({
  userId: "user_123",
  memoryId: "uuid-1234",
  text: "Updated preference: prefers dark mode.",
  metadata: { priority: "high" }
});