Webhooks
Configure and manage webhooks to receive real-time notifications about memory events
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:
Best Practices
-
Implement Retry Logic: Your webhook endpoint should be able to handle temporary failures and implement appropriate retry mechanisms.
-
Verify Webhook Source: Implement security measures to verify that webhook requests are coming from Mem0.
-
Process Events Asynchronously: Handle webhook events asynchronously to prevent timeouts and ensure reliable processing.
-
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: