Overview

Webhooks allow you to receive real-time notifications when memory events occur in your Mem0 project. Webhooks are configured at the project level, meaning each webhook is associated with a specific project and will only receive events from that project. You can configure webhooks to send HTTP POST requests to your specified URLs whenever memories are created, updated, or deleted.

Managing Webhooks

Create Webhook

Create a new webhook for your project. The webhook will only receive events from the specified project:

Get Webhooks

Retrieve all webhooks configured for your project:

Update Webhook

Modify an existing webhook’s configuration. Use webhook_id to update the parameters of the webhook:

Delete Webhook

Webhook can be deleted by using the webhook_id of the webhook:

Event Types

Mem0 supports the following event types for webhooks:

  • memory:add: Triggered when a new memory is added.
  • memory:update: Triggered when an existing memory is updated.
  • memory:delete: Triggered when a memory is deleted.

Webhook Payload

When a memory event occurs in your project, Mem0 sends a POST request to your webhook URL with the following example payload structure:

{
    "event_details": {
        "id": "a1b2c3d4-e5f6-4g7h-8i9j-k0l1m2n3o4p5",
            "data": {
            "memory": "Name is Alex"
            },
        "event": "ADD"
    }
}

Best Practices

  1. Implement Retry Logic: Your webhook endpoint should be able to handle temporary failures and implement appropriate retry mechanisms.

  2. Verify Webhook Source: Implement security measures to verify that webhook requests are coming from Mem0.

  3. Process Events Asynchronously: Handle webhook events asynchronously to prevent timeouts and ensure reliable processing.

  4. Monitor Webhook Health: Regularly check your webhook logs to ensure proper functionality and handle any delivery failures.

If you have any questions, please feel free to reach out to us using one of the following methods: