Entities
The EntitiesResource provides CRUD access to entities in the knowledge graph — people, places, organizations, preferences, skills, and other extracted concepts.
Access
user = client.for_user("user-123")
entities = user.entitiesMethods
list(**kwargs)
List entities with optional filtering.
entities_list = entities.list(type="person")
for entity in entities_list:
print(f"{entity.content} ({entity.type}) - importance: {entity.importance}")| Parameter | Type | Default | Description |
|---|---|---|---|
owner_id | str | None | None | Filter by owner |
limit | int | 100 | Maximum number to return |
offset | int | 0 | Pagination offset |
type | str | None | None | Filter by entity type |
Returns: EntityList — iterable of Entity objects
get(entity_id)
Get a single entity by ID.
entity = entities.get("entity-uuid")
print(entity.content) # Entity text content
print(entity.type) # "person", "organization", etc.
print(entity.category) # Category grouping
print(entity.importance) # 0.0 to 1.0
print(entity.community_id) # Community cluster ID
print(entity.created_at)
print(entity.updated_at)
print(entity.metadata)Returns: Entity
Entity model fields
| Field | Type | Description |
|---|---|---|
id | str | Unique identifier |
content | str | Entity text content |
type | str | Type (person, organization, location, etc.) |
category | str | None | Category grouping |
importance | float | Importance score (0.0–1.0) |
community_id | str | None | ID of the detected community cluster |
created_at | datetime | When the entity was first created |
updated_at | datetime | When the entity was last updated |
metadata | dict | None | Optional metadata |
update(entity_id, updates)
Update an entity’s fields.
from memorer.types import EntityUpdate
entity = entities.update(
"entity-uuid",
EntityUpdate(importance=0.9, category="vip")
)| Parameter | Type | Description |
|---|---|---|
entity_id | str | UUID of the entity |
updates | EntityUpdate | Fields to update (at least one required) |
EntityUpdate fields (all optional): content, type, category, importance
Returns: Updated Entity
delete(entity_id)
Soft-delete an entity.
entities.delete("entity-uuid")relationships(entity_id)
Get all incoming and outgoing relationships for an entity.
rels = entities.relationships("entity-uuid")
print(f"Outgoing: {len(rels.outgoing)}")
print(f"Incoming: {len(rels.incoming)}")
for rel in rels.outgoing:
print(f" --{rel.relationship_type}--> {rel.target_id}")Returns: EntityRelationships with fields:
entity_id— The entity IDincoming— List ofRelationshipobjects pointing to this entityoutgoing— List ofRelationshipobjects pointing from this entity
Last updated on