forget_entity
Delete an entity and all its associated memories
Permanently delete an entity and all its associated observations and relations.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
entityName | string | REQUIRED | - | Name of entity to delete (1-200 chars) |
confirm | boolean | REQUIRED | - | MUST be true to confirm deletion |
Example Request
Response
Compact Mode (Default)
When COMPACT_RESPONSES=true (default), responses use short keys to reduce token usage by 40-60%:
Key mapping: ok=success, id=deletedEntityId
Verbose Mode
When COMPACT_RESPONSES=false:
Confirmation Required
If confirm is not true:
Compact Mode
Verbose Mode
Entity Not Found
Compact Mode
Verbose Mode
What Gets Deleted
When you forget an entity:
- The entity itself - Removed from
memory_entities - All observations - All facts stored about the entity
- Outgoing relations - Relations where this entity is the source
- Incoming relations - Relations where this entity is the target
Use Cases
Clean Up Test Data
Remove Outdated Entity
Privacy Request
Caution
This operation is irreversible. All data associated with the entity is permanently deleted.
Before deleting, consider:
- Use
get_entity_contextto review what will be deleted - Export important information if needed
- Check for important relations that will be affected
Errors
| Error | Cause | Fix |
|---|---|---|
| Confirmation required | confirm parameter is not true | Set confirm=true to proceed with deletion |
| Entity not found | No entity exists with the provided name | Verify entity name using list_entities |
| Invalid entity name | Name exceeds 200 chars or is empty | Provide a valid name (1-200 chars) |
| Memory not enabled | ENABLE_MEMORY feature flag is false | Set ENABLE_MEMORY=true |
| Database error | Connection or query failure | Check DB connectivity and logs |
Related Tools
list_entities- Find entity names to deleteget_entity_context- Review entity before deletionmemory_stats- Check entity counts