textrawl
byJeff Green

forget_entity

Delete an entity and all its associated memories

Permanently delete an entity and all its associated observations and relations.

Parameters

ParameterTypeRequiredDefaultDescription
entityNamestringREQUIRED-Name of entity to delete (1-200 chars)
confirmbooleanREQUIRED-MUST be true to confirm deletion

Example Request

{
  "entityName": "TestUser",
  "confirm": true
}

Response

Compact Mode (Default)

When COMPACT_RESPONSES=true (default), responses use short keys to reduce token usage by 40-60%:

{"ok":true,"id":"550e8400"}

Key mapping: ok=success, id=deletedEntityId

Verbose Mode

When COMPACT_RESPONSES=false:

{
  "success": true,
  "message": "Forgotten: TestUser and all associated memories",
  "deletedEntityId": "550e8400-e29b-41d4-a716-446655440000"
}

Confirmation Required

If confirm is not true:

Compact Mode

{"ok":false,"err":"confirm"}

Verbose Mode

{
  "success": false,
  "error": "Confirmation required",
  "message": "Set confirm=true to delete this entity and all its memories."
}

Entity Not Found

Compact Mode

{"ok":false,"err":"not_found"}

Verbose Mode

{
  "success": false,
  "error": "Entity not found",
  "message": "No entity found with name: Unknown Entity"
}

What Gets Deleted

When you forget an entity:

  1. The entity itself - Removed from memory_entities
  2. All observations - All facts stored about the entity
  3. Outgoing relations - Relations where this entity is the source
  4. Incoming relations - Relations where this entity is the target

Use Cases

Clean Up Test Data

{
  "entityName": "TestUser",
  "confirm": true
}

Remove Outdated Entity

{
  "entityName": "Old Project",
  "confirm": true
}

Privacy Request

{
  "entityName": "Former Employee",
  "confirm": true
}

Caution

This operation is irreversible. All data associated with the entity is permanently deleted.

Before deleting, consider:

  1. Use query_memory with mode="entity" to review what will be deleted
  2. Export important information if needed
  3. Check for important relations that will be affected

Errors

ErrorCauseFix
Confirmation requiredconfirm parameter is not trueSet confirm=true to proceed with deletion
Entity not foundNo entity exists with the provided nameVerify entity name using query_memory with mode="list"
Invalid entity nameName exceeds 200 chars or is emptyProvide a valid name (1-200 chars)
Memory not enabledENABLE_MEMORY feature flag is falseSet ENABLE_MEMORY=true
Database errorConnection or query failureCheck DB connectivity and logs
  • query_memory - Find entities (mode="list") or review before deletion (mode="entity")
  • get_stats - Check entity counts (scope="memory")

On this page